repo_name
stringlengths
6
67
path
stringlengths
5
185
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
1.02k
962k
license
stringclasses
15 values
monikascholz/pWARP
fluowarp.py
1
9385
# -*- coding: utf-8 -*- """ Created on Tue Mar 4 19:53:51 2014 Phase correlation drift correction. Used papers Cross-correlation image tracking for drift correction and adsorbate analysis B. A. Mantooth, Z. J. Donhauser, K. F. Kelly, and P. S. Weiss for inspiration. @author: Monika Kauer """ import numpy as np impor...
gpl-2.0
nrhine1/scikit-learn
sklearn/neighbors/base.py
22
31143
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output...
bsd-3-clause
LiaoPan/scikit-learn
examples/ensemble/plot_bias_variance.py
357
7324
""" ============================================================ Single estimator versus bagging: bias-variance decomposition ============================================================ This example illustrates and compares the bias-variance decomposition of the expected mean squared error of a single estimator again...
bsd-3-clause
Cophy08/ggplot
ggplot/tests/test_element_text.py
12
1362
from nose.tools import assert_equal, assert_true from ggplot.tests import image_comparison, cleanup from ggplot import * from numpy import linspace from pandas import DataFrame df = DataFrame({"blahblahblah": linspace(999, 1111, 9), "yadayadayada": linspace(999, 1111, 9)}) simple_gg = ggplot(aes(x="b...
bsd-2-clause
hgn/pmu-tools
interval-plot.py
3
3566
#!/usr/bin/python # plot interval CSV output from perf/toplev # perf stat -I1000 -x, -o file ... # toplev -I1000 -x, -o file ... # interval-plot.py file (or stdin) # delimeter must be , # this is for data that is not normalized # TODO: move legend somewhere else where it doesn't overlap? import csv import sys import m...
gpl-2.0
phronesis-mnemosyne/census-schema-alignment
algn-merge.py
1
4062
import re import json import argparse import numpy as np import pandas as pd import sys sys.path.append('wit') from mmd import * from munkres import Munkres # -- # Alignment functions def align(dist): ''' Munkres alignment between a single pair of schemas ''' if dist.shape[0] > dist.shape[1]: ...
apache-2.0
henrykironde/scikit-learn
examples/tree/plot_tree_regression.py
206
1476
""" =================================================================== 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
MartinDelzant/scikit-learn
sklearn/utils/graph.py
289
6239
""" Graph utilities and algorithms Graphs are represented with their adjacency matrices, preferably using sparse matrices. """ # Authors: Aric Hagberg <hagberg@lanl.gov> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Jake Vanderplas <vanderplas@astro.washington.edu> # License: BSD 3 clause impo...
bsd-3-clause
jrderuiter/pyim
src/pyim/annotate/annotators/window.py
1
5561
from collections import namedtuple from itertools import chain from pathlib import Path import pandas as pd from pyim.vendor.genopandas import GenomicDataFrame from .base import Annotator, AnnotatorCommand, CisAnnotator from ..util import filter_blacklist, select_closest, annotate_insertion class WindowAnnotator(A...
mit
moutai/scikit-learn
examples/model_selection/randomized_search.py
44
3253
""" ========================================================================= Comparing randomized search and grid search for hyperparameter estimation ========================================================================= Compare randomized search and grid search for optimizing hyperparameters of a random forest. ...
bsd-3-clause
lepy/phuzzy
phuzzy/data/plots.py
1
2069
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import matplotlib.pyplot as plt def p_estimates(df, ax=None, show=False): if ax is None: fig, ax = plt.subplots(1, 1, figsize=(10,5)) else: fig = plt.gcf() for col in [c for c in df.columns if c.startswith("p_")]: ax....
mit
tapomayukh/projects_in_python
classification/Classification_with_kNN/Single_Contact_Classification/Spatial_Resolution/space_resolution_per_meter_mov_fixed_percent.py
1
4190
# Principal Component Analysis Code : from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud from pylab import * import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import ro...
mit
HEHenson/CanDataPY
misc.py
1
1202
# -*- coding: utf-8 -*- """ Created on Tue Oct 18 19:57:47 2016 @author: lancehermes """ import glob import shutil from pandas import Series, DataFrame, HDFStore import pandas.rpy.common as com import feather from rpy2.robjects import pandas2ri def copycsv(): rootdir = "/home/lancehermes/Dropbox/business/Project...
unlicense
drammock/expyfun
expyfun/visual/_visual.py
2
46036
""" Visual stimulus design ====================== Tools for drawing shapes and text on the screen. """ # Authors: Dan McCloy <drmccloy@uw.edu> # Eric Larson <larsoner@uw.edu> # Ross Maddox <rkmaddox@uw.edu> # # License: BSD (3-clause) from ctypes import (cast, pointer, POINTER, create_string_buffer...
bsd-3-clause
pratapvardhan/scikit-image
skimage/transform/tests/test_radon_transform.py
13
14551
from __future__ import print_function, division import numpy as np from numpy.testing import assert_raises import itertools import os.path from skimage.transform import radon, iradon, iradon_sart, rescale from skimage.io import imread from skimage import data_dir from skimage._shared.testing import test_parallel from...
bsd-3-clause
agiovann/CalBlitz
calblitz/granule_cells/utils_granule.py
1
44647
# -*- coding: utf-8 -*- """ Created on Tue Feb 16 17:56:14 2016 @author: agiovann """ import os import cv2 import h5py import numpy as np import pylab as pl from glob import glob # import ca_source_extraction as cse import calblitz as cb from scipy import signal import scipy import sys from ipyparallel import Client f...
gpl-3.0
deroneriksson/systemml
projects/breast_cancer/breastcancer/preprocessing.py
15
26035
#------------------------------------------------------------- # # 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...
apache-2.0
mdjurfeldt/nest-simulator
topology/doc/user_manual_scripts/layers.py
8
10527
# -*- coding: utf-8 -*- # # layers.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 License, or # (a...
gpl-2.0
google-research/google-research
constrained_language_typology/compute_associations_main.py
1
9567
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
apache-2.0
XiaoxiaoLiu/morphology_analysis
IVSCC/add_extra_ratio_features.py
1
2313
import pandas as pd import platform if (platform.system() == "Linux"): WORK_PATH = "/local1/xiaoxiaol/work" else: WORK_PATH = "/Users/xiaoxiaoliu/work" ############################################################################### #data_DIR = '/data/mat/xiaoxiaol/data/lims2/0903_filtered_ephys_qc' data_DIR =...
gpl-3.0
harshaneelhg/scikit-learn
examples/applications/plot_model_complexity_influence.py
323
6372
""" ========================== 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
jmschrei/scikit-learn
examples/cluster/plot_mini_batch_kmeans.py
265
4081
""" ==================================================================== Comparison of the K-Means and MiniBatchKMeans clustering algorithms ==================================================================== We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is faster, but give...
bsd-3-clause
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/matplotlib/backends/backend_gtk3.py
2
32330
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import os, sys try: import gi except ImportError: raise ImportError("Gtk3 backend requires pygobject to be installed.") try: gi.require_version("Gtk", "3.0") except AttributeError: ...
mit
bowang/tensorflow
tensorflow/examples/learn/text_classification.py
17
6649
# 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...
apache-2.0
kmike/scikit-learn
examples/svm/plot_svm_regression.py
8
1431
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynominial and RBF kernels. """ print(__doc__) #################...
bsd-3-clause
harisbal/pandas
pandas/tests/indexes/timedeltas/test_ops.py
1
14479
from datetime import timedelta import numpy as np import pytest import pandas as pd import pandas.util.testing as tm from pandas import ( Series, Timedelta, TimedeltaIndex, Timestamp, timedelta_range, to_timedelta ) from pandas.core.dtypes.generic import ABCDateOffset from pandas.tests.test_base import Ops fr...
bsd-3-clause
danieljwest/mycli
mycli/packages/tabulate.py
16
38129
# -*- coding: utf-8 -*- """Pretty-print tabular data.""" from __future__ import print_function from __future__ import unicode_literals from collections import namedtuple from decimal import Decimal from platform import python_version_tuple from wcwidth import wcswidth import re if python_version_tuple()[0] < "3": ...
bsd-3-clause
momenteg/python_scripts
hidden_supernova_search/read_and_plot_data_injected_in_Sndaq.py
1
4011
#!/usr/bin/python import pandas as pd import numpy as np import glob import matplotlib.pyplot as plt import seaborn import subprocess import os import re def mount_mogon(): print("mounting mogon via sshfs") string_ = "sshfs -o nonempty dummy_user@dummy_address:/etapfs02/icecubehpc/gmoment/output_hidden_super...
gpl-3.0
arjunkhode/ASP
lectures/07-Sinusoidal-plus-residual-model/plots-code/stochasticModelAnalSynth.py
5
1619
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, hanning, resample from scipy.fftpack import fft, ifft import time import sys, os sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import utilFunctions as UF import stochasticMode...
agpl-3.0
mikofski/pvlib-python
pvlib/iotools/bsrn.py
3
6686
"""Functions to read data from the Baseline Surface Radiation Network (BSRN). .. codeauthor:: Adam R. Jensen<adam-r-j@hotmail.com> """ import pandas as pd import gzip COL_SPECS = [(0, 3), (4, 9), (10, 16), (16, 22), (22, 27), (27, 32), (32, 39), (39, 45), (45, 50), (50, 55), (55, 64), (64, 70), (...
bsd-3-clause
lbdreyer/iris
docs/iris/gallery_code/general/plot_inset.py
3
2280
""" Test Data Showing Inset Plots ============================= This example demonstrates the use of a single 3D data cube with time, latitude and longitude dimensions to plot a temperature series for a single latitude coordinate, with an inset plot of the data region. """ import cartopy.crs as ccrs import matplotli...
lgpl-3.0
hhuangmeso/cmaps
setup.py
1
2866
from glob import glob from setuptools import setup import os VERSION = '1.0.3' CMAPSFILE_DIR = os.path.join('./cmaps/colormaps') def write_version_py(version=VERSION, filename='cmaps/_version.py'): cnt = '# THIS FILE IS GENERATED FROM SETUP.PY\n' + \ '__version__ = "%(version)s"\n' a = open(filena...
gpl-3.0
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/pandas/core/ops.py
9
48430
""" Arithmetic operations for PandasObjects This is not a public API. """ # necessary to enforce truediv in Python 2.X from __future__ import division import operator import warnings import numpy as np import pandas as pd import datetime from pandas import compat, lib, tslib import pandas.index as _index from pandas.u...
artistic-2.0
abyssxsy/gnuradio
gr-filter/examples/interpolate.py
58
8816
#!/usr/bin/env python # # Copyright 2009,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # 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 ...
gpl-3.0
waddell/urbansim
urbansim/utils/tests/test_testing.py
5
2190
import pandas as pd import pytest from .. import testing def test_frames_equal_not_frames(): frame = pd.DataFrame({'a': [1]}) with pytest.raises(AssertionError) as info: testing.assert_frames_equal(frame, 1) assert info.value.message == 'Inputs must both be pandas DataFrames.' def test_frames...
bsd-3-clause
chatelak/RMG-Py
rmgpy/stats.py
4
8698
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2012 Prof. Richard H. West (r.west@neu.edu), # Prof. William H. Green (whgreen@mit.edu) # ...
mit
danielhomola/mifs
mifs/mi.py
1
5334
""" Methods for calculating Mutual Information in an embarrassingly parallel way. Author: Daniel Homola <dani.homola@gmail.com> License: BSD 3 clause """ import numpy as np from scipy.special import gamma, psi from sklearn.neighbors import NearestNeighbors from joblib import Parallel, delayed def get_mi_vector(MI_FS...
bsd-3-clause
q1ang/scikit-learn
examples/ensemble/plot_ensemble_oob.py
259
3265
""" ============================= OOB Errors for Random Forests ============================= The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where each new tree is fit from a bootstrap sample of the training observations :math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er...
bsd-3-clause
jaduimstra/nilmtk
nilmtk/metergroup.py
2
70088
from __future__ import print_function, division import networkx as nx import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter from datetime import timedelta from warnings import warn from sys import stdout from collections import Counter from copy import copy, ...
apache-2.0
avmarchenko/exatomic
exatomic/algorithms/displacement.py
3
1635
# -*- coding: utf-8 -*- # Copyright (c) 2015-2018, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Computation of Displacement ############################ """ import numpy as np import pandas as pd def absolute_squared_displacement(universe, ref_frame=None): ...
apache-2.0
saiwing-yeung/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
pprett/scikit-learn
examples/model_selection/plot_confusion_matrix.py
63
3231
""" ================ Confusion matrix ================ Example of confusion matrix usage to evaluate the quality of the output of a classifier on the iris data set. The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements are those that ...
bsd-3-clause
hugobowne/scikit-learn
sklearn/kernel_approximation.py
258
17973
""" The :mod:`sklearn.kernel_approximation` module implements several approximate kernel feature maps base on Fourier transforms. """ # Author: Andreas Mueller <amueller@ais.uni-bonn.de> # # License: BSD 3 clause import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import svd from .base im...
bsd-3-clause
adrn/streams
streams/io/tests/test_lm10.py
1
4462
# coding: utf-8 """ Make sure the satellite starting position coincides with the particles """ from __future__ import absolute_import, unicode_literals, division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os, sys # Third-party import astropy.units as u from astropy.c...
mit
YinongLong/scikit-learn
sklearn/semi_supervised/tests/test_label_propagation.py
307
1974
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
bsd-3-clause
nowls/gnuradio
gr-filter/examples/decimate.py
58
6061
#!/usr/bin/env python # # Copyright 2009,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # 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 ...
gpl-3.0
sandeepgupta2k4/tensorflow
tensorflow/contrib/learn/python/learn/estimators/kmeans.py
34
10130
# 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
mughanibu/Deep-Learning-for-Inverse-Problems
PLOT.py
1
2433
import matplotlib.pyplot as plt import pickle, glob import numpy as np import sys psnr_prefix = './psnr/*' psnr_paths = sorted(glob.glob(psnr_prefix)) psnr_means = {} def filter_by_scale(row, scale): return row[-1]==scale for i, psnr_path in enumerate(psnr_paths): print "" print psnr_path psnr_dict = None epoch...
mit
mschmidt87/nest-simulator
extras/ConnPlotter/examples/connplotter_tutorial.py
18
27730
# -*- coding: utf-8 -*- # # connplotter_tutorial.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 Li...
gpl-2.0
CtraliePubs/SOCGMM2016_SlidingWindowVideo
JumpingJacks/plotPixel.py
1
1320
import numpy as np import matplotlib.pyplot as plt import scipy.misc import sys sys.path.append("../") sys.path.append("../S3DGLPy") from VideoTools import * from PCAGL import * if __name__ == '__main__': (Vid, IDims) = loadCVVideo('jumpingjackscropped.avi') N = Vid.shape[1] loc = [70, 323] vals ...
apache-2.0
zhenv5/scikit-learn
sklearn/ensemble/partial_dependence.py
251
15097
"""Partial dependence plots for tree ensembles. """ # Authors: Peter Prettenhofer # License: BSD 3 clause from itertools import count import numbers import numpy as np from scipy.stats.mstats import mquantiles from ..utils.extmath import cartesian from ..externals.joblib import Parallel, delayed from ..externals im...
bsd-3-clause
bbci/mushu
test/test_triggerdelay.py
3
3724
#!/usr/bin/env python # test_triggerdelay.py # Copyright (C) 2013 Bastian Venthur # # 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 2 # of the License, or (at your option) any l...
gpl-2.0
automl/paramsklearn
tests/components/feature_preprocessing/test_liblinear.py
1
2085
import unittest from sklearn.linear_model import RidgeClassifier from ParamSklearn.components.feature_preprocessing.liblinear_svc_preprocessor import \ LibLinear_Preprocessor from ParamSklearn.util import _test_preprocessing, PreprocessingTestCase, \ get_dataset import sklearn.metrics class LiblinearComponen...
bsd-3-clause
0x0all/scikit-learn
benchmarks/bench_plot_ward.py
290
1260
""" Benchmark scikit-learn's Ward implement compared to SciPy's """ import time import numpy as np from scipy.cluster import hierarchy import pylab as pl from sklearn.cluster import AgglomerativeClustering ward = AgglomerativeClustering(n_clusters=3, linkage='ward') n_samples = np.logspace(.5, 3, 9) n_features = n...
bsd-3-clause
dsilvestro/PyRate
experimental_code/plot_BDNN.py
1
13787
import numpy as np np.set_printoptions(suppress= 1, precision=3) import os, csv import pandas as pd def softPlus(z): return np.log(np.exp(z) + 1) def get_rate_BDNN(rate, x, w): # n: n species, j: traits, i: nodes z = np.einsum('nj,ij->ni', x, w[0]) z[z < 0] = 0 z = np.einsum('ni,i->n', z, w[1])...
agpl-3.0
fabianp/scikit-learn
sklearn/feature_selection/tests/test_base.py
170
3666
import numpy as np from scipy import sparse as sp from nose.tools import assert_raises, assert_equal from numpy.testing import assert_array_equal from sklearn.base import BaseEstimator from sklearn.feature_selection.base import SelectorMixin from sklearn.utils import check_array class StepSelector(SelectorMixin, Ba...
bsd-3-clause
dsavransky/plandb.sioslab.com
getDataFromIPAC_composite.py
1
44449
import requests import pandas from StringIO import StringIO import astropy.units as u import astropy.constants as const import EXOSIMS.PlanetPhysicalModel.Forecaster from sqlalchemy import create_engine import getpass,keyring import numpy as np import os from scipy.interpolate import interp1d, interp2d, RectBivariateSp...
mit
rahul-c1/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
mdeff/ntds_2017
projects/reports/wikipedia_hyperlink/utils.py
1
9130
import wikipedia import pickle import matplotlib.pyplot as plt import seaborn as sns import networkx as nx import numpy as np import plotly.graph_objs as go from sklearn import linear_model def explore_page(page_title, network, to_explore, inner=False, all_nodes=None): """ This function explores the Wikipedi...
mit
rseubert/scikit-learn
sklearn/metrics/setup.py
299
1024
import os import os.path import numpy from numpy.distutils.misc_util import Configuration from sklearn._build_utils import get_blas_info def configuration(parent_package="", top_path=None): config = Configuration("metrics", parent_package, top_path) cblas_libs, blas_info = get_blas_info() if os.name ==...
bsd-3-clause
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/matplotlib/style/core.py
11
4957
from __future__ import (absolute_import, division, print_function, unicode_literals) import six """ Core functions and attributes for the matplotlib style library: ``use`` Select style sheet to override the current matplotlib settings. ``context`` Context manager to use a style sheet ...
mit
jaytlennon/Dimensions
Aim3/papers/DD/PythonScripts/Env_Geo_Bootstrap.py
4
6308
from __future__ import division import matplotlib.pyplot as plt import geopy from geopy.distance import vincenty import skbio import skbio.diversity import skbio.diversity.beta from skbio.diversity import beta_diversity import pandas as pd import linecache import numpy as np import scipy as sc import scipy.spatial....
gpl-3.0
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/sklearn/neighbors/tests/test_approximate.py
55
19053
""" Testing for the approximate neighbor search using Locality Sensitive Hashing Forest module (sklearn.neighbors.LSHForest). """ # Author: Maheshakya Wijewardena, Joel Nothman import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_a...
mit
ioam/holoviews
holoviews/tests/plotting/matplotlib/testelementplot.py
2
6569
import numpy as np from holoviews.core.spaces import DynamicMap from holoviews.element import Image, Curve, Scatter, Scatter3D from holoviews.streams import Stream from .testplot import TestMPLPlot, mpl_renderer try: from matplotlib.ticker import FormatStrFormatter, FuncFormatter, PercentFormatter except: pa...
bsd-3-clause
hainm/open-forcefield-group
nmr/ace_x_y_nh2/code/analyze_scalar_couplings.py
2
1531
import pandas as pd import mdtraj as md from ace_x_y_nh2_parameters import * larger = pd.read_csv("./data/larger_couplings.csv") smaller = pd.read_csv("./data/smaller_couplings.csv") reference = [] for aa in amino_acids: value = smaller.ix["G"][aa] xyz = ["G%s" % aa, 0, value] reference.append(xyz) ...
gpl-2.0
kaichogami/scikit-learn
sklearn/feature_extraction/tests/test_feature_hasher.py
258
2861
from __future__ import unicode_literals import numpy as np from sklearn.feature_extraction import FeatureHasher from nose.tools import assert_raises, assert_true from numpy.testing import assert_array_equal, assert_equal def test_feature_hasher_dicts(): h = FeatureHasher(n_features=16) assert_equal("dict",...
bsd-3-clause
wkfwkf/statsmodels
statsmodels/tsa/vector_ar/var_model.py
25
50516
""" Vector Autoregression (VAR) processes References ---------- Lutkepohl (2005) New Introduction to Multiple Time Series Analysis """ from __future__ import division, print_function from statsmodels.compat.python import (range, lrange, string_types, StringIO, iteritems, cStringIO) fr...
bsd-3-clause
BlueBrain/NeuroM
examples/end_to_end_distance.py
1
4398
#!/usr/bin/env python # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
bsd-3-clause
harterj/moose
modules/porous_flow/doc/content/modules/porous_flow/tests/sinks/sinks.py
9
10282
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
lgpl-2.1
glenioborges/ibis
ibis/sql/sqlite/tests/test_client.py
6
2772
# Copyright 2015 Cloudera Inc. # # 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, so...
apache-2.0
deepmind/deepmind-research
meshgraphnets/plot_cloth.py
1
2159
# Lint as: python3 # pylint: disable=g-bad-file-header # Copyright 2020 DeepMind Technologies Limited. 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.a...
apache-2.0
MaxHalford/Prince
tests/test_pca.py
1
3331
import unittest import matplotlib as mpl import numpy as np import pandas as pd from sklearn import datasets from sklearn import decomposition from sklearn.utils import estimator_checks import prince class TestPCA(unittest.TestCase): def setUp(self): X, _ = datasets.load_iris(return_X_y=True) c...
mit
userdw/RaspberryPi_3_Starter_Kit
08_Image_Processing/Color_Spaces/hls/hls.py
1
1179
import os, cv2 import numpy as np import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec _projectDirectory = os.path.dirname(__file__) _imagesDirectory = os.path.join(_projectDirectory, "images") _images = [] for _root, _dirs, _files in os.walk(_imagesDirectory): for _file in _files: i...
mit
jjhelmus/artview
docs/sphinxext/numpydoc/tests/test_docscrape.py
3
17864
# -*- encoding:utf-8 -*- from __future__ import division, absolute_import, print_function import sys, textwrap from numpydoc.docscrape import NumpyDocString, FunctionDoc, ClassDoc from numpydoc.docscrape_sphinx import SphinxDocString, SphinxClassDoc from nose.tools import * doc_txt = '''\ numpy.multivariate_normal...
bsd-3-clause
anhaidgroup/py_entitymatching
py_entitymatching/matcher/svmmatcher.py
1
1145
""" This module contains the functions for SVM classifier. """ from py_entitymatching.matcher.mlmatcher import MLMatcher from py_entitymatching.matcher.matcherutils import get_ts from sklearn.svm import SVC class SVMMatcher(MLMatcher): """ SVM matcher. Args: *args,**kwargs: The arguments to scik...
bsd-3-clause
phdowling/scikit-learn
sklearn/tests/test_calibration.py
213
12219
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_greater, assert_almost_equal, ...
bsd-3-clause
MichaelAquilina/numpy
numpy/doc/creation.py
118
5507
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from...
bsd-3-clause
Unpluralized/PyAE
pridb_filters.py
1
19158
# coding: utf-8 import pandas as pd from numpy import gradient as np_gradient import ConfigParser from numba import jit import time import pickle config = ConfigParser.ConfigParser() config.read('./pridb_filter_config.ini') def apply_filters(df, name, **kwargs): """ :param df: Pandas dataframe with ...
gpl-3.0
RobertABT/heightmap
build/matplotlib/examples/axes_grid/simple_anchored_artists.py
16
1950
import matplotlib.pyplot as plt def draw_text(ax): from mpl_toolkits.axes_grid1.anchored_artists import AnchoredText at = AnchoredText("Figure 1a", loc=2, prop=dict(size=8), frameon=True, ) at.patch.set_boxstyle("round,pad=0.,rounding_size=0.2") ax.add_artis...
mit
nicholasmalaya/paleologos
exp/press_trans/code/read_incline_error.py
2
2212
#!/bin/py # # open file # read contents # (re)start when third column found # import sys # # open and read file # path="../data/statistics_incl.lvm" file = open(path, "r+") # # data objects # set_names = [] voltage = [] std = [] height = [] voltage2 = [] std2 = [] height2 = [] for line in file: ...
mit
lssfau/walberla
apps/benchmarks/UniformGrid/ecmModel.py
1
2190
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt kernels = dict() class Kernel: def __init__(self, name, cyclesFirstLoop=0, cyclesSecondLoop=0, cyclesRegPerLUP=0): self.name = name if cyclesRegPerLUP <= 0: self.cyclesFirstLoop = cyclesFirstLoop self.c...
gpl-3.0
vlouf/cpol_processing
cpol_processing/filtering.py
1
9055
""" Codes for creating and manipulating gate filters. New functions: use of trained Gaussian Mixture Models to remove noise and clutter from CPOL data before 2009. @title: filtering.py @author: Valentin Louf <valentin.louf@bom.gov.au> @institutions: Monash University and the Australian Bureau of Meteorology @created: ...
mit
brev/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/texmanager.py
69
16818
""" This module supports embedded TeX expressions in matplotlib via dvipng and dvips for the raster and postscript backends. The tex and dvipng/dvips information is cached in ~/.matplotlib/tex.cache for reuse between sessions Requirements: * latex * \*Agg backends: dvipng * PS backend: latex w/ psfrag, dvips, and Gh...
agpl-3.0
MaxInGaussian/SCFGP
SCFGP/SCFGP.py
1
13766
################################################################################ # SCFGP: Sparsely Correlated Fourier Features Based Gaussian Process # Github: https://github.com/MaxInGaussian/SCFGP # Author: Max W. Y. Lam (maxingaussian@gmail.com) ####################################################################...
bsd-3-clause
finfou/tushare
tushare/stock/trading.py
1
23685
# -*- coding:utf-8 -*- """ 交易数据接口 Created on 2014/07/31 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ from __future__ import division import time import json import lxml.html from lxml import etree import pandas as pd import numpy as np from tushare.stock import cons as ct import...
bsd-3-clause
jmausolf/Python_Tutorials
PostgreSQL_with_Python/prepare.py
1
10406
import sys import os import pandas as pd import subprocess import argparse import pdb import pickle from setup import setup_environment """ Code to take top performing recent models and put them in the evaluation webapp for further examination. Examples: -------- python prepare.py '2016-08-03' 'auc' python prepare.py ...
mit
scott-maddox/simplepl
setup.py
1
3692
# # Copyright (c) 2014, Scott J Maddox # # This file is part of Plot Liberator. # # Plot Liberator is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at y...
agpl-3.0
szredinger/graph-constr-group-testing
graph_constr_group_testing/results_analyser.py
1
1187
import collections import csv from graph_constr_group_testing.core import base_types import pandas def averageQueriesForSize(results): result = [] count = collections.defaultdict(int) sumallqueries = collections.defaultdict(int) for solver, problem, statistics in results: n = base_types.size_o...
mit
pythonvietnam/scikit-learn
examples/semi_supervised/plot_label_propagation_digits.py
268
2723
""" =================================================== Label Propagation digits: Demonstrating performance =================================================== This example demonstrates the power of semisupervised learning by training a Label Spreading model to classify handwritten digits with sets of very few labels....
bsd-3-clause
HesselTjeerdsma/Cyber-Physical-Pacman-Game
Algor/flask/lib/python2.7/site-packages/scipy/integrate/quadrature.py
20
28269
from __future__ import division, print_function, absolute_import import numpy as np import math import warnings # trapz is a public function for scipy.integrate, # even though it's actually a numpy function. from numpy import trapz from scipy.special import roots_legendre from scipy.special import gammaln from scipy....
apache-2.0
deepesch/scikit-learn
sklearn/covariance/tests/test_covariance.py
142
11068
# 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
mxjl620/scikit-learn
examples/ensemble/plot_partial_dependence.py
249
4456
""" ======================== Partial Dependence Plots ======================== Partial dependence plots show the dependence between the target function [1]_ and a set of 'target' features, marginalizing over the values of all other features (the complement features). Due to the limits of human perception the size of t...
bsd-3-clause
DillonNovak/Programming-for-Chemical-Engineering-Applications
Breast+Cancer+Diagnosis.py
1
5376
# coding: utf-8 # ## Predicting Malignant Tumors # ### Wisconsin Diagnostic Beast Cancer Dataset # https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Diagnostic) # # Dataset attributes: # # 0. diagnosis (malignant or benign) # # 1. radius (mean of distances from center to points o...
gpl-3.0
Nyker510/scikit-learn
examples/linear_model/plot_sgd_penalties.py
249
1563
""" ============== SGD: Penalties ============== Plot the contours of the three penalties. All of the above are supported by :class:`sklearn.linear_model.stochastic_gradient`. """ from __future__ import division print(__doc__) import numpy as np import matplotlib.pyplot as plt def l1(xs): return np.array([np....
bsd-3-clause
bhermanmit/openmc
openmc/mgxs/mdgxs.py
1
116899
from __future__ import division from collections import Iterable, OrderedDict import itertools from numbers import Integral import warnings import os import sys import copy from abc import ABCMeta from six import add_metaclass, string_types import numpy as np import openmc from openmc.mgxs import MGXS from openmc.mg...
mit
severinson/coded-computing-tools
rateless.py
2
15846
'''Optimize rateless codes for distributed computing ''' import math import random import logging import numpy as np import pandas as pd import pyrateless import stats import complexity import overhead import pynumeric import tempfile import subprocess from os import path from multiprocessing import Pool def optimi...
apache-2.0
jwlawson/tensorflow
tensorflow/examples/tutorials/word2vec/word2vec_basic.py
6
10430
# Copyright 2015 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
jpinsonault/android_sensor_logger
python_scripts/cluster_light.py
1
2894
import numpy as np import argparse from pprint import pprint from sklearn import mixture from sklearn import datasets import matplotlib.pyplot as plt from sklearn import decomposition from LogEntry import LogEntry from LogEntry import db from datetime import datetime from matplotlib.dates import DayLocator, HourLocator...
mit
blaisb/cfdemUtilities
independentTests/dragSphere.py
2
1890
# This program is a simple ODE solver for the case of the drag around a single sphere # This can be used to predict the stability of the CFDEM coupling time and to play around with the concepts # Time integration is Euler scheme and Euler form for the drag is assumed # TODO # Verlet integration should be added to see ...
lgpl-3.0
TAMU-CLASS/barnfire
src/materials_bondarenko.py
1
17178
''' Andrew Till Summer 2014 Bondarenko iteration utility for materials ''' #STDLIB import os import shutil #TPL import numpy as np #MINE from materials_util import is_fissionable import materials_util as util from directories import get_common_directories import Readgroupr as readgroupr import PDTXS as pdtxs def per...
mit