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
dancastellani/urbanutils
urban_utils/pandas_utils.py
1
1525
import pandas def merge_series_summing_values(series_a, series_b): '''This method merges two series summing columns.''' if series_a is None or series_b is None: if series_a is not None: # only b is None return series_a.copy() elif series_b is not None: # only a is None ...
mit
amueller/advanced_training
plots/plot_linear_svc_regularization.py
15
1065
import matplotlib.pyplot as plt import numpy as np from sklearn.svm import SVC from sklearn.datasets import make_blobs def plot_linear_svc_regularization(): X, y = make_blobs(centers=2, random_state=4, n_samples=30) fig, axes = plt.subplots(1, 3, figsize=(12, 4)) # a carefully hand-designed dataset lol ...
bsd-2-clause
googledatalab/pydatalab
google/datalab/utils/commands/_utils.py
2
27199
# Copyright 2015 Google Inc. 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 applicable law or agreed ...
apache-2.0
hamogu/marxs
marxs/design/tolerancing.py
1
26010
# Licensed under GPL version 3 - see LICENSE.rst import inspect from functools import wraps import collections from copy import copy import warnings import numpy as np from transforms3d import affines, euler from astropy.table import Table from astropy import table import astropy.units as u from ..simulator import Par...
gpl-3.0
pjryan126/solid-start-careers
store/api/zillow/venv/lib/python2.7/site-packages/pandas/sparse/tests/test_sparse.py
1
71073
# pylint: disable-msg=E1101,W0612 import operator import nose # noqa from numpy import nan import numpy as np import pandas as pd from pandas.util.testing import (assert_almost_equal, assert_series_equal, assert_index_equal, assert_frame_equal, asser...
gpl-2.0
NicWayand/xray
doc/conf.py
2
13630
# -*- coding: utf-8 -*- # # xarray documentation build configuration file, created by # sphinx-quickstart on Thu Feb 6 18:57:54 2014. # # 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. # # Al...
apache-2.0
pandeylab/pyquant
setup.py
1
1517
from __future__ import print_function import os from distutils.core import setup from distutils.extension import Extension from setuptools import find_packages try: from Cython.Build import cythonize import Cython.Distutils CYTHON=True except ImportError: CYTHON=False print('CYTHON UNAVAILABLE') tr...
mit
PatrickChrist/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
djtotten/workbench
setup.py
1
1964
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys from setuptools import setup readme = open('README.rst').read() long_description = readme doclink = ''' Documentation ------------- The full documentation is at http://workbench.rtfd.org. ''' history = open('HISTORY.rst').read().replace('.. :changelog:', ...
mit
466152112/scikit-learn
sklearn/cluster/__init__.py
364
1228
""" The :mod:`sklearn.cluster` module gathers popular unsupervised clustering algorithms. """ from .spectral import spectral_clustering, SpectralClustering from .mean_shift_ import (mean_shift, MeanShift, estimate_bandwidth, get_bin_seeds) from .affinity_propagation_ import affinity_propagati...
bsd-3-clause
hammerlab/gtfparse
gtfparse/read_gtf.py
1
8633
# Copyright (c) 2015-2018. 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 ...
apache-2.0
procoder317/scikit-learn
sklearn/neighbors/tests/test_kd_tree.py
159
7852
import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dist_metrics import Dista...
bsd-3-clause
crichardson17/starburst_atlas
Metallicity_Comparison_hires/Metallicity_comparison_plotter1.py
1
23288
############################################################ ####### Plotting File for Metallicity Contour Plots ######## ################## Data read from Cloudy ################### ################ Helen Meskhidze, Fall 2015 ################ #################### Elon University ####################### #--------------...
gpl-2.0
maxalbert/bokeh
bokeh/compat/bokeh_exporter.py
38
1508
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------...
bsd-3-clause
freedomofpress/FingerprintSecureDrop
fpsd/tests/test_features.py
2
13743
#!/usr/bin/env python3.5 from collections import OrderedDict from decimal import Decimal import os import pandas as pd import sqlalchemy import unittest from features import compute_bursts, FeatureStorage from . import common def db_helper(db, table_name, feature_names): """Helper function for testing a table in...
agpl-3.0
466152112/scikit-learn
sklearn/covariance/__init__.py
389
1157
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause
scivision/mifi_rssi
mifirssi/__init__.py
2
1248
#!/usr/bin/env python from pathlib import Path from dateutil.parser import parse from datetime import timedelta from pandas import read_csv,DataFrame from numpy import nan,diff,nonzero from matplotlib.pyplot import show,subplots import seaborn as sns sns.set_context('talk') def readrssi(fn,interval): fn = Path(fn)...
gpl-3.0
guillermo-carrasco/bcbio-nextgen-vm
bcbiovm/graph/graph.py
3
1438
from __future__ import print_function import matplotlib matplotlib.use('Agg') import os import pylab pylab.rcParams['figure.figsize'] = (35.0, 12.0) from bcbio import utils from bcbio.graph import graph as bcbio_graph from bcbiovm.graph.elasticluster import fetch_collectl def bootstrap(args): if args.cluster a...
mit
xavierwu/scikit-learn
sklearn/svm/tests/test_svm.py
70
31674
""" Testing for Support Vector Machine module (sklearn.svm) TODO: remove hard coded numerical results when possible """ import numpy as np import itertools from numpy.testing import assert_array_equal, assert_array_almost_equal from numpy.testing import assert_almost_equal from scipy import sparse from nose.tools im...
bsd-3-clause
socrata/arcs
arcs/logparser.py
1
5652
import re import urllib import pandas as pd from frozendict import frozendict from functools import partial from dateutil.parser import parse from gzip import GzipFile # components of an Apache logfile line _LOG_PARTS = [ r'(?P<host>\S+)', # host %h r'\S+', # inden...
mit
BigTone2009/sms-tools
lectures/05-Sinusoidal-model/plots-code/sineModelAnal-bendir-phase.py
24
1267
import numpy as np import matplotlib.pyplot as plt import sys, os, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import stft as STFT import sineModel as SM import utilFunctions as UF (fs, x) = UF.wavread(os.path.join(os.path.dirname(os.path.realpath(__fi...
agpl-3.0
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/io/tests/test_pytables.py
2
175872
import nose import sys import os import warnings import tempfile from contextlib import contextmanager import datetime import numpy as np import pandas import pandas as pd from pandas import (Series, DataFrame, Panel, MultiIndex, Categorical, bdate_range, date_range, Index, DatetimeIndex, isnull) ...
gpl-2.0
tomaslaz/KLMC_Analysis
DM_Comparison.py
2
15427
#!/usr/bin/env python """ A script to compare unique structures in terms of their energy ranking between different levels of theory (IPs (GULP) and DFT (FHIaims)) @author Tomas Lazauskas, 2016 @web www.lazauskas.net @email tomas.lazauskas[a]gmail.com """ import os import sys import numpy as np import matplotlib.py...
gpl-3.0
henchc/CLFL_2016
CLFL_Brill.py
1
7553
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import # Created at UC Berkeley 2015 # Authors: Christopher Hench # ============================================================================== '''This code trains and evaluates a Brill ta...
mit
automl/paramsklearn
tests/components/feature_preprocessing/test_extra_trees.py
1
1894
import unittest from sklearn.linear_model import RidgeClassifier from ParamSklearn.components.feature_preprocessing.extra_trees_preproc_for_classification import \ ExtraTreesPreprocessor from ParamSklearn.util import _test_preprocessing, PreprocessingTestCase, \ get_dataset import sklearn.metrics class Extre...
bsd-3-clause
aricooperman/Jzipline
zipline/pipeline/factors/technical.py
2
23771
""" Technical Analysis Factors -------------------------- """ from numbers import Number from numpy import ( abs, arange, average, clip, diff, exp, fmax, full, inf, isnan, log, NINF, searchsorted, sqrt, sum as np_sum, ) from numexpr import evaluate from scipy....
apache-2.0
acorbe/acorbe_openptv_post_processing
python_scripts/traj_correlation.py
1
31591
import pandas as pd import numpy as np from itertools import combinations import traj_processing as tp from scipy.ndimage.measurements import label import scipy.ndimage.filters as filters from itertools import groupby import collections import Data_classes as dtCl import signal_processing as sp import json import m...
gpl-2.0
smartscheduling/scikit-learn-categorical-tree
examples/text/mlcomp_sparse_document_classification.py
292
4498
""" ======================================================== Classification of text documents: using a MLComp dataset ======================================================== This is an example showing how the scikit-learn can be used to classify documents by topics using a bag-of-words approach. This example uses a s...
bsd-3-clause
akionakamura/scikit-learn
examples/applications/plot_tomography_l1_reconstruction.py
204
5442
""" ====================================================================== Compressive sensing: tomography reconstruction with L1 prior (Lasso) ====================================================================== This example shows the reconstruction of an image from a set of parallel projections, acquired along dif...
bsd-3-clause
cpcloud/arrow
python/pyarrow/feather.py
1
6981
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
cbmoore/statsmodels
examples/python/regression_diagnostics.py
28
2876
## Regression diagnostics # This example file shows how to use a few of the ``statsmodels`` regression diagnostic tests in a real-life context. You can learn about more tests and find out more information abou the tests here on the [Regression Diagnostics page.](http://statsmodels.sourceforge.net/stable/diagnostic.ht...
bsd-3-clause
aflaxman/scikit-learn
examples/cluster/plot_birch_vs_minibatchkmeans.py
36
3689
""" ================================= Compare BIRCH and MiniBatchKMeans ================================= This example compares the timing of Birch (with and without the global clustering step) and MiniBatchKMeans on a synthetic dataset having 100,000 samples and 2 features generated using make_blobs. If ``n_clusters...
bsd-3-clause
mannion9/Intro-to-Python
Simulations/Numerical Solver of Schrodenger Equation.py
1
7000
import math as m import matplotlib.pyplot as plt import matplotlib.animation as animation import cmath pi=m.pi # # Numerical integration of Schrodenger Equation using the leap from method. # # In this program you can simulate three different situations with a free particle # wave packet. 1) No potential 2) SHO Potenti...
mit
florian-f/sklearn
sklearn/manifold/isomap.py
6
7139
"""Isomap for manifold learning""" # Author: Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD, (C) 2011 import numpy as np from ..base import BaseEstimator, TransformerMixin from ..neighbors import NearestNeighbors, kneighbors_graph from ..utils import check_arrays from ..utils.graph import graph_...
bsd-3-clause
lekshmideepu/nest-simulator
pynest/examples/brette_gerstner_fig_2c.py
8
3104
# -*- coding: utf-8 -*- # # brette_gerstner_fig_2c.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, either version 2 of the ...
gpl-2.0
QUANTAXIS/QUANTAXIS
QUANTAXIS/QASU/save_binance.py
2
22768
# coding: utf-8 # Author: Will # Contributor: 阿财(Rgveda@github)(11652964@qq.com) # Created date: 2018-06-08 # # The MIT License (MIT) # # Copyright (c) 2016-2018 yutiansut/QUANTAXIS # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (th...
mit
emeb/iceRadio
FPGA/rxadc_2/python/tst_ddc.py
1
1392
#!/usr/bin/python3 # # Digital DownConverter testbench # # 07-23-2015 E. Brombaugh # Test out the DDC import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import scipy.signal as signal from scipy.fftpack import fft, ifft, fftfreq, fftshift from ddc import ddc # generate a signal data_len...
mit
imk1/IMKTFBindingCode
runKMerExtraTreesClassificationNoPairsFeatureListDownweight.py
1
9419
def makeStringList(stringListFileName): # Make a list of strings from a file stringListFile = open(stringListFileName) stringList = [] for line in stringListFile: # Iterate through the strings and add each to stringList stringList.append(line.strip()) stringListFile.close() print len(stringList) ret...
mit
gph82/mdtraj
mdtraj/formats/pdb/pdbfile.py
2
29914
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2013 Stanford University and the Authors # # Authors: Peter Eastman, Robert McGibbon # Contributors: Carlos Hernande...
lgpl-2.1
soulmachine/scikit-learn
examples/applications/plot_model_complexity_influence.py
25
6378
""" ========================== Model Complexity Influence ========================== Demonstrate how model complexity influences both prediction accuracy and computational performance. The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for regression (resp. classification). For each class of models we m...
bsd-3-clause
who-emro/meerkat_api
docs/source/conf.py
2
5855
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Meerkat API documentation build configuration file, created by # sphinx-quickstart on Mon Feb 19 16:21:35 2018. # # 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 ...
mit
krikru/tensorflow-opencl
tensorflow/contrib/learn/python/learn/estimators/kmeans.py
12
8778
# 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
YuwenXiong/py-R-FCN
lib/fast_rcnn/test.py
3
11224
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Test a Fast R-CNN network on an imdb (image database).""" from fast...
mit
magnastrazh/NEUCOGAR
nest/serotonin/research/C/nest-2.10.0/pynest/examples/intrinsic_currents_subthreshold.py
9
7172
# -*- coding: utf-8 -*- # # intrinsic_currents_subthreshold.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, either version ...
gpl-2.0
kristianfoerster/melodist
setup.py
1
1880
# -*- coding: utf-8 -*- from setuptools import setup, find_packages long_description = """MELODIST is an open-source toolbox written in Python for disaggregating daily meteorological time series to hourly time steps. The software framework consists of disaggregation functions for each variable including temperature, h...
gpl-3.0
draperjames/bokeh
bokeh/charts/tests/test_builder.py
3
4214
"""This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this...
bsd-3-clause
Myasuka/scikit-learn
sklearn/covariance/tests/test_robust_covariance.py
213
3359
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
bsd-3-clause
RPGOne/Skynet
scikit-learn-0.18.1/sklearn/feature_extraction/hashing.py
74
6153
# Author: Lars Buitinck # License: BSD 3 clause import numbers import numpy as np import scipy.sparse as sp from . import _hashing from ..base import BaseEstimator, TransformerMixin def _iteritems(d): """Like d.iteritems, but accepts any collections.Mapping.""" return d.iteritems() if hasattr(d, "iteritems...
bsd-3-clause
vermouthmjl/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
godrayz/trading-with-python
lib/interactiveBrokers/histData.py
76
6472
''' Created on May 8, 2013 Copyright: Jev Kuznetsov License: BSD Module for downloading historic data from IB ''' import ib import pandas as pd from ib.ext.Contract import Contract from ib.opt import ibConnection, message import logger as logger from pandas import DataFrame, Index import os imp...
bsd-3-clause
xuleiboy1234/autoTitle
tensorflow/tensorflow/examples/learn/iris_custom_decay_dnn.py
37
3774
# 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 appl...
mit
fornaxco/Mars-Express-Challenge
preprocessing/prepare_ftl.py
1
1200
# coding: utf-8 """ @author: fornax """ from __future__ import print_function, division import os import numpy as np import pandas as pd os.chdir(os.path.dirname(os.path.abspath(__file__))) os.sys.path.append(os.path.dirname(os.getcwd())) import prepare_data1 as prep DATA_PATH = os.path.join('..', prep.DATA_PATH) # ...
bsd-3-clause
lodemo/CATANA
src/face_recognition/facenet/tmp/random_test.py
3
3742
import tensorflow as tf import numpy as np with tf.Graph().as_default(): tf.set_random_seed(666) # Placeholder for input images input_placeholder = tf.placeholder(tf.float32, shape=(9, 7), name='input') # Split example embeddings into anchor, positive and negative #anchor, positive, negative = tf.spli...
mit
mirestrepo/voxels-at-lems
harris_experiments/plot_C_histogram.py
1
1035
# -*- coding: utf-8 -*- """ Created on Mon Mar 7 14:38:46 2011 Plot pca test error vs train error @author: Isabel Restrepo """ import os; import optparse; import time; import sys; import numpy as np import matplotlib.pyplot as plt import glob if __name__=="__main__": full_path_file= '/Users/isa/Experiments/BO...
bsd-2-clause
WMD-group/effectivemasstheory
examples/cspbcl3.py
2
6667
#! /usr/bin/env python """Calculate simple semiconductor properties from effective mass theory""" ################################################################################ # Aron Walsh 2014 # ##########################################################...
gpl-2.0
av8ramit/tensorflow
tensorflow/python/estimator/inputs/queues/feeding_functions.py
9
19123
# 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
kyleabeauchamp/PMTStuff
code/test_cv_cluster.py
1
1688
import mixtape.featurizer, mixtape.tica, mixtape.cluster, mixtape.markovstatemodel, mixtape.ghmm import numpy as np import mdtraj as md from parameters import load_trajectories, build_full_featurizer import sklearn.pipeline, sklearn.externals.joblib import mixtape.utils n_choose = 100 stride = 1 lag_time = 1 trj0, tr...
gpl-2.0
h-mayorquin/mnist_dl_ann_project
plot_scripts/mlp_error.py
1
17073
import os import sys import time import numpy import matplotlib.pyplot as plt import theano import theano.tensor as T from code.logistic_sgd import LogisticRegression, load_data # start-snippet-1 class HiddenLayer(object): def __init__(self, rng, input, n_in, n_out, W=None, b=None, activation...
bsd-2-clause
wd15/extremefill2D
extremefill2D/viewer.py
1
6880
import os import tables from extremefill2D.dicttable import DictTable import pylab import numpy as np from sumatra.projects import load_project class BaseViewer(object): def __init__(self, basedatafile=None, datafiles=None, labels=None, times=None, colors=None): self.times = times self.data = []...
mit
mmathioudakis/geotopics
visualization/utils.py
1
11233
import json import sys import numpy as np from matplotlib import mlab from mpl_toolkits.basemap import Basemap from sklearn.preprocessing import StandardScaler from model import ModelParameters from visualization import smopy __author__ = 'emre' def create_probability_grid(x_min, x_max, y_min, y_max, scaler: Stand...
mit
bioinfo-core-BGU/neatseq-flow_modules
neatseq_flow_modules/Liron/cgMLST_and_MLST_typing_module/MLST_parser.py
3
8400
import os, re import argparse import pandas as pd parser = argparse.ArgumentParser(description='Pars MLST') parser.add_argument('-M', type=str, help='MetaData file') parser.add_argument('-F', type=str, help='Merged MLST typing file') parser.add_argument('-O' , type=str, defaul...
gpl-3.0
erscott/RASLseqTools
RASLseqTools/RASLseqAnalysis_STAR.py
1
20131
import pandas as pd import os,sys import numpy as np import argparse import subprocess import multiprocessing as mp import sys,os import time import inspect source_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) source_dir = '/'.join(source_dir.split('/')[:-1]) sys.path.append(source...
mit
mutirri/bokeh
sphinx/source/docs/tutorials/exercises/stocks.py
23
2098
### ### NOTE: This exercise requires a network connection ### import numpy as np import pandas as pd from bokeh.plotting import figure, output_file, show, VBox # Here is some code to read in some stock data from the Yahoo Finance API AAPL = pd.read_csv( "http://ichart.yahoo.com/table.csv?s=AAPL&a=0&b=1&c=2000&d=...
bsd-3-clause
Obus/scikit-learn
examples/ensemble/plot_adaboost_hastie_10_2.py
355
3576
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
bsd-3-clause
patricksnape/menpo
menpo/image/base.py
2
131364
from typing import Iterable, Optional from warnings import warn import PIL.Image as PILImage import numpy as np from menpo.base import MenpoDeprecationWarning, Vectorizable, copy_landmarks_and_path from menpo.landmark import Landmarkable from menpo.shape import PointCloud, bounding_box from menpo.transform import ( ...
bsd-3-clause
jmetzen/scikit-learn
examples/gaussian_process/plot_compare_gpr_krr.py
67
5191
""" ========================================================== Comparison of kernel ridge and Gaussian process regression ========================================================== Both kernel ridge regression (KRR) and Gaussian process regression (GPR) learn a target function by employing internally the "kernel trick...
bsd-3-clause
dfm/python-fsps
demos/specbymass.py
4
6026
# This demo shows how to make a plot of the fractional contribution of differnt # stellar mass ranges to the total spectrum, for different properties of the # stellar population. There is also some use of the filter objects. from itertools import product import numpy as np import matplotlib.pyplot as pl import fsps ...
mit
noelevans/sandpit
outlier_comparison.py
1
3120
import numpy as np from scipy import stats import matplotlib.pyplot as plt import matplotlib.font_manager from sklearn import svm from sklearn.covariance import EllipticEnvelope # from sklearn.ensemble import IsolationForest rng = np.random.RandomState(42) # Example settings n_samples = 200 outliers_fraction = 0.25 ...
mit
sheshant/cuda-convnet2
shownet.py
180
18206
# Copyright 2014 Google Inc. 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 applicable law or...
apache-2.0
qifeigit/scikit-learn
sklearn/feature_selection/tests/test_rfe.py
209
11733
""" Testing Recursive feature elimination """ import warnings import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_equal, assert_true from scipy import sparse from sklearn.feature_selection.rfe import RFE, RFECV from sklearn.datasets import load_iris,...
bsd-3-clause
xiaoxiamii/scikit-learn
sklearn/metrics/tests/test_common.py
83
41144
from __future__ import division, print_function from functools import partial from itertools import product import numpy as np import scipy.sparse as sp from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import LabelBinarizer from sklearn.utils.multiclass import type_of_target fro...
bsd-3-clause
phobson/statsmodels
statsmodels/tsa/filters/filtertools.py
25
12438
# -*- coding: utf-8 -*- """Linear Filters for time series analysis and testing TODO: * check common sequence in signature of filter functions (ar,ma,x) or (x,ar,ma) Created on Sat Oct 23 17:18:03 2010 Author: Josef-pktd """ #not original copied from various experimental scripts #version control history is there fr...
bsd-3-clause
jreback/pandas
pandas/tests/tools/test_to_datetime.py
2
93371
""" test to_datetime """ import calendar from collections import deque from datetime import datetime, timedelta import locale from dateutil.parser import parse from dateutil.tz.tz import tzoffset import numpy as np import pytest import pytz from pandas._libs import tslib from pandas._libs.tslibs import iNaT, parsing...
bsd-3-clause
seberg/numpy
numpy/lib/npyio.py
3
89674
import os import re import functools import itertools import warnings import weakref import contextlib from operator import itemgetter, index as opindex from collections.abc import Mapping import numpy as np from . import format from ._datasource import DataSource from numpy.core import overrides from numpy.core.multi...
bsd-3-clause
miqlar/PyFME
examples/example_002.py
2
3381
# -*- coding: utf-8 -*- """ Python Flight Mechanics Engine (PyFME). Copyright (c) AeroPython Development Team. Distributed under the terms of the MIT License. Example ------- Cessna 310, ISA1976 integrated with Flat Earth (euler angles). Example with trimmed aircraft: stationary descent, symmetric, wings level fligh...
mit
markovmodel/PyEMMA
pyemma/coordinates/clustering/interface.py
1
12437
# This file is part of PyEMMA. # # Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # PyEMMA 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 vers...
lgpl-3.0
dotsdl/msmbuilder
msmbuilder/cluster/kcenters.py
3
6519
# Author: Robert McGibbon <rmcgibbo@gmail.com> # Contributors: # Copyright (c) 2014, Stanford University # All rights reserved. #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- from __future__ import...
lgpl-2.1
jmmauricio/pypstools
build/lib/pypstools/publisher.py
2
62263
""" Tools for plotting and publishing power system simulations and analysis results. (c) 2015 Juan Manuel Mauricio https://www.packtpub.com/books/content/plotting-geographical-data-using-basemap """ from __future__ import division, print_function import numpy as np import scipy.linalg import matplotlib.pyplot as p...
gpl-3.0
themrmax/scikit-learn
examples/tree/plot_tree_regression.py
82
1562
""" =================================================================== Decision Tree Regression =================================================================== A 1D regression with decision tree. The :ref:`decision trees <tree>` is used to fit a sine curve with addition noisy observation. As a result, it learns ...
bsd-3-clause
ly-atdawn/Show-and-Tell
model.py
1
21110
#-*- coding: utf-8 -*- import math import os import tensorflow as tf import numpy as np import pandas as pd import cPickle import glob import time import random from nltk.translate.bleu_score import * # from tensorflow.models.rnn import rnn_cell # Error! use tf.nn.rnn_cell import tensorflow.python.platform from keras....
bsd-2-clause
numenta/nupic.research
projects/whydense/cifar/mobilenet_noise_test.py
3
11901
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
mmottahedi/neuralnilm_prototype
scripts/e428.py
2
6834
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit
protossw512/bio-project
transfer_learning/train_xinyao.py
1
14442
import tensorflow as tf from tensorflow.contrib.framework.python.ops.variables import get_or_create_global_step from tensorflow.python.platform import tf_logging as logging import inception_preprocessing from inception_resnet_v2 import inception_resnet_v2, inception_resnet_v2_arg_scope import os import time import gpum...
mit
dch312/scipy
scipy/stats/_discrete_distns.py
5
20508
# # Author: Travis Oliphant 2002-2011 with contributions from # SciPy Developers 2004-2011 # from __future__ import division, print_function, absolute_import from scipy import special from scipy.special import entr, gammaln as gamln from numpy import floor, ceil, log, exp, sqrt, log1p, expm1, tanh, cosh, s...
bsd-3-clause
dmnfarrell/epitopepredict
epitopepredict/config.py
2
5239
#!/usr/bin/env python """ epitopepredict config Created March 2016 Copyright (C) Damien Farrell This program 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; either version 3 of the Lic...
apache-2.0
h2020-westlife-eu/west-life-wp6
wp6-virtualfolder/conf-template/home/vagrant/.jupyter/jupyter_notebook_config.py
1
22651
# Configuration file for jupyter-notebook. #------------------------------------------------------------------------------ # Application(SingletonConfigurable) configuration #------------------------------------------------------------------------------ ## This is an application. ## The date format used by logging f...
mit
cdd1969/pygwa
lib/flowchart/nodes/n05_timeseriescurve/node_makeTimeseriesCurve.py
1
5448
#!/usr/bin python # -*- coding: utf-8 -*- from pyqtgraph import BusyCursor, PlotDataItem from pyqtgraph import functions as fn from pyqtgraph.Qt import QtCore import numpy as np import pandas as pd from lib.flowchart.nodes.generalNode import NodeWithCtrlWidget, NodeCtrlWidget from lib.functions.general import isNumpyD...
gpl-2.0
MatthieuBizien/scikit-learn
sklearn/utils/deprecation.py
77
2417
import warnings __all__ = ["deprecated", ] class deprecated(object): """Decorator to mark a function or class as deprecated. Issue a warning when the function is called/the class is instantiated and adds a warning to the docstring. The optional extra argument will be appended to the deprecation mes...
bsd-3-clause
courtarro/gnuradio
gr-fec/python/fec/polar/channel_construction_bec.py
22
8068
#!/usr/bin/env python # # Copyright 2015 Free Software Foundation, Inc. # # GNU Radio 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; either version 3, or (at your option) # any later version. # # GNU Radio is...
gpl-3.0
herilalaina/scikit-learn
sklearn/gaussian_process/tests/test_gpr.py
22
13791
"""Testing for Gaussian process regression """ # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from scipy.optimize import approx_fprime from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels \ import RBF, Constan...
bsd-3-clause
averagehat/scikit-bio
skbio/stats/ordination/_base.py
4
16284
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
joshua-cogliati-inl/raven
framework/Optimizers/GradientBasedOptimizer.py
1
52237
# Copyright 2017 Battelle Energy Alliance, 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 t...
apache-2.0
mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam
PyFoam/Basics/PlotTimelinesFactory.py
2
3565
# ICE Revision: $Id$ """Creates subclasses of GeneralPlotTimelines""" from PyFoam.Basics.GnuplotTimelines import GnuplotTimelines from PyFoam.Basics.MatplotlibTimelines import MatplotlibTimelines from PyFoam.Basics.XkcdMatplotlibTimelines import XkcdMatplotlibTimelines from PyFoam.Basics.QwtPlotTimelines import QwtPl...
gpl-2.0
Barmaley-exe/scikit-learn
sklearn/datasets/lfw.py
28
17953
"""Loader for the Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ Each picture is centered on a single face. The typical task is called Face Veri...
bsd-3-clause
dbaranchuk/hnsw
plots/graphic_sift_PQ16_R1.py
1
2232
OIMI_R1_txt = ''' 0.2540 0.2879 0.3245 0.3455 0.3625 0.3675 0.3712 0.3723 ''' OIMI_T_txt = ''' 1.43 1.59 1.97 2.53 4.24 6.61 12.8 21.1 ''' IVF2M_R1_txt = ''' 0.1942 0.2353 0.2764 0.3165 0.3476 0.3574 0.3635 0.3660 ''' IVF2M_T_txt = ''' 0.30 0.32 0.43 0.54 1.04 1.55 2.95 4.21 ''' IVF4M_R1_txt = ''' 0.2188 0.2615 0.313...
apache-2.0
Titan-C/sphinx-gallery
doc/conf.py
1
12656
# -*- coding: utf-8 -*- # # Sphinx-Gallery documentation build configuration file, created by # sphinx-quickstart on Mon Nov 17 16:01:26 2014. # # 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...
bsd-3-clause
leesavide/pythonista-docs
Documentation/matplotlib/mpl_examples/axes_grid/demo_axes_hbox_divider.py
7
1547
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.axes_divider import HBoxDivider import mpl_toolkits.axes_grid1.axes_size as Size def make_heights_equal(fig, rect, ax1, ax2, pad): # pad in inches h1, v1 = Size.AxesX(ax1), Size.AxesY(ax1) h2, v2 = Size.AxesX(ax2), Size.Ax...
apache-2.0
Dekken/tick
doc/sphinxext/numpy_ext/docscrape_sphinx.py
408
8061
import re import inspect import textwrap import pydoc from .docscrape import NumpyDocString from .docscrape import FunctionDoc from .docscrape import ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config=None): config = {} if config is None else config self.use_plots...
bsd-3-clause
caisq/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_input_test.py
46
13101
# 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
kyleam/seaborn
seaborn/matrix.py
2
40924
"""Functions to visualize matrices of data.""" import itertools import colorsys import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np import pandas as pd from scipy.spatial import distance from scipy.cluster import hierarchy from .axisgrid import Grid from .palett...
bsd-3-clause