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
licode/xray-vision
xray_vision/messenger/__init__.py
5
8285
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # Redistribution and use in ...
bsd-3-clause
nvoron23/statsmodels
statsmodels/examples/ex_multivar_kde.py
34
1504
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import axes3d import statsmodels.api as sm """ This example illustrates the nonparametric estimation of a bivariate bi-modal distribution that is a mixture of two normal distri...
bsd-3-clause
SanPen/PracticalGridModeling
examples/topology_engine.py
1
22254
import numpy as np import pandas as pd from scipy.sparse import csc_matrix, lil_matrix, diags from JacobianBased import IwamotoNR np.set_printoptions(linewidth=10000, precision=3) # pd.set_option('display.height', 1000) pd.set_option('display.max_rows', 500) pd.set_option('display.max_columns', 500) pd.set_option('d...
gpl-3.0
ychfan/tensorflow
tensorflow/contrib/learn/python/learn/grid_search_test.py
137
2035
# 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
thientu/scikit-learn
examples/feature_selection/plot_rfe_with_cross_validation.py
226
1384
""" =================================================== Recursive feature elimination with cross-validation =================================================== A recursive feature elimination example with automatic tuning of the number of features selected with cross-validation. """ print(__doc__) import matplotlib.p...
bsd-3-clause
hj3938/panda3d
direct/src/ffi/jGenPyCode.py
8
3101
############################################################## # # This module should be invoked by a shell-script that says: # # python -c "import direct.ffi.jGenPyCode" <arguments> # # Before invoking python, the shell-script may need to set # these environment variables, to make sure that everything # can be loca...
bsd-3-clause
coreyabshire/stacko
src/competition_utilities.py
1
5336
from __future__ import division from collections import Counter import csv import dateutil from datetime import datetime from dateutil.relativedelta import relativedelta import numpy as np import os import pandas as pd import pymongo data_path = "C:/Projects/ML/stacko/data2" submissions_path = data_path if not data_pa...
bsd-2-clause
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pandas/io/data.py
9
45748
""" Module contains tools for collecting data from various remote sources """ import warnings import tempfile import datetime as dt import time from collections import defaultdict import numpy as np from pandas.compat import( StringIO, bytes_to_str, range, lmap, zip ) import pandas.compat as compat from pandas...
gpl-2.0
DougBurke/astropy
astropy/utils/timer.py
2
10783
# Licensed under a 3-clause BSD style license - see LICENSE.rst """General purpose timer related functions.""" # STDLIB import time import warnings from collections import Iterable, OrderedDict from functools import partial, wraps # THIRD-PARTY import numpy as np # LOCAL from .. import units as u from .. import log ...
bsd-3-clause
hupili/bearcart
examples/random_data.py
5
1449
# -*- coding: utf-8 -*- ''' An example for Bearcart ''' import random import bearcart import pandas as pd html_path = r'index.html' data_path = r'data.json' js_path = 'rickshaw.min.js' css_path = 'rickshaw.min.css' tabular_data_1 = [random.randint(10, 100) for x in range(0, 25, 1)] tabular_data_2 = [random.randint(1...
mit
sandeepdsouza93/TensorFlow-15712
tensorflow/contrib/learn/python/learn/estimators/dnn_test.py
5
40857
# 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
DJArmstrong/autovet
Features/Centroiding/scripts/detrend_centroid_external.py
2
12681
# -*- coding: utf-8 -*- """ Created on Tue Oct 25 14:57:36 2016 @author: Maximilian N. Guenther Battcock Centre for Experimental Astrophysics, Cavendish Laboratory, JJ Thomson Avenue Cambridge CB3 0HE Email: mg719@cam.ac.uk """ import numpy as np import matplotlib.pyplot as plt from scipy import signal from astropy.s...
gpl-3.0
timy/dm_spec
ana/seidner/plot_orien.py
1
1642
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np from itertools import product, combinations n_dir, n_esmb = 44, 200 fig = plt.figure() ax = fig.gca(projection='3d') ax.set_aspect("equal") data = np.loadtxt("res/euler.dat") #draw cube # r = [-1, 1] # for s, e in combinations...
mit
YosefLab/scVI
scvi/data/_built_in_data/_pbmc.py
1
4405
import os import pickle from typing import List import anndata import numpy as np import pandas as pd from scvi.data import setup_anndata from scvi.data._built_in_data._dataset_10x import _load_dataset_10x from scvi.data._built_in_data._download import _download def _load_purified_pbmc_dataset( save_path: str =...
bsd-3-clause
giorgiop/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
sonnyhu/scikit-learn
examples/gaussian_process/plot_gpr_co2.py
131
5705
""" ======================================================== Gaussian process regression (GPR) on Mauna Loa CO2 data. ======================================================== This example is based on Section 5.4.3 of "Gaussian Processes for Machine Learning" [RW2006]. It illustrates an example of complex kernel engine...
bsd-3-clause
shenzebang/scikit-learn
sklearn/utils/tests/test_utils.py
215
8100
import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import pinv2 from itertools import chain from sklearn.utils.testing import (assert_equal, assert_raises, assert_true, assert_almost_equal, assert_array_equal, SkipTest, ...
bsd-3-clause
adamgreenhall/scikit-learn
sklearn/neighbors/base.py
71
31147
"""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
gfyoung/pandas
pandas/tests/arrays/test_array.py
2
13512
import datetime import decimal import numpy as np import pytest import pytz from pandas.core.dtypes.base import registry import pandas as pd import pandas._testing as tm from pandas.api.extensions import register_extension_dtype from pandas.api.types import is_scalar from pandas.arrays import ( BooleanArray, ...
bsd-3-clause
RayMick/scikit-learn
sklearn/datasets/tests/test_lfw.py
230
7880
"""This test for the LFW require medium-size data dowloading and processing If the data has not been already downloaded by running the examples, the tests won't run (skipped). If the test are run, the first execution will be long (typically a bit more than a couple of minutes) but as the dataset loader is leveraging ...
bsd-3-clause
andrewcbennett/iris
docs/iris/src/conf.py
6
10757
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
mverzett/rootpy
rootpy/plotting/base.py
4
36584
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License """ This module contains base classes defining core funcionality """ from __future__ import absolute_import from functools import wraps import warnings import sys import ROOT from .. import asrootpy from ..decorato...
gpl-3.0
lail3344/sms-tools
lectures/06-Harmonic-model/plots-code/piano-spectrum.py
24
1038
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF (fs, x) = UF...
agpl-3.0
DonBeo/scikit-learn
sklearn/cluster/birch.py
18
22657
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Joel Nothman <joel.nothman@gmail.com> # License: BSD 3 clause from __future__ import division import warnings import numpy as np from scipy import sparse from math import sqrt fro...
bsd-3-clause
smsbda/trading-with-python
lib/interactivebrokers.py
77
18140
""" Copyright: Jev Kuznetsov Licence: BSD Interface to interactive brokers together with gui widgets """ import sys # import os from time import sleep from PyQt4.QtCore import (SIGNAL, SLOT) from PyQt4.QtGui import (QApplication, QFileDialog, QDialog, QVBoxLayout, QHBoxLayout, QDialogButtonBox, ...
bsd-3-clause
blink1073/scikit-image
doc/examples/color_exposure/plot_log_gamma.py
14
2442
""" ================================= Gamma and log contrast adjustment ================================= This example adjusts image contrast by performing a Gamma and a Logarithmic correction on the input image. """ import matplotlib import matplotlib.pyplot as plt import numpy as np from skimage import data, img_a...
bsd-3-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/sklearn/manifold/isomap.py
50
7515
"""Isomap for manifold learning""" # Author: Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) 2011 import numpy as np from ..base import BaseEstimator, TransformerMixin from ..neighbors import NearestNeighbors, kneighbors_graph from ..utils import check_array from ..utils.graph import...
mit
RPGOne/Skynet
scikit-learn-0.18.1/examples/model_selection/grid_search_text_feature_extraction.py
99
4163
""" ========================================================== Sample pipeline for text feature extraction and evaluation ========================================================== The dataset used in this example is the 20 newsgroups dataset which will be automatically downloaded and then cached and reused for the d...
bsd-3-clause
endlessm/chromium-browser
third_party/catapult/third_party/google-endpoints/future/utils/__init__.py
36
20238
""" A selection of cross-compatible functions for Python 2 and 3. This module exports useful functions for 2/3 compatible code: * bind_method: binds functions to classes * ``native_str_to_bytes`` and ``bytes_to_native_str`` * ``native_str``: always equal to the native platform string object (because ...
bsd-3-clause
r-mart/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
249
1095
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
anhaidgroup/py_entitymatching
py_entitymatching/debugmatcher/debug_randomforest_matcher.py
1
4166
""" This module contains functions for debugging random fores matcher. """ import logging import pandas as pd from py_entitymatching.debugmatcher.debug_decisiontree_matcher import \ _debug_decisiontree_matcher, _get_prob from py_entitymatching.matcher.rfmatcher import RFMatcher from py_entitymatching.utils.valida...
bsd-3-clause
awacha/cct
cct/processinggui/graphing/outliertestresults.py
1
11179
import time from typing import Union, Any import dateutil.parser import numpy as np from PyQt5 import QtWidgets from matplotlib.axes import Axes from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT, FigureCanvasQTAgg from matplotlib.figure import Figure from matplotlib.lines import Line2D from .onedim ...
bsd-3-clause
yuginboy/from_GULP_to_FEFF
feff/libs/GaMnAs_concentration.py
1
39959
import sys import os from io import StringIO import inspect import numpy as np import matplotlib.gridspec as gridspec from matplotlib import pylab import matplotlib.pyplot as plt import scipy as sp from scipy.interpolate import interp1d from scipy.interpolate import Rbf, InterpolatedUnivariateSpline, splrep, splev, spl...
gpl-3.0
CanisMajoris/ThinkStats2
code/hinc.py
67
1494
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import numpy as np import pandas import thinkplot import thinkstats2 def Clean(s):...
gpl-3.0
I--P/numpy
numpy/core/code_generators/ufunc_docstrings.py
14
90528
""" Docstrings for generated ufuncs The syntax is designed to look like the function add_newdoc is being called from numpy.lib, but in this file add_newdoc puts the docstrings in a dictionary. This dictionary is used in numpy/core/code_generators/generate_umath.py to generate the docstrings for the ufuncs in numpy.co...
bsd-3-clause
Ernestyj/PyStudy
finance/WeekTest/AdaboostSGDTest.py
1
2612
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import talib pd.set_option('display.max_rows', 500) pd.set_option('display.max_columns', 30) pd.set_option('precision', 7) pd.options.display.float_format = '{:,...
apache-2.0
jblackburne/scikit-learn
benchmarks/bench_plot_svd.py
325
2899
"""Benchmarks of Singular Value Decomposition (Exact and Approximate) The data is mostly low rank but is a fat infinite tail. """ import gc from time import time import numpy as np from collections import defaultdict from scipy.linalg import svd from sklearn.utils.extmath import randomized_svd from sklearn.datasets.s...
bsd-3-clause
JeanKossaifi/scikit-learn
sklearn/tests/test_discriminant_analysis.py
35
11709
try: # Python 2 compat reload except NameError: # Regular Python 3+ import from importlib import reload import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.t...
bsd-3-clause
kushalbhola/MyStuff
Practice/PythonApplication/env/Lib/site-packages/pandas/core/accessor.py
2
8470
""" accessor.py contains base classes for implementing accessor properties that can be mixed into or pinned onto other pandas classes. """ from typing import Set import warnings from pandas.util._decorators import Appender class DirNamesMixin: _accessors = set() # type: Set[str] _deprecations = frozenset(...
apache-2.0
gongshijun/ystechweb
common/result.py
1
1421
# coding: utf-8 import os import re import pandas as pd # run shell def execmd(cmd): os.system(cmd) class final_result(object): def __init__(self, result=None): self.result = result # get data from result.txt def get_result(self,filename): f = open(filename, 'r') data = f...
gpl-3.0
adamrvfisher/TechnicalAnalysisLibrary
ADXStratOpt.py
1
4717
# -*- coding: utf-8 -*- """ Created on Sun Apr 9 16:36:25 2017 @author: AmatVictoriaCuramIII """ import pandas as pd from pandas_datareader import data import numpy as np import time as t import random as rand ticker = '^GSPC' s = data.DataReader(ticker, 'yahoo', start='01/01/2016', end='01/01/2050') iterations = ra...
apache-2.0
madjelan/scikit-learn
sklearn/neighbors/classification.py
106
13987
"""Nearest Neighbor Classification""" # 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 support by ...
bsd-3-clause
alexmojaki/blaze
blaze/compute/tests/test_sql_compute.py
6
56473
from __future__ import absolute_import, division, print_function import pytest sa = pytest.importorskip('sqlalchemy') import itertools import re from distutils.version import LooseVersion import datashape from odo import into, resource, discover from pandas import DataFrame from toolz import unique from blaze.com...
bsd-3-clause
dpinney/omf
omf/scratch/dataShader/Graph.py
1
8303
#!/usr/bin/env python # coding: utf-8 #Converting image imports #import base64 #import io import math import numpy as np import pandas as pd import datashader as ds import datashader.transfer_functions as tf from datashader.layout import random_layout from datashader.bundling import connect_edges #from itertools im...
gpl-2.0
ShaperTools/openhtf
openhtf/core/measurements.py
1
22990
# 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 agre...
apache-2.0
mkness/TheCannon
code/deprecated/makeplot_R3.py
1
4257
#!/usr/bin/python import numpy from numpy import savetxt import matplotlib from matplotlib import pyplot import scipy from scipy import interpolate from matplotlib.ticker import MultipleLocator, FormatStrFormatter s = matplotlib.font_manager.FontProperties() s.set_family('serif') s.set_size(14) from matplotlib import r...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/dask/dataframe/multi.py
2
25292
""" Algorithms that Involve Multiple DataFrames =========================================== The pandas operations ``concat``, ``join``, and ``merge`` combine multiple DataFrames. This module contains analogous algorithms in the parallel case. There are two important cases: 1. We combine along a partitioned index 2...
gpl-3.0
TomAugspurger/pandas
pandas/core/computation/scope.py
1
9112
""" Module for scope operations """ import datetime import inspect from io import StringIO import itertools import pprint import struct import sys from typing import List import numpy as np from pandas._libs.tslibs import Timestamp from pandas.compat.chainmap import DeepChainMap def ensure_scope( level: int, g...
bsd-3-clause
pythonvietnam/scikit-learn
examples/cluster/plot_segmentation_toy.py
258
3336
""" =========================================== Spectral clustering for image segmentation =========================================== In this example, an image with connected circles is generated and spectral clustering is used to separate the circles. In these settings, the :ref:`spectral_clustering` approach solve...
bsd-3-clause
Unidata/MetPy
v0.12/_downloads/aedfcde5d540d021d02883dc8627add4/Station_Plot_with_Layout.py
9
8124
# Copyright (c) 2016,2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ Station Plot with Layout ======================== Make a station plot, complete with sky cover and weather symbols, using a station plot layout built into MetPy. The stati...
bsd-3-clause
skjerns/AutoSleepScorerDev
test_dataset_feat.py
1
2550
# -*- coding: utf-8 -*- """ This is python 3 code main script for training/classifying """ if not '__file__' in vars(): __file__= u'C:/Users/Simon/dropbox/Uni/Masterthesis/AutoSleepScorer/main.py' import os import gc; gc.collect() import matplotlib matplotlib.use('Agg') import numpy as np import keras import tools impo...
gpl-3.0
mohittahiliani/PIE-ns3
src/flow-monitor/examples/wifi-olsr-flowmon.py
108
7439
# -*- Mode: Python; -*- # Copyright (c) 2009 INESC Porto # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, #...
gpl-2.0
rahul-c1/scikit-learn
sklearn/neighbors/unsupervised.py
16
3198
"""Unsupervised nearest neighbors learner""" from .base import NeighborsBase from .base import KNeighborsMixin from .base import RadiusNeighborsMixin from .base import UnsupervisedMixin class NearestNeighbors(NeighborsBase, KNeighborsMixin, RadiusNeighborsMixin, UnsupervisedMixin): """Unsu...
bsd-3-clause
YinongLong/scikit-learn
sklearn/linear_model/tests/test_huber.py
54
7619
# Authors: Manoj Kumar mks542@nyu.edu # License: BSD 3 clause import numpy as np from scipy import optimize, sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_a...
bsd-3-clause
pnedunuri/scikit-learn
sklearn/tests/test_isotonic.py
230
11087
import numpy as np import pickle from sklearn.isotonic import (check_increasing, isotonic_regression, IsotonicRegression) from sklearn.utils.testing import (assert_raises, assert_array_equal, assert_true, assert_false, assert_equal, ...
bsd-3-clause
zachmayer/vowpal_wabbit
python/vowpalwabbit/sklearn_vw.py
1
20773
# -*- coding: utf-8 -*- # pylint: disable=line-too-long, unused-argument, invalid-name, too-many-arguments, too-many-locals """ Utilities to support integration of Vowpal Wabbit and scikit-learn """ import numpy as np from vowpalwabbit.pyvw import vw import re from scipy.sparse import csr_matrix from sklearn import me...
bsd-3-clause
judithfan/pix2svg
generative/tests/compare_test/concat_first/train_average.py
1
10419
from __future__ import division from __future__ import print_function from __future__ import absolute_import import os import sys import shutil import numpy as np from tqdm import tqdm import torch import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable from sklearn.metrics imp...
mit
chrisjmccormick/simsearch
runElbowMethod.py
1
3522
# -*- coding: utf-8 -*- """ This script uses the elbow method to help identify a good value of 'k' to use for k-means clustering. @author: Chris McCormick """ from scipy.spatial.distance import cdist, pdist from sklearn.cluster import KMeans from simsearch import SimSearch import numpy as np import matplotlib.pyplot ...
mit
jwlockhart/concept-networks
examples/person_similarity_parallel.py
1
3993
# @author Jeff Lockhart <jwlock@umich.edu> # Example script computing the pairwise similarity of people and/or # responses in a sample. Parallel implementation using ipyparallel. # # version 1.1 import pandas as pd import ipyparallel import sys sys.path.insert(0,'../') from network_utils import * print('Creating c...
gpl-3.0
ros-industrial/industrial_training
exercises/Descartes_Planning_and_Execution/solution_ws/src/plan_and_run/src/generate_lemniscate_trajectory.py
12
1825
#!/usr/bin/env python import numpy import math import matplotlib.pyplot as pyplot from mpl_toolkits.mplot3d import Axes3D def generateLemniscatePoints(): # 3D plotting setup fig = pyplot.figure() ax = fig.add_subplot(111,projection='3d') a = 6.0 ro = 4.0 dtheta = 0.1 nsamples = 200 ...
apache-2.0
cbertinato/pandas
pandas/tests/io/parser/test_compression.py
1
4616
""" Tests compressed data parsing functionality for all of the parsers defined in parsers.py """ import os import zipfile import pytest import pandas as pd import pandas.util.testing as tm @pytest.fixture(params=[True, False]) def buffer(request): return request.param @pytest.fixture def parser_and_data(all_...
bsd-3-clause
keflavich/scikit-image
skimage/viewer/canvastools/painttool.py
23
6437
import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as mcolors LABELS_CMAP = mcolors.ListedColormap(['white', 'red', 'dodgerblue', 'gold', 'greenyellow', 'blueviolet']) from ...viewer.canvastools.base import CanvasToolBase __all__ = ['PaintTool'] class P...
bsd-3-clause
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/build/lib.linux-i686-2.7/matplotlib/testing/jpl_units/UnitDblFormatter.py
6
1401
#=========================================================================== # # UnitDblFormatter # #=========================================================================== """UnitDblFormatter module containing class UnitDblFormatter.""" #==========================================================================...
mit
zhuangjun1981/retinotopic_mapping
retinotopic_mapping/examples/visual_stimlation/example_retinotopic_mapping.py
1
5154
# -*- coding: utf-8 -*- """ Example script to test StimulusRoutines.CombinedStimuli class """ import matplotlib.pyplot as plt import retinotopic_mapping.StimulusRoutines as stim from retinotopic_mapping.MonitorSetup import Monitor, Indicator from retinotopic_mapping.DisplayStimulus import DisplaySequence # ==========...
gpl-3.0
pradyu1993/scikit-learn
sklearn/decomposition/tests/test_nmf.py
1
5049
import numpy as np from sklearn.decomposition import nmf from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import raises from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater random_state = np...
bsd-3-clause
astrofrog/numpy
doc/source/conf.py
7
10752
# -*- coding: utf-8 -*- import sys, os, re # Check Sphinx version import sphinx if sphinx.__version__ < "1.0.1": raise RuntimeError("Sphinx 1.0.1 or newer required") needs_sphinx = '1.0' # ----------------------------------------------------------------------------- # General configuration # -------------------...
bsd-3-clause
klusta-team/kwiklib
kwiklib/dataio/loader.py
1
17513
"""This module provides utility classes and functions to load spike sorting data sets.""" # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- import os import os.path import re from collections import ...
bsd-3-clause
mehdidc/scikit-learn
sklearn/utils/mocking.py
38
1807
from sklearn.base import BaseEstimator from sklearn.utils.testing import assert_true class ArraySlicingWrapper(object): def __init__(self, array): self.array = array def __getitem__(self, aslice): return MockDataFrame(self.array[aslice]) class MockDataFrame(object): # have shape an len...
bsd-3-clause
rlkelly/StockPy
StockPy.py
3
3376
import pandas.io.data as web import datetime as dt import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.widgets as wd def plot_data(stkname, fig, topplt, botplt, sidplt): #Get data from yahoo #Calculate olling mean, mean and current value of stock #Also calculate length...
gpl-2.0
marioharper182/ComputationalMethodsFinance
Homework1/GuessMyNumber.py
1
1685
__author__ = 'Mario' import matplotlib.pyplot as plt import numpy as np import itertools def Guessengine(A): A = int(A) # Basic Parameters low = 0 high = 101 guess = [50] g = 0 counter = 0 # Plotting information is stored here: matplotlist = [50] trieslist = [0] while g...
apache-2.0
squirrelo/qiime
scripts/identify_paired_differences.py
15
9191
#!/usr/bin/env python # File created on 19 Jun 2013 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2013, The QIIME project" __credits__ = ["Greg Caporaso", "Jose Carlos Clemente Litran"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = ...
gpl-2.0
dessn/sn-bhm
papers/methods/snippets/efficiency.py
1
1820
import numpy as np from scipy.stats import norm, skewnorm import matplotlib.pyplot as plt from matplotlib import rc from astropy.cosmology import FlatwCDM mbs = np.linspace(19, 27, 100) pop = norm.pdf(mbs, 22, 1) pop /= pop.max() cdf_mu, cdf_sigma = 21.5, 0.5 cdf = 1 - norm.cdf(mbs, cdf_mu, cdf_sigma) cdf_eff = pop ...
mit
exa-analytics/exa
exa/util/constants.py
1
2062
# -*- coding: utf-8 -*- # Copyright (c) 2015-2020, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Physical Constants ####################################### Tabulated physical constants from `NIST`_. Note that all constants are float objects (with a slightly modified repr). T...
apache-2.0
jorik041/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
PhE/dask
dask/dataframe/tests/test_utils_dataframe.py
11
1064
import pandas as pd from dask.dataframe.utils import (shard_df_on_index, get_categories, _categorize, strip_categories) import pandas.util.testing as tm def test_shard_df_on_index(): df = pd.DataFrame({'x': [1, 2, 3, 4, 5, 6], 'y': list('abdabd')}, index=[10, 20, 30, 40, 50, 60]) ...
bsd-3-clause
joernhees/scikit-learn
benchmarks/bench_multilabel_metrics.py
276
7138
#!/usr/bin/env python """ A comparison of multilabel target formats and metrics over them """ from __future__ import division from __future__ import print_function from timeit import timeit from functools import partial import itertools import argparse import sys import matplotlib.pyplot as plt import scipy.sparse as...
bsd-3-clause
cpury/lstm-math
plot.py
1
3569
import numpy as np import matplotlib.pyplot as plt import pandas as pd def plot_2d_space( model, one_hot_encoder, x, y, n=None, reverse=False, save_to=None, dpi=256, ): """ For models trained on equations ala 'a + b', this will plot a scatter plot with correct examples in green and incorrect ones ...
mit
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/tools/plotting/plotter.py
4
2247
#!/usr/bin/env python # python histogram input_file output_file column bins import sys, os import matplotlib; matplotlib.use('Agg') from pylab import * assert sys.version_info[:2] >= ( 2, 4 ) def stop_err(msg): sys.stderr.write(msg) sys.exit() if __name__ == '__main__': # parse the arguments ...
gpl-3.0
SusanJL/iris
docs/iris/src/sphinxext/gen_gallery.py
9
6301
# # (C) Copyright 2012 MATPLOTLIB (vn 1.2.0) # ''' Generate a thumbnail gallery of examples. ''' from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa import os import glob import re import warnings import matplotlib.image as image temp...
gpl-3.0
intuition-io/intuition
tests/test_utils.py
1
2324
''' Tests for intuition.utils ''' import unittest from nose.tools import ok_, eq_, nottest import pytz import datetime as dt import pandas as pd import intuition.utils as utils class UtilsTestCase(unittest.TestCase): def test_is_live(self): last_trade_date = dt.datetime(2026, 1, 1, tzinfo=pytz.utc) ...
apache-2.0
elenbert/allsky
src/webdatagen/system-sensors.py
1
2514
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt import matplotlib.dates as mdates import MySQLdb import sys import config def plot_cpu_temperature(sensor_data, output_file): xdata = [] ydata = [] print 'Plotting cpu temperature graph using ' + str(len(sensor_data)) + ' db records' for row...
gpl-2.0
fredhusser/scikit-learn
examples/tree/plot_iris.py
271
2186
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
bsd-3-clause
PanDAWMS/pilot
RunJobHpcEvent.py
3
87735
# Class definition: # RunJobHpcEvent # This class is the base class for the HPC Event Server classes. # Instances are generated with RunJobFactory via pUtil::getRunJob() # Implemented as a singleton class # http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern import commands import json ...
apache-2.0
wazeerzulfikar/scikit-learn
examples/covariance/plot_robust_vs_empirical_covariance.py
69
6473
r""" ======================================= Robust vs Empirical covariance estimate ======================================= The usual covariance maximum likelihood estimate is very sensitive to the presence of outliers in the data set. In such a case, it would be better to use a robust estimator of covariance to guar...
bsd-3-clause
wanggang3333/scikit-learn
examples/calibration/plot_calibration_multiclass.py
272
6972
""" ================================================== Probability Calibration for 3-class classification ================================================== This example illustrates how sigmoid calibration changes predicted probabilities for a 3-class classification problem. Illustrated is the standard 2-simplex, wher...
bsd-3-clause
lnls-sirius/dev-packages
siriuspy/siriuspy/ramp/test_reconst_factory.py
1
6985
#!/usr/bin/env python-sirius """Test reconstrction factories.""" from copy import deepcopy as _dcopy import argparse as _argparse import numpy as _np import matplotlib.pyplot as plt from siriuspy.clientconfigdb import ConfigDBDocument from siriuspy.ramp.ramp import BoosterRamp from siriuspy.ramp.waveform import Wave...
gpl-3.0
sniemi/SamPy
bolshoi/subhaloDistances.py
1
16670
""" Find subhalo galaxy distances from the main halo as a function of redshift, halo mass, etc. :Warning: All functions are rather poorly written as I was in a hurry. One should improve them before using. One could remove several loops and do many things with table joins which are now separate loop...
bsd-2-clause
RPGOne/Skynet
scikit-learn-0.18.1/examples/model_selection/plot_confusion_matrix.py
20
3180
""" ================ 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
Lawrence-Liu/scikit-learn
examples/classification/plot_classification_probability.py
242
2624
""" =============================== Plot classification probability =============================== Plot the classification probability for different classifiers. We use a 3 class dataset, and we classify it with a Support Vector classifier, L1 and L2 penalized logistic regression with either a One-Vs-Rest or multinom...
bsd-3-clause
jordan-g/Segregated-Dendrite-Deep-Learning
deep_learning.py
1
102639
# encoding=utf8 ''' Code for simulations presented in "Towards deep learning with segregated dendrites", arXiv:1610.00161 by Jordan Guergiuev, Timothy P. Lillicrap, Blake A. Richards. Author: Jordan Guergiuev E-mail: guerguiev.j@gmail.com Date: May 10, 2017 Institution: University of Toronto Scarborou...
gpl-3.0
Ziqi-Li/bknqgis
bokeh/tests/examples/test_examples.py
1
7455
from __future__ import absolute_import, print_function import os import time import pytest import subprocess import signal from os.path import abspath, dirname, exists, join, split from tests.plugins.utils import trace, info, fail, ok, red, warn, white from tests.plugins.phantomjs_screenshot import get_phantomjs_scr...
gpl-2.0
bendalab/thunderfish
thunderfish/efield.py
2
21468
""" Simulations of spatial electric fields. For simulating the spatial geometry of electric fields generated by electric fishes and perturbed by objects, first generate monopoles and charges: - `efish_monopoles()`: monopoles for simulating the electric field of an electric fish. - `object_monopoles()`: monopoles for ...
gpl-3.0
kensugino/jGEM
jgem/merge.py
1
67888
""" .. module:: merge :synopsis: module for merging multiple assemblies .. moduleauthor:: Ken Sugino <ken.sugino@gmail.com> """ import subprocess import os import gzip import logging logging.basicConfig(level=logging.DEBUG) LOG = logging.getLogger(__name__) import shutil import json import pandas as PD import...
mit
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/pandas/tests/series/test_period.py
7
8836
import numpy as np import pandas as pd import pandas.util.testing as tm import pandas.core.indexes.period as period from pandas import Series, period_range, DataFrame, Period def _permute(obj): return obj.take(np.random.permutation(len(obj))) class TestSeriesPeriod(object): def setup_method(self, method):...
agpl-3.0
Achuth17/scikit-learn
examples/model_selection/plot_learning_curve.py
250
4171
""" ======================== Plotting Learning Curves ======================== On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset. Note that the training score and the cross-validation score are both not very good at the end. However, the shape of the curve can be found in ...
bsd-3-clause
milankl/swm
calc/misc/trispec_calc.py
1
2830
## COMPUTE TRISPEC from __future__ import print_function path = '/home/mkloewer/python/swm/' import os; os.chdir(path) # change working directory import numpy as np from scipy import sparse import time as tictoc from netCDF4 import Dataset import glob import matplotlib.pyplot as plt # OPTIONS runfolder = [3] print('Ca...
gpl-3.0
jakevdp/seaborn
seaborn/timeseries.py
6
13239
"""Timeseries plotting functions.""" from __future__ import division import numpy as np import pandas as pd from scipy import stats, interpolate import matplotlib as mpl import matplotlib.pyplot as plt from .external.six import string_types from . import utils from . import algorithms as algo from .palettes import c...
bsd-3-clause
cdeboever3/cdpybio
tests/plink/test_plink.py
1
2431
from copy import deepcopy import os from numpy import array from numpy import nan import numpy as np import pandas as pd from pandas.util.testing import assert_frame_equal import pytest import cdpybio as cpb def add_root(fn): return os.path.join(cpb._root, 'tests', 'star', fn) LINEAR = add_root('test.glm.linear...
mit
imec-myhdl/pycontrol-gui
Book/Examples/BallOnWheel.py
1
1660
from sympy import symbols, Matrix, pi from sympy.physics.mechanics import * import numpy as np ph0, ph1, ph2 = dynamicsymbols('ph0 ph1 ph2') w1, w2 = dynamicsymbols('w1 w2') T = dynamicsymbols('T') J1, J2 = symbols('J1 J2') M1, M2 = symbols('M1 M2') R1, R2 = symbols('R1 R2') d1 = symbols('d1') g = symbols('...
lgpl-2.1
JonasHarnau/apc
apc/tests/test_plot_residuals.py
1
1196
import unittest import apc import matplotlib.pyplot as plt class TestPlotResiduals(unittest.TestCase): def test_TA(self): model = apc.Model() model.data_from_df(apc.loss_TA(), data_format='CL') model.fit('od_poisson_response', 'AC') for sr in ('start', 'mean', 'end', False): ...
gpl-3.0