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
virneo/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_gtkcairo.py
69
2207
""" GTK+ Matplotlib interface using cairo (not GDK) drawing operations. Author: Steve Chaplin """ import gtk if gtk.pygtk_version < (2,7,0): import cairo.gtk from matplotlib.backends import backend_cairo from matplotlib.backends.backend_gtk import * backend_version = 'PyGTK(%d.%d.%d) ' % gtk.pygtk_version + \ ...
agpl-3.0
rohanp/scikit-learn
benchmarks/bench_isotonic.py
268
3046
""" Benchmarks of isotonic regression performance. We generate a synthetic dataset of size 10^n, for n in [min, max], and examine the time taken to run isotonic regression over the dataset. The timings are then output to stdout, or visualized on a log-log scale with matplotlib. This alows the scaling of the algorith...
bsd-3-clause
zhangsaithu/rose_demo
script/demo_test.py
1
3023
################################################## # A demo to predict ribosome stalling using ROSE # ################################################## import sys, os import re, fileinput, math import numpy as np import random import caffe import h5py from gensim.models import word2vec import ribo_convnet from sklearn...
mit
Maccimo/intellij-community
python/helpers/pydev/pydevd.py
9
90108
''' Entry point module (keep at root): This module starts the debugger. ''' import os import sys from contextlib import contextmanager import weakref # allow the debugger to work in isolated mode Python here = os.path.dirname(os.path.abspath(__file__)) if here not in sys.path: sys.path.insert(0, here) from _pyde...
apache-2.0
hagne/atm-py
atmPy/data_archives/arm/_tools.py
1
6697
import pandas as _pd import os as _os from pathlib import Path import numpy as _np def path2info(path, verbose = False): path = Path(path) if path.is_dir(): path = list(path.iterdir())[0] #suffix suffix = path.suffix suffixlist = ['.nc', '.cdf'] if suffix not in suffixlist: raise V...
mit
olimastro/DeepMonster
tools/plot.py
1
5634
import argparse import time import sys, os import numpy as np import matplotlib.pylab as plt import PIL.Image as Image from subprocess import call def animate(y, ndim, cmap) : plt.ion() if ndim == 5: plt.figure() plt.show() for i in range(y.shape[1]) : print "Showing batch...
mit
zihua/scikit-learn
examples/decomposition/plot_pca_iris.py
65
1485
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= PCA example with Iris Data-set ========================================================= Principal Component Analysis applied to the Iris dataset. See `here <https://en.wikipedia.org/wiki/Iris_flower_data_set>`_ f...
bsd-3-clause
jorik041/scikit-learn
sklearn/ensemble/tests/test_voting_classifier.py
37
7136
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import GaussianNB from sklearn.ensemble import RandomForestCl...
bsd-3-clause
evanthebouncy/nnhmm
graph1/saved_graph.py
2
2630
import networkx as nx import matplotlib.pyplot as plt from graph import * N = 20 G_V = [(0.91653633515404, 0.4932070258979898), (0.09295461450752995, 0.9645329007473591), (0.24451556906631566, 0.4652259375620821), (0.7653140324185863, 0.8614988863794735), (0.21015262875012264, 0.3194260792001117), (0.3041107966578056...
mit
auDeep/auDeep
audeep/cli/predict.py
1
7714
# Copyright (C) 2017-2018 Michael Freitag, Shahin Amiriparian, Sergey Pugachevskiy, Nicholas Cummins, Björn Schuller # # This file is part of auDeep. # # auDeep is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation,...
gpl-3.0
vlukes/sfepy
sfepy/mesh/bspline.py
5
24238
from __future__ import print_function from __future__ import absolute_import import sys from six.moves import range sys.path.append('.') import numpy as nm from sfepy.base.base import Struct import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d.art3d import Poly3DCollection...
bsd-3-clause
yanlend/scikit-learn
sklearn/ensemble/tests/test_bagging.py
13
25689
""" Testing for the bagging ensemble module (sklearn.ensemble.bagging). """ # Author: Gilles Louppe # License: BSD 3 clause import numpy as np from sklearn.base import BaseEstimator from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.te...
bsd-3-clause
wernwa/lwfa-las-chicane-gui
gui/TabStripChartVolt.py
1
3055
# -*- coding: utf-8 -*- # # Strip chart for displaying the voltage over time # This class is derived from TabStripChart.py # # author: Watler Werner # email: wernwa@gmail.com # import os import pprint import random import sys import wx import time import thread import traceback # The recommended way to use...
gpl-3.0
larsoner/mne-python
examples/visualization/plot_3d_to_2d.py
15
4941
""" .. _ex-electrode-pos-2d: ==================================================== How to convert 3D electrode positions to a 2D image. ==================================================== Sometimes we want to convert a 3D representation of electrodes into a 2D image. For example, if we are using electrocorticography ...
bsd-3-clause
yanqd0/csft
tests/test_csft.py
1
3293
from collections import Iterable, OrderedDict from os.path import dirname, isfile, join from pandas import DataFrame, Series from pytest import fixture from csft import _csft from csft._csft import column def test_file_type(): assert '.py' == _csft.type_of_file(__file__) assert '' == _csft.type_of_file('no_...
mit
elkingtoncode/People-Networks
tests/consensus/runtests.py
4
20659
#!/usr/bin/env python # -*- coding: utf-8 -*- """Augur consensus tests. To run consensus, call the Serpent functions in this order: interpolate center tokenize covariance loop max_components: blank loop max_iterations: loadings latent deflate score reputation_delta weighted_delta select_sc...
gpl-3.0
bayespy/bayespy
bayespy/demos/pattern_search.py
5
3944
################################################################################ # Copyright (C) 2015 Jaakko Luttinen # # This file is licensed under the MIT License. ################################################################################ """ Demonstration of the pattern search method for PCA. The pattern s...
mit
khkaminska/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
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/pandas/tests/series/test_timeseries.py
6
31551
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import pytest import numpy as np from datetime import datetime, timedelta, time import pandas as pd import pandas.util.testing as tm from pandas._libs.tslib import iNaT from pandas.compat import lrange, StringIO, product from pandas.core.indexes.timedeltas import Time...
agpl-3.0
ssaeger/scikit-learn
sklearn/manifold/locally_linear.py
37
25852
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from ..base import B...
bsd-3-clause
NonWhite/IA_EP3
code/classifier_utils.py
1
1093
import math from copy import copy from sklearn.cross_validation import cross_val_score def import_csv( filepath , has_header = True ) : csv_data = [] with open( filepath , 'r' ) as f : print "Reading %s" % filepath p = lambda x : int( x ) if float( x ) == math.trunc( float( x ) ) else float( x ) for line in f ...
gpl-2.0
ternaus/kaggle_digit_recognizer
src/double_layer.py
1
3615
from __future__ import division from lasagne import layers from lasagne.updates import nesterov_momentum from nolearn.lasagne import NeuralNet from lasagne.nonlinearities import softmax from sklearn.preprocessing import StandardScaler import numpy as np from sklearn.preprocessing import LabelEncoder __author__ = 'Vladi...
mit
adam-rabinowitz/ngs_analysis
scripts/Variants/plotChromVariantFrequency.py
2
4545
'''plotChromVariantFrequency.py Usage: plotChromVariantFrequency.py <snpfile> <mincov> <bamfile> <outfile> ''' import collections import os import re import pysam import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from general_python import docopt # Extract and process arguments args = do...
gpl-2.0
wronk/mne-python
mne/stats/regression.py
4
17595
# Authors: Tal Linzen <linzen@nyu.edu> # Teon Brooks <teon.brooks@gmail.com> # Denis A. Engemann <denis.engemann@gmail.com> # Jona Sassenhagen <jona.sassenhagen@gmail.com> # Marijn van Vliet <w.m.vanvliet@gmail.com> # # License: BSD (3-clause) from inspect import isgenerator from co...
bsd-3-clause
eramirem/astroML
book_figures/chapter8/fig_cross_val_B.py
3
2641
""" Cross Validation Examples: part 2 --------------------------------- Figure 8.13 Three models of increasing complexity applied to our toy dataset (eq. 8.75). The d = 2 model, like the linear model in figure 8.12, suffers from high bias, and underfits the data. The d = 19 model suffers from high variance, and overfi...
bsd-2-clause
cschenck/blender_sim
cutil/video_creator.py
1
18026
#!/usr/bin/env python import os import cv2 import numpy as np import subprocess import tempfile import connor_util as cutil def draw_arrow(image, p, q, color, arrow_magnitude=9, thickness=1, line_type=8, shift=0): # adapted from http://mlikihazar.blogspot.com.au/2013/02/draw-arrow-opencv.html # draw arrow t...
gpl-3.0
EJFielding/ISCE_utils
ISCE2ROI.py
1
9027
#! /usr/bin/env python # Create ROI_pac format Inputs for Paul's version of Rowena's resamptool script # modified from Pietro's script "PreparePaul.py" EJF 2014/12/11-29 # uses some GIAnT functions so must run under Python2 # does not yet convert the LOS angles to the ROI_pac convention import numpy as np import matp...
apache-2.0
dmnfarrell/epitopemap
modules/pepdata/hpv.py
1
2977
# Copyright (c) 2014. Mount Sinai School of Medicine # # 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 o...
apache-2.0
jorge2703/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
andrewcbennett/iris
docs/iris/example_code/General/rotated_pole_mapping.py
7
1662
""" Rotated pole mapping ===================== This example uses several visualisation methods to achieve an array of differing images, including: * Visualisation of point based data * Contouring of point based data * Block plot of contiguous bounded data * Non native projection and a Natural Earth shaded relief ...
gpl-3.0
Akshay0724/scikit-learn
examples/manifold/plot_swissroll.py
330
1446
""" =================================== Swiss Roll reduction with LLE =================================== An illustration of Swiss Roll reduction with locally linear embedding """ # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # License: BSD 3 clause (C) INRIA 2011 print(__doc__) import matplotlib.pyplot...
bsd-3-clause
nmayorov/scikit-learn
sklearn/model_selection/_validation.py
14
35585
""" The :mod:`sklearn.model_selection._validation` module includes classes and functions to validate the model. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause from __...
bsd-3-clause
wjlei1990/EarlyWarning
nn.linear/data/crop_data.py
1
5218
""" 1) use the arrival time to generate windows 2) use the window and seismogram to generate measurements(inside windows) """ from __future__ import print_function, division import os import sys # NOQA import numpy as np import h5py import pandas as pd import obspy import json from obspy import UTCDateTime import matp...
gpl-3.0
dwhswenson/contact_map
contact_map/contact_count.py
1
14734
import collections import scipy import numpy as np import pandas as pd import warnings from .plot_utils import ranged_colorbar, make_x_y_ranges, is_cmap_diverging # matplotlib is technically optional, but required for plotting try: import matplotlib import matplotlib.pyplot as plt except ImportError: HAS_M...
lgpl-2.1
ArvinPan/opencog
opencog/python/spatiotemporal/temporal_events/__init__.py
33
9273
from scipy.stats.distributions import rv_frozen from spatiotemporal.temporal_events.relation_formulas import FormulaCreator, RelationFormulaGeometricMean, BaseRelationFormula, RelationFormulaConvolution from spatiotemporal.temporal_events.util import calculate_bounds_of_probability_distribution from spatiotemporal.time...
agpl-3.0
gimli-org/gimli
pygimli/solver/solver.py
1
89934
#!/usr/bin/env python # -*- coding: utf-8 -*- """TODO DOCUMENT ME""" from copy import deepcopy import numpy as np import numpy.matlib import pygimli as pg def parseDictKey_(key, markers): return parseMarkersDictKey(key, markers) def parseMarkersDictKey(key, markers): """ Parse dictionary key of type str to ...
apache-2.0
dandanvidi/capacity-usage
scripts/correlation_E_to_CU.py
3
3073
# -*- coding: utf-8 -*- """ Created on Mon Jun 20 13:39:20 2016 @author: dan """ import pandas as pd from capacity_usage import CAPACITY_USAGE import matplotlib.pyplot as plt #import seaborn as sns import sys, os import numpy as np from scipy.stats import ranksums, wilcoxon, pearsonr, spearmanr cmap = plt.cm.Blues ...
mit
FireCARES/fire-risk
fire_risk/models/DIST/providers/ahs.py
1
11306
import random from pandas import DataFrame, melt FDID_TO_AHS = { 'WP801-TX': 'Austin-Round Rock, TX AHS Area', '24001-NY': 'New York, NY AHS Area', '07212-FL': 'Orlando, FL AHS Area', '28008-NY': 'Rochester, NY AHS Area', '23035-PA': 'Philadelphia, PA-NJ AHS Area', # 'Northern New Jersey, NJ A...
mit
lotrus28/TaboCom
linear_model/model_test/old_par_cross_test_patients.py
1
9420
import pandas as pd import itertools import sys import time import multiprocessing import numpy as np global num_compl num_compl = 0 def acc_for_multiplier(RMSEs, mult): heal_RMSE = RMSEs[0] ibd_RMSE = RMSEs[1] delta = heal_RMSE - (ibd_RMSE * mult) delta = ['Healthy' if i < 0 else 'IBD' for i in delta...
apache-2.0
decebel/librosa
tests/test_time_frequency.py
3
9433
#!/usr/bin/env python # -*- encoding: utf-8 -*- # CREATED:2015-02-14 19:13:49 by Brian McFee <brian.mcfee@nyu.edu> '''Unit tests for time and frequency conversion''' import os try: os.environ.pop('LIBROSA_CACHE_DIR') except KeyError: pass import matplotlib matplotlib.use('Agg') import librosa import numpy as...
isc
blaisb/cfdemUtilities
phillips/compareMonitorTorque.py
2
3652
# This programs compares two log file of two different openfoam cases being run (or that have finished, etc.) # The variable compared is the torque in the Z direction # Author : Bruno Blais # Last modified : 23-01-2014 #Python imports #---------------------------------------- import os import sys import numpy import ...
lgpl-3.0
alphacsc/alphacsc
alphacsc/tests/test_learn_d_z_multi.py
1
4601
import pytest import numpy as np from alphacsc.utils import check_random_state from alphacsc.learn_d_z_multi import learn_d_z_multi from alphacsc.convolutional_dictionary_learning import BatchCDL, GreedyCDL from alphacsc.online_dictionary_learning import OnlineCDL from alphacsc.init_dict import init_dictionary @pyte...
bsd-3-clause
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/scipy/interpolate/interpolate.py
4
103293
""" Classes for interpolating values. """ from __future__ import division, print_function, absolute_import __all__ = ['interp1d', 'interp2d', 'spline', 'spleval', 'splmake', 'spltopp', 'lagrange', 'PPoly', 'BPoly', 'NdPPoly', 'RegularGridInterpolator', 'interpn'] import itertools import warnin...
gpl-3.0
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/numpy/lib/function_base.py
30
124613
from __future__ import division, absolute_import, print_function import warnings import sys import collections import operator import numpy as np import numpy.core.numeric as _nx from numpy.core import linspace, atleast_1d, atleast_2d from numpy.core.numeric import ( ones, zeros, arange, concatenate, array, asarr...
mit
albertbup/DeepBeliefNet
examples/save_demo.py
3
1274
import numpy as np np.random.seed(1337) # for reproducibility from sklearn.datasets import load_digits from sklearn.model_selection import train_test_split from sklearn.metrics.classification import accuracy_score from dbn.tensorflow import SupervisedDBNClassification # Loading dataset digits = load_digits() X, Y =...
mit
gef756/statsmodels
statsmodels/tsa/statespace/mlemodel.py
2
88741
""" State Space Model Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np import pandas as pd from scipy.stats import norm from .kalman_smoother import KalmanSmoother, SmootherResults from .kalman_filter import ( KalmanFilter, Filter...
bsd-3-clause
toobaz/pandas
pandas/io/formats/csvs.py
2
11062
""" Module for formatting output data into CSV files. """ import csv as csvlib from io import StringIO import os import warnings from zipfile import ZipFile import numpy as np from pandas._libs import writers as libwriters from pandas.core.dtypes.generic import ( ABCDatetimeIndex, ABCIndexClass, ABCMult...
bsd-3-clause
sperka/shogun
examples/undocumented/python_modular/graphical/inverse_covariance_estimation_demo.py
26
2520
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from pylab import show, imshow def simulate_data (n,p): from modshogun import SparseInverseCovariance import numpy as np #create a random pxp covariance matrix cov = np.random.normal(size=(p,p)) #generate data set with multivariate Gaussi...
gpl-3.0
clemkoa/scikit-learn
examples/linear_model/plot_sparse_logistic_regression_mnist.py
31
2702
""" ===================================================== MNIST classfification using multinomial logistic + L1 ===================================================== Here we fit a multinomial logistic regression with L1 penalty on a subset of the MNIST digits classification task. We use the SAGA algorithm for this pur...
bsd-3-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/pandas/tests/plotting/test_datetimelike.py
7
47670
from datetime import datetime, timedelta, date, time import nose from pandas.compat import lrange, zip import numpy as np from pandas import Index, Series, DataFrame from pandas.tseries.index import date_range, bdate_range from pandas.tseries.offsets import DateOffset from pandas.tseries.period import period_range, ...
mit
CivicKnowledge/metatab-packages
healthpolicy.ucla.edu-chis/pylib/__init__.py
1
1680
""" Example pylib functions""" def convert(resource, doc, env, *args, **kwargs): """ Read a stata file for CHIS, convert to codes, and yield it back out """ from metapack.rowgenerator import PandasDataframeSource from publicdata.chis.prepare import to_codes import pandas as pd fspath = doc....
mit
chris-ch/omarket
python-lab/src/pricetools.py
1
1689
import logging import os import csv import pandas from datetime import date def load_prices(prices_path, exchange, security_code): letter = security_code[0] dir_path = os.sep.join([prices_path, exchange, letter, security_code]) logging.info('accessing prices from: %s' % str(os.path.abspath(dir_path))) ...
apache-2.0
ruohoruotsi/librosa
librosa/decompose.py
1
17664
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Spectrogram decomposition ========================= .. autosummary:: :toctree: generated/ decompose hpss nn_filter """ import numpy as np import scipy.sparse from scipy.ndimage import median_filter import sklearn.decomposition from . import core fro...
isc
calico/basenji
basenji/emerald.py
1
2997
# Copyright 2017 Calico 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
apache-2.0
fzalkow/scikit-learn
examples/linear_model/lasso_dense_vs_sparse_data.py
348
1862
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ print(__doc__) from time import time from scipy import sparse from scipy ...
bsd-3-clause
rmhyman/DataScience
Lesson2/get_hourly_entries_mta_data.py
1
2504
import pandas def get_hourly_entries(df): ''' The data in the MTA Subway Turnstile data reports on the cumulative number of entries and exits per row. Assume that you have a dataframe called df that contains only the rows for a particular turnstile machine (i.e., unique SCP, C/A, and UNIT)....
mit
procoder317/scikit-learn
sklearn/decomposition/tests/test_nmf.py
47
8566
import numpy as np from scipy import linalg from sklearn.decomposition import nmf from scipy.sparse import csc_matrix from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert_array_almost...
bsd-3-clause
xubenben/scikit-learn
examples/plot_kernel_ridge_regression.py
230
6222
""" ============================================= Comparison of kernel ridge regression and SVR ============================================= Both kernel ridge regression (KRR) and SVR learn a non-linear function by employing the kernel trick, i.e., they learn a linear function in the space induced by the respective k...
bsd-3-clause
BleekerLab/Solanum_sRNAs
scripts/get_mirnas_from_shortstack_res.py
1
1417
#!/usr/bin/env python """ Take one Shortstack result file and creates a fasta file containing all miRNAs Usage: python get_mirnas_from_shortstack_res.py -i [shortstack result file] -o [path/to/outfile] Example: python get_mirnas_from_shortstack_res.py -i shortstack/C32/Results.txt -o C32_miRNAs.fasta """ #########...
mit
procoder317/scikit-learn
sklearn/preprocessing/tests/test_imputation.py
213
11911
import numpy as np 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 import assert_false from sklearn.utils.testing import assert_true from sklearn.preprocessing.imputa...
bsd-3-clause
shyamalschandra/scikit-learn
sklearn/cluster/tests/test_k_means.py
41
27789
"""Testing for K-means""" import sys import numpy as np from scipy import sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import SkipTest from sklearn.utils.testing i...
bsd-3-clause
cybernet14/scikit-learn
sklearn/cross_decomposition/tests/test_pls.py
215
11427
import numpy as np from sklearn.utils.testing import (assert_array_almost_equal, assert_array_equal, assert_true, assert_raise_message) from sklearn.datasets import load_linnerud from sklearn.cross_decomposition import pls_ from nose.tools import assert_equal def test_pls(): d =...
bsd-3-clause
mjbommar/cscs-530-w2016
notebooks/basic-stats/hiv_model.py
2
14808
#m.space Standard imports import copy import itertools # Scientific computing imports import numpy import matplotlib.pyplot as plt import networkx import pandas import seaborn class Person(object): """ Person class, which encapsulates the entire behavior of a person. """ def __init__(self, model,...
bsd-2-clause
reuk/parallel-reverb-raytracer
filter_test/linkwitzriley.py
1
2168
import numpy as np import scipy.signal as signal import matplotlib.pyplot as plt from scikits.audiolab import Format, Sndfile from os.path import splitext def getC(co, sr): wcT = np.pi * co / sr return np.cos(wcT) / np.sin(wcT) def lopass1ord(c): a0 = c + 1 b = [1 / a0, 1 / a0] a = [1.0, (1 - c) /...
gpl-2.0
vanpact/scipy
scipy/interpolate/fitpack2.py
39
61117
""" fitpack --- curve and surface fitting with splines fitpack is based on a collection of Fortran routines DIERCKX by P. Dierckx (see http://www.netlib.org/dierckx/) transformed to double routines by Pearu Peterson. """ # Created by Pearu Peterson, June,August 2003 from __future__ import division, print_function, abs...
bsd-3-clause
DrXyzzy/smc
src/smc_sagews/smc_sagews/graphics.py
2
27549
############################################################################### # # CoCalc: Collaborative Calculation in the Cloud # # Copyright (C) 2016, Sagemath Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publishe...
agpl-3.0
lmallin/coverage_test
python_venv/lib/python2.7/site-packages/pandas/tests/plotting/test_series.py
6
30296
# coding: utf-8 """ Test cases for Series.plot """ import itertools import pytest from datetime import datetime import pandas as pd from pandas import Series, DataFrame, date_range from pandas.compat import range, lrange import pandas.util.testing as tm from pandas.util.testing import slow import numpy as np from...
mit
OSHI7/Learning1
test1.py
1
1085
list=['happy', 'sad', 'quick', 'slow'] # for item in list: # print(item) import numpy as np import Utils #%% cell list=['happy', 'sad', 'quick', 'slow'] for item in list: print(item) i=iter(list) #print(i()) print(i) print('hello dead') print('eh mon') import matplotlib.pyplot as plt #%% Add and giv...
mit
madsbk/bohrium
doc/source/conf.py
3
6213
# -*- coding: utf-8 -*- # # Bohrium documentation build configuration file, created by # sphinx-quickstart on Tue Nov 14 14:03:06 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
apache-2.0
jstraub/rtmf
python/evalNYU.py
1
3426
# Copyright (c) 2015, Julian Straub <jstraub@csail.mit.edu> Licensed # under the MIT license. See the license file LICENSE. #import matplotlib.pyplot as plt #import matplotlib.cm as cm import numpy as np #import cv2 import scipy.io import subprocess as subp import os, re, time, random import argparse #from vpCluster...
mit
mbraeunlein/CurrentVoltage
old/get_peaks.py
1
11343
import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib.mathtext import sys, glob import datetime import pdb plt.ion() ######################################################################## def smooth(x,window_len=11,window='hanning'): if x.ndim != 1: raise Val...
mit
nrhine1/scikit-learn
examples/feature_selection/plot_permutation_test_for_classification.py
250
2233
""" ================================================================= Test with permutations the significance of a classification score ================================================================= In order to test if a classification score is significative a technique in repeating the classification procedure aft...
bsd-3-clause
depet/scikit-learn
examples/gaussian_process/plot_gp_regression.py
253
4054
#!/usr/bin/python # -*- coding: utf-8 -*- r""" ========================================================= Gaussian Processes regression: basic introductory example ========================================================= A simple one-dimensional regression exercise computed in two different ways: 1. A noise-free cas...
bsd-3-clause
ClaudioNahmad/Servicio-Social
Parametros/CosmoMC/prerrequisitos/plc-2.0/src/python/clik/smicahlp.py
2
37204
import parobject as php import numpy as nm import re def base_smica(root_grp,hascl,lmin,lmax,nT,nP,wq,rqhat,Acmb,rq0=None,bins=None): if bins==None: nbins = 0 else: bins.shape=(-1,(lmax+1-lmin)*nm.sum(hascl)) nbins = bins.shape[0] bins=bins.flat[:] lkl_grp = php.add_lkl_generic(root_grp,"smica",1...
gpl-3.0
UiL-OTS-labs/iSpector
utils/arguments.py
1
3674
#!/usr/bin/env python ## # \file arguments.py # # In this file handeling of commandline arguments is handled. import argparse import matplotlib from gui.ispectorgui import MainGuiModel import gui.ispectorgui PARSER = None ARGS = None LOGO = "iSpectorLogo.svg" class TestActionOption(argparse.Action): ## mess...
gpl-2.0
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/pandas/tools/plotting.py
9
132091
# being a bit too dynamic # pylint: disable=E1101 import datetime import warnings import re from math import ceil from collections import namedtuple from contextlib import contextmanager from distutils.version import LooseVersion import numpy as np from pandas.util.decorators import cache_readonly, deprecate_kwarg fr...
artistic-2.0
pratapvardhan/scikit-learn
examples/cluster/plot_agglomerative_clustering_metrics.py
402
4492
""" Agglomerative clustering with different metrics =============================================== Demonstrates the effect of different metrics on the hierarchical clustering. The example is engineered to show the effect of the choice of different metrics. It is applied to waveforms, which can be seen as high-dimens...
bsd-3-clause
charanpald/wallhack
wallhack/modelselect/GenerateToyData2.py
1
2467
""" We generate a toy regression dataset """ import numpy import logging import sys import scipy.stats import matplotlib.pyplot as plt from sandbox.util.PathDefaults import PathDefaults logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) numpy.random.seed(21) numFeatures = 2 numCentres = 10 numPositives = ...
gpl-3.0
scholi/pySPM
pySPM/utils/elts.py
1
13517
# -- coding: utf-8 -- # Copyright 2018 Olivier Scholder <o.scholder@gmail.com> """ Handle elements to calculate mass, abundance, etc. """ from __future__ import absolute_import import sqlite3 import os import re from .constants import me from .misc import deprecated def formulafy(x): """ Convert the input ...
apache-2.0
Nyker510/scikit-learn
examples/ensemble/plot_random_forest_embedding.py
286
3531
""" ========================================================= Hashing feature transformation using Totally Random Trees ========================================================= RandomTreesEmbedding provides a way to map data to a very high-dimensional, sparse representation, which might be beneficial for classificati...
bsd-3-clause
slifty/audfprint
audfprint_match.py
3
18994
""" audfprint_match.py Fingerprint matching code for audfprint 2014-05-26 Dan Ellis dpwe@ee.columbia.edu """ import librosa import numpy as np import scipy.signal import time # for checking phys mem size import resource # for localtest and illustrate import audfprint_analyze import matplotlib.pyplot as plt import a...
mit
sebastianhaas/PyLaTeX
examples/basic.py
3
1310
#!/usr/bin/python """ This example shows matplotlib functionality. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ # begin-doc-include from pylatex import Document, Section, Subsection from pylatex.utils import italic, escape_latex def fill_document(doc): """Add a...
mit
willgrass/pandas
bench/serialize.py
1
2061
import time, os import numpy as np import la import pandas def timeit(f, iterations): start = time.clock() for i in xrange(iterations): f() return time.clock() - start def roundtrip_archive(N, iterations=10): # Create data arr = np.random.randn(N, N) lar = la.larry(arr) dma = p...
bsd-3-clause
foxsi/foxsi-smex
pyfoxsi/doc/source/conf.py
6
10204
# -*- coding: utf-8 -*- # # PyFOXSI documentation build configuration file, created by # sphinx-quickstart on Tue Sep 1 09:46:00 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
mit
bgris/ODL_bgris
lib/python3.5/site-packages/skimage/feature/tests/test_util.py
35
2818
import numpy as np try: import matplotlib.pyplot as plt except ImportError: plt = None from numpy.testing import assert_equal, assert_raises from skimage.feature.util import (FeatureDetector, DescriptorExtractor, _prepare_grayscale_input_2D, _mask...
gpl-3.0
DGrady/pandas
asv_bench/benchmarks/series_methods.py
6
3587
from .pandas_vb_common import * class series_constructor_no_data_datetime_index(object): goal_time = 0.2 def setup(self): self.dr = pd.date_range( start=datetime(2015,10,26), end=datetime(2016,1,1), freq='50s' ) # ~100k long def time_series_constructo...
bsd-3-clause
lthurlow/Boolean-Constrained-Routing
networkx-1.8.1/doc/make_gallery.py
12
2477
#!/usr/bin/env python # generate a thumbnail gallery of examples template = """\ {%% extends "layout.html" %%} {%% set title = "Gallery" %%} {%% block body %%} <h3>Click on any image to see source code</h3> <br/> %s {%% endblock %%} """ link_template = """\ <a href="%s"><img src="%s" border="0" alt="%s"/></a> """ ...
mit
andersbll/deeppy-website
_downloads/convnet_mnist.py
5
3024
#!/usr/bin/env python """ Convnets for image classification (1) ===================================== """ import numpy as np import deeppy as dp import matplotlib import matplotlib.pyplot as plt # Fetch MNIST data dataset = dp.dataset.MNIST() x_train, y_train, x_test, y_test = dataset.data(dp_dtypes=True) # Bring...
mit
kaslusimoes/SummerSchool2016
python/almostnewsimulation.py
1
7049
#! /bin/env python2 # coding: utf-8 import numpy as np import networkx as nx import matplotlib.pyplot as plt import random as rd import os from pickle import dump, load class Data: def __init__(self): self.m_list1 = [] self.m_list2 = [] N = 100 M = 100 MAX = N + M + 1 MAX_EDGE = 380 MAX_DEG = 450...
apache-2.0
cainiaocome/scikit-learn
sklearn/tests/test_grid_search.py
68
28778
""" Testing for grid search module (sklearn.grid_search) """ from collections import Iterable, Sized from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.externals.six.moves import xrange from itertools import chain, product import pickle import sys import numpy as np import scipy.sparse as sp ...
bsd-3-clause
DSLituiev/scikit-learn
sklearn/svm/tests/test_sparse.py
35
13182
from nose.tools import assert_raises, assert_true, assert_false import numpy as np from scipy import sparse from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) from sklearn import datasets, svm, linear_model, base from sklearn.datasets import make_classif...
bsd-3-clause
mayblue9/scikit-learn
benchmarks/bench_plot_lasso_path.py
301
4003
"""Benchmarks of Lasso regularization path computation using Lars and CD The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function from collections import defaultdict import gc import sys from time import time import numpy as np from sklearn.linear_model import lars_pat...
bsd-3-clause
dingocuster/scikit-learn
sklearn/feature_selection/__init__.py
244
1088
""" The :mod:`sklearn.feature_selection` module implements feature selection algorithms. It currently includes univariate filter selection methods and the recursive feature elimination algorithm. """ from .univariate_selection import chi2 from .univariate_selection import f_classif from .univariate_selection import f_...
bsd-3-clause
epfl-mobots/thymio-ground-localisation
code/create_plots.py
1
21615
#!/usr/bin/env python # -*- coding: utf-8 -*- # cython: profile=False # kate: replace-tabs off; indent-width 4; indent-mode normal; remove-trailing-spaces all; # vim: ts=4:sw=4:noexpandtab import os import numpy as np import matplotlib matplotlib.use("PDF") # do this before pylab so you don't get the default back end....
lgpl-3.0
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/matplotlib/widgets.py
10
56160
""" GUI Neutral widgets =================== Widgets that are designed to work for any of the GUI backends. All of these widgets require you to predefine an :class:`matplotlib.axes.Axes` instance and pass that as the first arg. matplotlib doesn't try to be too smart with respect to layout -- you will have to figure ou...
mit
tejasckulkarni/hydrology
ch_599/ch_599_daily_wb_ver_2.py
2
31458
__author__ = 'kiruba' import numpy as np import matplotlib.pyplot as plt import pandas as pd import itertools from spread import spread from scipy.optimize import curve_fit import math from matplotlib import rc from datetime import timedelta import scipy as sp import meteolib as met from bisect import bisect_left imp...
gpl-3.0
anirudhjayaraman/scikit-learn
sklearn/cluster/tests/test_birch.py
342
5603
""" Tests for the birch clustering algorithm. """ from scipy import sparse import numpy as np from sklearn.cluster.tests.common import generate_clustered_data from sklearn.cluster.birch import Birch from sklearn.cluster.hierarchical import AgglomerativeClustering from sklearn.datasets import make_blobs from sklearn.l...
bsd-3-clause
aleksandr-bakanov/astropy
examples/coordinates/plot_obs-planning.py
3
6298
# -*- coding: utf-8 -*- """ =================================================================== Determining and plotting the altitude/azimuth of a celestial object =================================================================== This example demonstrates coordinate transformations and the creation of visibility cur...
bsd-3-clause
5agado/conversation-analyzer
src/util/plotting.py
1
5870
import os from datetime import datetime import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import util.io as mio from util import statsUtil from model.message import Message SAVE_PLOT = False def plotBasicLengthStatsByYearAndMonth(data, yearsToShow=None, targetStats=None, ...
apache-2.0
Clyde-fare/scikit-learn
sklearn/decomposition/tests/test_fastica.py
272
7798
""" Test the fastica algorithm. """ import itertools import warnings import numpy as np from scipy import stats from nose.tools import assert_raises from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from skl...
bsd-3-clause