repo_name
stringlengths
7
90
path
stringlengths
5
191
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
976
581k
license
stringclasses
15 values
2uller/LotF
App/Lib/site-packages/scipy/signal/fir_filter_design.py
2
20124
"""Functions for FIR filter design.""" from __future__ import division, print_function, absolute_import from math import ceil, log import numpy as np from numpy.fft import irfft from scipy.special import sinc from . import sigtools __all__ = ['kaiser_beta', 'kaiser_atten', 'kaiserord', 'firwin', 'firwin2',...
gpl-2.0
ntim/g4sipm
sample/plots/luigi/contrib/legend.py
1
3239
#!/usr/bin/env python # -*- coding: utf-8 -*- from matplotlib.table import Table from matplotlib.artist import allow_rasterization from matplotlib.text import Text import sig class LegendTable(Table): def __init__(self, ax, loc=None, bbox=None, title=None, offset=None): Table.__init__(self, ax, loc, bbox) ...
gpl-3.0
stylianos-kampakis/scikit-learn
sklearn/utils/metaestimators.py
283
2353
"""Utilities for meta-estimators""" # Author: Joel Nothman # Andreas Mueller # Licence: BSD from operator import attrgetter from functools import update_wrapper __all__ = ['if_delegate_has_method'] class _IffHasAttrDescriptor(object): """Implements a conditional property using the descriptor protocol. ...
bsd-3-clause
deepesch/scikit-learn
sklearn/neighbors/tests/test_nearest_centroid.py
305
4121
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
bsd-3-clause
sliwy/kaggle-cervix
kmeans_validation.py
1
2123
import pandas as pd from sklearn.cross_validation import train_test_split import cv2 import numpy as np from sklearn.cluster import KMeans FILE_PATH = '../data/' def compute_histogram(img, hist_size=100): hist = cv2.calcHist([img], [0], mask=None, histSize=[hist_size], ranges=(0, 255)) hist = cv2.no...
gpl-3.0
mne-tools/mne-tools.github.io
0.20/_downloads/e8440d4a71ce3cd53b39ebc6f55d87ec/plot_linear_regression_raw.py
11
2388
""" ======================================== Regression on continuous data (rER[P/F]) ======================================== This demonstrates how rER[P/F]s - regressing the continuous data - is a generalisation of traditional averaging. If all preprocessing steps are the same, no overlap between epochs exists, and ...
bsd-3-clause
alephu5/Soundbyte
environment/lib/python3.3/site-packages/pandas/tseries/index.py
1
66377
# pylint: disable=E1101 import operator from datetime import time, datetime from datetime import timedelta import numpy as np from pandas.core.common import (isnull, _NS_DTYPE, _INT64_DTYPE, is_list_like,_values_from_object, _maybe_box, notnull, ABCSeri...
gpl-3.0
cpadavis/wizard
wizard/dndz.py
1
28574
""" Go from paircounts to phi(z) .. module:: dndz """ from __future__ import print_function, division import numpy as np import astropy.cosmology import pandas as pd from astropy.cosmology import WMAP9 def dndz(pairs, redshifts, redshift_bins, dndz_path='', integrate='paircounts', w_estimator='LS', ...
mit
aminert/scikit-learn
examples/applications/svm_gui.py
287
11161
""" ========== Libsvm GUI ========== A simple graphical frontend for Libsvm mainly intended for didactic purposes. You can create data points by point and click and visualize the decision region induced by different kernels and parameter settings. To create positive examples click the left mouse button; to create neg...
bsd-3-clause
christianurich/VIBe2UrbanSim
3rdparty/opus/src/opus_core/indicator_framework/core/indicator_data_manager.py
2
12819
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE import re from opus_core.configurations.dataset_pool_configuration import DatasetPoolConfiguration from opus_core.indicator_framework.core.source_dat...
gpl-2.0
malcolmw/SeisPy
seispy/pandas/io/fixed_width.py
3
2431
import os import pandas as pd from . import schema as _schema def read_fwf(path=None, schema="css3.0", tables=None): r"""Read fixed-width-format database tables into a DataFrame. :param str path: Path to database. :param str schema: Schema identifier. :param list tables: A list of table populate. ...
gpl-3.0
barentsen/dave
fergalplay/comparebls.py
1
5232
# -*- coding: utf-8 -*- """ Created on Mon Feb 8 20:44:54 2016 @author: fergal $Id$ $URL$ """ __version__ = "$Id$" __URL__ = "$URL$" import matplotlib.pyplot as mp import numpy as np import dave.fileio.kplrfits as kplrfits import dave.pipeline.fergalmain as fm import dave.pipeline.task as task import dave.pipel...
mit
shyamalschandra/scikit-learn
examples/linear_model/plot_sgd_iris.py
286
2202
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print(__doc__) ...
bsd-3-clause
harshaneelhg/scikit-learn
examples/hetero_feature_union.py
288
6236
""" ============================================= Feature Union with Heterogeneous Data Sources ============================================= Datasets can often contain components of that require different feature extraction and processing pipelines. This scenario might occur when: 1. Your dataset consists of hetero...
bsd-3-clause
mwrightevent38/MissionPlanner
Lib/site-packages/scipy/cluster/hierarchy.py
53
94069
""" Function Reference ------------------ These functions cut hierarchical clusterings into flat clusterings or find the roots of the forest formed by a cut by providing the flat cluster ids of each observation. .. autosummary:: :toctree: generated/ fcluster fclusterdata leaders These are routines for a...
gpl-3.0
jojonas/py1090
examples/plot_basemap_3dpaths.py
1
1233
import sys, os.path sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) import os.path from collections import defaultdict, namedtuple from mpl_toolkits.basemap import Basemap from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt import py1...
mit
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/ticks_and_spines/auto_ticks.py
1
2324
""" ================================= Automatically setting tick labels ================================= Setting the behavior of tick auto-placement. If you don't explicitly set tick positions / labels, Matplotlib will attempt to choose them both automatically based on the displayed data and its limits. By default,...
mit
EFord36/normalise
evaluation/gold_standard_eval.py
1
2673
# -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import (accuracy_score, confusion_matrix, precision_score, recall_score) from normalise.class_NUMB import run_clfNUMB, gen_fra...
gpl-3.0
aabadie/scikit-learn
sklearn/datasets/tests/test_20news.py
280
3045
"""Test the 20news downloader, if the data is available.""" import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import SkipTest from sklearn import datasets def test_20news(): try: data = dat...
bsd-3-clause
siutanwong/scikit-learn
sklearn/learning_curve.py
110
13467
"""Utilities to evaluate models with respect to a variable """ # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import warnings import numpy as np from .base import is_classifier, clone from .cross_validation import check_cv from .externals.joblib import Parallel, delayed fro...
bsd-3-clause
yonglehou/scikit-learn
sklearn/cluster/tests/test_dbscan.py
114
11393
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from scipy.spatial import distance from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing im...
bsd-3-clause
cpaulik/xray
xray/core/variable.py
1
34899
from datetime import timedelta import functools import itertools import numpy as np import pandas as pd from . import common from . import indexing from . import ops from . import utils from .pycompat import basestring, OrderedDict, zip, reduce, dask_array_type from .indexing import (PandasIndexAdapter, LazilyIndexed...
apache-2.0
wesm/statsmodels
scikits/statsmodels/sandbox/distributions/examples/matchdist.py
5
9771
'''given a 1D sample of observation, find a matching distribution * estimate maximum likelihood paramater for each distribution * rank estimated distribution by Kolmogorov-Smirnov and Anderson-Darling test statistics Author: Josef Pktd License: Simplified BSD original December 2008 TODO: * refactor to result clas...
bsd-3-clause
ndardenne/pymatgen
setup.py
2
5488
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os from io import open import sys import platform from setuptools import setup, find_packages, Extension from setuptools.command.build_ext import build_ext as _build_ext class build_ext(_build_ext): ...
mit
ximion/dep11
dep11/statsgenerator.py
2
5009
#!/usr/bin/env python3 # # Copyright (C) 2015-2016 Matthias Klumpp <mak@debian.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3.0 of the License, or (at your opti...
lgpl-2.1
yavalvas/yav_com
build/matplotlib/lib/mpl_toolkits/axisartist/axisline_style.py
8
5277
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from matplotlib.patches import _Style, FancyArrowPatch from matplotlib.transforms import IdentityTransform from matplotlib.path import Path import numpy as np class _FancyAxislineStyle: class S...
mit
pgleeson/neurotune
neurotune/utils.py
1
3909
''' Script to plot evolution of parameters in neurotune ''' import math def plot_generation_evolution(sim_var_names, target_values = {}, individuals_file_name = '../data/ga_individuals.csv', show_plot_already = ...
bsd-3-clause
rhyolight/nupic.research
projects/sequence_prediction/discrete_sequences/plotMultiplePrediction.py
12
3551
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
hrjn/scikit-learn
sklearn/linear_model/tests/test_logistic.py
18
41552
import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.util...
bsd-3-clause
Diviyan-Kalainathan/causal-humans
Cause-effect/lib/fsic/indtest.py
2
56584
""" Module containing many types of independence testing methods. """ __author__ = 'wittawat' from abc import ABCMeta, abstractmethod from data import PairedData #import matplotlib.pyplot as plt import numpy as np #from numba import jit import data as data import util as util import feature as fea #from fsic.util imp...
mit
drpngx/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_test.py
21
54488
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
rl-institut/reegis_hp
reegis_hp/de21/plots.py
3
21748
import pandas as pd import numpy as np import os import geoplot import locale import datetime from matplotlib import pyplot as plt from matplotlib.colors import LinearSegmentedColormap import matplotlib.patheffects as path_effects # import configuration as config from oemof.tools import logger from reegis_hp.de21 impo...
gpl-3.0
MAndelkovic/pybinding
pybinding/system.py
1
19231
"""Structural information and utilities""" import functools import itertools import numpy as np import matplotlib.pyplot as plt from . import _cpp from . import pltutils from .lattice import Lattice from .utils import with_defaults, rotate_axes from .support.alias import AliasArray from .support.fuzzy_set import Fuzz...
bsd-2-clause
PanDAWMS/panda-server
pandaserver/server/panda.py
1
17875
#!/usr/bin/python """ entry point """ import datetime import traceback import six import tempfile import io import signal import json import gzip # config file from pandaserver.config import panda_config from pandaserver.taskbuffer.Initializer import initializer from pandaserver.taskbuffer.TaskBuffer import taskBu...
apache-2.0
harisbal/pandas
pandas/tests/generic/test_series.py
4
8241
# -*- coding: utf-8 -*- # pylint: disable-msg=E1101,W0612 from operator import methodcaller import pytest import numpy as np import pandas as pd from distutils.version import LooseVersion from pandas import Series, date_range, MultiIndex from pandas.compat import range from pandas.util.testing import (assert_series...
bsd-3-clause
fspaolo/scikit-learn
sklearn/utils/tests/test_testing.py
13
3044
import warnings import unittest import sys from nose.tools import assert_raises from sklearn.utils.testing import ( _assert_less, _assert_greater, assert_warns, assert_no_warnings, assert_equal, set_random_state, assert_raise_message) from sklearn.tree import DecisionTreeClassifier from s...
bsd-3-clause
xwolf12/scikit-learn
examples/classification/plot_digits_classification.py
289
2397
""" ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual <introduction>`. """ print(__doc__) # Autho...
bsd-3-clause
roxyboy/scikit-learn
sklearn/utils/tests/test_utils.py
215
8100
import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import pinv2 from itertools import chain from sklearn.utils.testing import (assert_equal, assert_raises, assert_true, assert_almost_equal, assert_array_equal, SkipTest, ...
bsd-3-clause
r-mart/scikit-learn
sklearn/linear_model/bayes.py
220
15248
""" Various bayesian regression """ from __future__ import print_function # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from .base import LinearModel from ..base import RegressorMixin from ..utils.extmath import fast_logdet, p...
bsd-3-clause
gregcaporaso/qiime
scripts/plot_semivariogram.py
6
15026
#!/usr/bin/env python # File created on 09 Feb 2010 from __future__ import division __author__ = "Antonio Gonzalez Pena" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Antonio Gonzalez Pena", "Kyle Patnode", "Yoshiki Vazquez-Baeza"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "A...
gpl-2.0
choderalab/open-forcefield-group
nmr/ace_X_NME/code/dipeptide_parameters.py
2
1538
from simtk import unit as u import numpy as np import pandas as pd import itertools padding = 0.95 * u.nanometers cutoff = 0.9 * u.nanometers temperature = 303 * u.kelvin timestep = 2.0 * u.femtoseconds equilibration_timestep = 1.0 * u.femtoseconds barostat_frequency = 25 pressure = 1.0 * u.atmosphere friction = 0....
gpl-2.0
CarlosA-Lopez/Proyecto_Embebidos_Grupo2
plotly-1.2.9/plotly/matplotlylib/mpltools.py
1
17970
""" Tools A module for converting from mpl language to plotly language. """ import math import warnings import datetime import matplotlib.dates def check_bar_match(old_bar, new_bar): """Check if two bars belong in the same collection (bar chart). Positional arguments: old_bar -- a previously sorted bar...
unlicense
0x0all/scikit-learn
examples/classification/plot_digits_classification.py
289
2397
""" ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual <introduction>`. """ print(__doc__) # Autho...
bsd-3-clause
desihub/desispec
py/desispec/qa/qa_plots.py
1
51582
""" Module for QA plots """ from __future__ import print_function, absolute_import, division import os import numpy as np from scipy import signal import scipy import scipy.stats import pdb import copy from astropy.time import Time from desiutil.log import get_logger from desispec import fluxcalibration as dsflux fr...
bsd-3-clause
jmankoff/idata
install_scripts/jupyter_notebook_config.py
1
21891
# Configuration file for jupyter-notebook. #------------------------------------------------------------------------------ # Application(SingletonConfigurable) configuration #------------------------------------------------------------------------------ ## This is an application. ## The date format used by logging f...
gpl-3.0
Dino0631/RedRain-Bot
lib/youtube_dl/extractor/wsj.py
19
4502
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, unified_strdate, ) class WSJIE(InfoExtractor): _VALID_URL = r'''(?x) (?: https?://video-api\.wsj\.com/api-vid...
gpl-3.0
lukeiwanski/tensorflow-opencl
tensorflow/contrib/learn/python/learn/estimators/kmeans_test.py
2
18517
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
datapythonista/pandas
pandas/core/base.py
1
38015
""" Base and utility classes for pandas objects. """ from __future__ import annotations import textwrap from typing import ( TYPE_CHECKING, Any, Generic, Hashable, TypeVar, cast, ) import numpy as np import pandas._libs.lib as lib from pandas._typing import ( ArrayLike, Dtype, Dt...
bsd-3-clause
capgadsx/acalib
acalib/algorithms/attic/gaussClumps.py
4
39243
import numpy as np from collections import deque from astropy.table import Table from scipy.optimize import fmin_bfgs,check_grad,approx_fprime #from scipy.optimize.linesearch import (line_search_BFGS, line_search_wolfe1, line_search_wolfe2, line_search_wolfe2 as line_search) #from optimize import fmin_bfgs import cop...
gpl-3.0
WafaaT/spark-tk
regression-tests/sparktkregtests/testcases/models/random_forest_classifier_test.py
10
8579
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
liberatorqjw/scikit-learn
examples/linear_model/plot_ransac.py
250
1673
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example we see how to robustly fit a linear model to faulty data using the RANSAC algorithm. """ import numpy as np from matplotlib import pyplot as plt from sklearn import ...
bsd-3-clause
sourabhdattawad/BuildingMachineLearningSystemsWithPython
ch02/chapter.py
17
4700
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License from matplotlib import pyplot as plt import numpy as np # We load the data with load_iris from sklear...
mit
devanshdalal/scikit-learn
examples/semi_supervised/plot_label_propagation_digits_active_learning.py
36
4076
""" ======================================== Label Propagation digits active learning ======================================== Demonstrates an active learning technique to learn handwritten digits using label propagation. We start by training a label propagation model with only 10 labeled points, then we select the t...
bsd-3-clause
pajanne/ngsreports
legacy/send_audit_reports.py
2
4524
""" Python script send_audit_reports Created by Anne Pajon under user 'pajon01' on 26/07/2016 """ import argparse import os import pandas as pd import smtplib from email import Encoders from email.MIMEBase import MIMEBase from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText # import site ...
mit
carrillo/scikit-learn
sklearn/linear_model/bayes.py
220
15248
""" Various bayesian regression """ from __future__ import print_function # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from .base import LinearModel from ..base import RegressorMixin from ..utils.extmath import fast_logdet, p...
bsd-3-clause
mmalter/dlstats
dlstats/fetchers/bea.py
2
9879
# -*- coding: utf-8 -*- """ Created on Thu Sep 10 11:35:26 2015 @author: salimeh """ from dlstats.fetchers._commons import Fetcher, Datasets, Providers, CodeDict from dlstats import constants import urllib import xlrd import csv import codecs from datetime import datetime import pandas import pprint from collections ...
agpl-3.0
shaowei-su/pyAudioAnalysis
data/testComputational.py
5
3609
import sys from pyAudioAnalysis import audioBasicIO from pyAudioAnalysis import audioFeatureExtraction from pyAudioAnalysis import audioTrainTest as aT from pyAudioAnalysis import audioSegmentation as aS import matplotlib.pyplot as plt import time nExp = 4 def main(argv): if argv[1] == "-shortTerm": for i in range...
apache-2.0
DGrady/pandas
pandas/core/generic.py
2
249354
# pylint: disable=W0231,E1101 import collections import warnings import operator import weakref import gc import json import numpy as np import pandas as pd from pandas._libs import tslib, lib from pandas.core.dtypes.common import ( _ensure_int64, _ensure_object, is_scalar, is_number, is_integer, ...
bsd-3-clause
pjryan126/solid-start-careers
store/api/zillow/venv/lib/python2.7/site-packages/pandas/core/panel4d.py
2
1831
""" Panel4D: a 4-d dict like collection of panels """ from pandas.core.panelnd import create_nd_panel_factory from pandas.core.panel import Panel Panel4D = create_nd_panel_factory(klass_name='Panel4D', orders=['labels', 'items', 'major_axis', ...
gpl-2.0
xasos/crowdsource-platform
crowdsourcing/viewsets/csvmanager.py
3
3588
from rest_framework.viewsets import ViewSet from rest_framework import status from rest_framework.response import Response from crowdsourcing.serializers.requesterinputfile import RequesterInputFileSerializer from crowdsourcing.serializers.task import TaskSerializer from crowdsourcing.models import RequesterInputFile, ...
mit
galactics/beyond
doc/source/_static/hohmann.py
2
2636
"""Example of Hohmann transfer The orbit we are starting with is a Tle of the ISS. The amplitude of the maneuver is greatly exagerated regarding the ISS's capability, but has the convenience to be particularly visual. """ import sys import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import ...
mit
fabianp/scikit-learn
examples/svm/plot_svm_kernels.py
329
1971
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM-Kernels ========================================================= Three different types of SVM-Kernels are displayed below. The polynomial and RBF are especially useful when the data-points are not linearly sep...
bsd-3-clause
bcharlas/mytrunk
examples/concrete/interaction-histogram.py
10
1273
#!/usr/bin/python # -*- coding: utf-8 -*- # # demonstration of the yade.post2d module (see its documentation for details) # import pylab # the matlab-like interface of matplotlib pylab.ioff() import numpy import os.path # run uniax.py to get this file loadFile='/tmp/uniax-tension.yade.gz' if not os.path.exists(loadFil...
gpl-2.0
tseaver/google-cloud-python
bigquery/tests/unit/test_magics.py
1
46662
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
allotria/intellij-community
python/helpers/pycharm_matplotlib_backend/sitecustomize.py
10
1837
import os import sys import traceback SHOW_DEBUG_INFO = os.getenv('PYCHARM_DEBUG', 'False').lower() in ['true', '1'] def debug(message): if SHOW_DEBUG_INFO: sys.stderr.write(message) sys.stderr.write("\n") debug("Executing PyCharm's `sitecustomize`") modules_list = [] try: # We want to impo...
apache-2.0
btabibian/scikit-learn
sklearn/cluster/k_means_.py
8
60187
"""K-means clustering""" # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Thomas Rueckstiess <ruecksti@in.tum.de> # James Bergstra <james.bergstra@umontreal.ca> # Jan Schlueter <scikit-learn@jan-schlueter.de> # Nelle Varoquaux # Peter Prettenhofer <peter.prettenh...
bsd-3-clause
YinongLong/scikit-learn
examples/cluster/plot_kmeans_assumptions.py
270
2040
""" ==================================== Demonstration of k-means assumptions ==================================== This example is meant to illustrate situations where k-means will produce unintuitive and possibly unexpected clusters. In the first three plots, the input data does not conform to some implicit assumptio...
bsd-3-clause
manterd/myPhyloDB
functions/analysis/norm_graphs.py
1
46683
import datetime from django.http import HttpResponse from django_pandas.io import read_frame import json import logging from numpy import * import numpy as np from numpy.random.mtrand import RandomState import pandas as pd import pickle from pyper import * import zipfile import psutil from database.models import Sampl...
gpl-3.0
shaharkadmiel/seispy
pySW4/utils/spectral.py
2
9858
""" Python module for spectral analysis. .. module:: spectral :author: Shahar Shani-Kadmiel (s.shanikadmiel@tudelft.nl) :copyright: Shahar Shani-Kadmiel :license: This code is distributed under the terms of the GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.htm...
gpl-3.0
dougnd/matplotlib2tikz
test/testfunctions/text_overlay.py
1
2562
# -*- coding: utf-8 -*- # desc = 'Regular plot with overlay text' # phash = '770b23744b93c68d' phash = '370b233649d3f64c' def plot(): from matplotlib import pyplot as pp import numpy as np fig = pp.figure() xxx = np.linspace(0, 5) yyy = xxx**2 pp.text(1, 5, 'test1', size=50, rotation=30., ...
mit
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/pandas/tests/test_dtypes.py
9
6239
# -*- coding: utf-8 -*- from itertools import product import nose import numpy as np from pandas import Series, Categorical, date_range import pandas.core.common as com from pandas.core.common import (CategoricalDtype, is_categorical_dtype, is_categorical, DatetimeTZDtype, is_datetime64...
artistic-2.0
JsNoNo/scikit-learn
sklearn/linear_model/coordinate_descent.py
59
76336
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
bsd-3-clause
drefk99/skynet_beeva
python-scripts-historico/his_bancomer.py
1
2973
import json import tweepy from tweepy import Stream from tweepy.streaming import StreamListener ...
mit
imk1/IMKTFBindingCode
runElasticNetRegressionFromRankNorm.py
1
8675
import sys import argparse import os import pybedtools as bt import numpy as np from deeplearning.mergedPeaksSummitAndMakeContinuousMat import show_value from sklearn.linear_model import ElasticNet from scipy.stats import spearmanr def parseArgument(): # Parse the input parser = argparse.ArgumentParser(description="...
mit
macioosch/dynamo-hard-spheres-sim
convergence-csv.py
1
3147
#!/usr/bin/env python2 # encoding=utf-8 from __future__ import division, print_function from glob import glob from math import pi from pprint import pprint from sys import argv, stdout from xml.dom import minidom import bz2 import csv import matplotlib.pyplot as plt import re # local imports from my_helper_functions_...
gpl-3.0
ankurankan/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
254
2253
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
robbymeals/scikit-learn
sklearn/tree/tree.py
113
34767
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Da...
bsd-3-clause
khkaminska/scikit-learn
sklearn/feature_extraction/tests/test_dict_vectorizer.py
276
3790
# Authors: Lars Buitinck <L.J.Buitinck@uva.nl> # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from random import Random import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils.testing import (assert_equal, assert_in, ...
bsd-3-clause
gef756/statsmodels
statsmodels/sandbox/tsa/example_arma.py
27
11572
'''trying to verify theoretical acf of arma explicit functions for autocovariance functions of ARIMA(1,1), MA(1), MA(2) plus 3 functions from nitime.utils ''' from __future__ import print_function from statsmodels.compat.python import range import numpy as np from numpy.testing import assert_array_almost_equal impor...
bsd-3-clause
3manuek/scikit-learn
sklearn/tree/export.py
75
15670
""" This module defines export functions for decision trees. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Dawe <noel@dawe.me> # Satrajit Gosh <satrajit.ghosh@gmail.com> # Trevor...
bsd-3-clause
alekz112/statsmodels
examples/python/ols.py
30
5601
## Ordinary Least Squares from __future__ import print_function import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std np.random.seed(9876789) # ## OLS estimation # # Artificial data: nsample = 100 x = np.linspace(0, 1...
bsd-3-clause
public-ink/public-ink
server/appengine/lib/mpl_toolkits/gtktools.py
10
19272
""" Some gtk specific tools and widgets * rec2gtk : put record array in GTK treeview - requires gtk Example usage import matplotlib.mlab as mlab import mpl_toolkits.gtktools as gtktools r = mlab.csv2rec('somefile.csv', checkrows=0) formatd = dict( weight = mlab.FormatFloat(2), ...
gpl-3.0
kkoksvik/FreeCAD
src/Mod/Plot/plotSeries/TaskPanel.py
26
17784
#*************************************************************************** #* * #* Copyright (c) 2011, 2012 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* ...
lgpl-2.1
ucsd-progsys/ml2
learning/randomforest2.py
2
3950
import math import os.path import random random.seed() from sklearn import tree from sklearn.ensemble import RandomForestClassifier import numpy as np import pandas as pd import input_old csvs2 = [f for f in os.listdir('ml2/data/fa15/op+context-count+type+size') if f.endswith('.csv')] csvs = [f for f in os.listdir('...
bsd-3-clause
trungnt13/scikit-learn
examples/linear_model/plot_bayesian_ridge.py
248
2588
""" ========================= Bayesian Ridge Regression ========================= Computes a Bayesian Ridge Regression on a synthetic dataset. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shift...
bsd-3-clause
yonglehou/scikit-learn
examples/cluster/plot_dbscan.py
346
2479
# -*- coding: utf-8 -*- """ =================================== Demo of DBSCAN clustering algorithm =================================== Finds core samples of high density and expands clusters from them. """ print(__doc__) import numpy as np from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn...
bsd-3-clause
linebp/pandas
scripts/groupby_sample.py
7
1847
from pandas import * import numpy as np import string import pandas.compat as compat g1 = np.array(list(string.letters))[:-1] g2 = np.arange(510) df_small = DataFrame({'group1': ["a", "b", "a", "a", "b", "c", "c", "c", "c", "c", "a", "a", "a", "b", "b", "b", "b"], ...
bsd-3-clause
ytoyama/yans_2015_poster
fig/bar_chart.py
2
1310
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt plt.rc('font', family='IPAGothic', size=24) import sys import csv def error(*items): print(*items, file=sys.stderr) exit(1) def main(csv_file, png_file): with open(csv_file, newline='') as f: labels = next(csv.reader(f)) result...
bsd-2-clause
mengli/PcmAudioRecorder
kaggle/Avito/avito.py
2
10574
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV file I...
apache-2.0
14thibea/megamix
megamix/batch/initializations.py
1
12778
# -*- coding: utf-8 -*- # #Created on Mon Apr 3 15:14:34 2017 # #author: Elina Thibeau-Sutre # import numpy as np import random def initialization_random(n_components,points): """ This method returns an array of k points which will be used in order to initialize a k_means algorithm Parameters ...
apache-2.0
parnellj/fitbit_generator
fitbit_generator/grapher.py
1
4197
from __future__ import division import matplotlib.pyplot as plt import matplotlib.dates as mdates import datetime import numpy as np from scipy.interpolate import spline from datetime import datetime as dt, timedelta ds_raw = [] start_time = dt(1900,1,1) with open('20170221_0700_to_2359_hr.txt', 'r') as ...
gpl-3.0
DSLituiev/scikit-learn
examples/ensemble/plot_forest_iris.py
335
6271
""" ==================================================================== Plot the decision surfaces of ensembles of trees on the iris dataset ==================================================================== Plot the decision surfaces of forests of randomized trees trained on pairs of features of the iris dataset. ...
bsd-3-clause
dbarbier/ot-svn
python/doc/pyplots/LinearEnumerateFunction.py
4
2604
import matplotlib.pyplot as plt # Create the figure plt.figure(1, figsize=(4, 4)) ax = plt.subplot(111) # Create the points ax.plot([0, 0, 1, 0, 1, 2, 3, 2, 1, 0], [ 0, 1, 0, 2, 1, 0, 0, 1, 2, 3], "o", markersize=9) # Create the arrows ax.annotate("", xy=(0.97, 0), xycoords='data', xy...
gpl-3.0
js850/nested_sampling
nested_sampling/models/harmonic_nowalk.py
1
2614
"""classes and functions related to a particle in a n dimensional harmonic potential""" import numpy as np from nested_sampling.utils.result import Result from harmonic import vector_random_uniform_hypersphere def get_random_configuration_Emax(ndim, Emax, Eground=None, kappa_sqrt=None, x0=None): """return a rand...
bsd-2-clause
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/pandas/tests/plotting/test_converter.py
14
7243
import pytest from datetime import datetime, date import numpy as np from pandas import Timestamp, Period, Index from pandas.compat import u import pandas.util.testing as tm from pandas.tseries.offsets import Second, Milli, Micro, Day from pandas.compat.numpy import np_datetime64_compat converter = pytest.importorski...
agpl-3.0
nicoddemus/backtrader
backtrader/utils/date.py
4
1295
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
gpl-3.0
EmreAtes/spack
var/spack/repos/builtin/packages/py-htseq/package.py
5
1930
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
yonglehou/scikit-learn
sklearn/datasets/mlcomp.py
289
3855
# Copyright (c) 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause """Glue code to load http://mlcomp.org data as a scikit.learn dataset""" import os import numbers from sklearn.datasets.base import load_files def _load_document_classification(dataset_path, metadata, set_=None, **kwargs): if ...
bsd-3-clause
XiaoxiaoLiu/morphology_analysis
utilities/writeAffineTransformsFromCSV.py
1
2408
# -*- coding: utf-8 -*- """ Created on Thu Jun 25 18:19:18 2015 @author: xiaoxiaol [ trv_00 trv_01 trv_02 trv_09 trv_03 trv_04 trv_05 trv_10 trv_06 trv_07 trv_08 trv_11 ] """ # table column names # Index([u'specimen_id', u'specimen_name', u'id', u'tvr_00', u'tvr_01', u'tvr_02', u'tvr_03', u'tvr_04', u'tvr_05...
gpl-3.0
shoyer/xarray
xarray/plot/plot.py
1
33258
""" Use this module directly: import xarray.plot as xplt Or use the methods on a DataArray or Dataset: DataArray.plot._____ Dataset.plot._____ """ import functools import numpy as np import pandas as pd from .facetgrid import _easy_facetgrid from .utils import ( _add_colorbar, _ensure_plottable, ...
apache-2.0