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
mtaufen/test-infra
mungegithub/issue-labeler/simple_app.py
20
4662
#!/usr/bin/env python # Copyright 2016 The Kubernetes 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 appli...
apache-2.0
minireference/noBSLAnotebooks
aspynb/Testing.py
1
1948
def cells(): ''' # Testing SymPy and plot helpers are working ''' ''' ''' # setup SymPy from sympy import * x, y, z, t = symbols('x y z t') init_printing() # download plot_helpers.py for use in colab if 'google.colab' in str(get_ipython()): print('Downloading p...
mit
Fkawala/gcloud-python
docs/conf.py
4
9557
# Copyright 2016 Google 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, ...
apache-2.0
astocko/statsmodels
statsmodels/base/model.py
25
76781
from __future__ import print_function from statsmodels.compat.python import iterkeys, lzip, range, reduce import numpy as np from scipy import stats from statsmodels.base.data import handle_data from statsmodels.tools.tools import recipr, nan_dot from statsmodels.stats.contrast import ContrastResults, WaldTestResults f...
bsd-3-clause
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pandas/core/groupby.py
9
140196
import types from functools import wraps import numpy as np import datetime import collections import warnings import copy from pandas.compat import( zip, builtins, range, long, lzip, OrderedDict, callable, filter, map ) from pandas import compat from pandas.core.base import PandasObject from pandas.core.cate...
gpl-2.0
vigilv/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
techtonik/numpy
doc/example.py
81
3581
"""This is the docstring for the example.py module. Modules names should have short, all-lowercase names. The module name may have underscores if this improves readability. Every module should have a docstring at the very top of the file. The module's docstring may extend over multiple lines. If your docstring doe...
bsd-3-clause
cycleuser/GeoPython
geopytool/setup.py
2
1631
#!/usr/bin/env python #coding:utf-8 import os from distutils.core import setup from geopytool.ImportDependence import * from geopytool.CustomClass import * here = os.path.abspath(os.path.dirname(__file__)) try: README = open(os.path.join(here, 'README.md')).read() except: README = 'https://github.com/GeoPyT...
gpl-3.0
ZenDevelopmentSystems/scikit-learn
examples/linear_model/plot_omp.py
385
2263
""" =========================== Orthogonal Matching Pursuit =========================== Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encoded with a dictionary """ print(__doc__) import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import OrthogonalM...
bsd-3-clause
zorojean/scikit-learn
examples/feature_stacker.py
246
1906
""" ================================================= Concatenating multiple feature extraction methods ================================================= In many real-world examples, there are many ways to extract features from a dataset. Often it is beneficial to combine several methods to obtain good performance. Th...
bsd-3-clause
inesc-tec-robotics/robot_localization_tools
scripts/path_velocity_and_acceleration_plotter.py
2
12044
#!/usr/bin/env python # coding=UTF-8 # Requires https://github.com/moble/quaternion import argparse import ntpath import sys import math import numpy as np import numpy.linalg import matplotlib.pyplot as plt import matplotlib.ticker as tk import quaternion def str2bool(v): return v.lower() in ("yes", "true", "t...
bsd-3-clause
IGITUGraz/spore-nest-module
examples/center_out_showcase/python/snn_utils/plotter/backends/mpl.py
3
1721
import logging import matplotlib.pyplot as plt import snn_utils.plotter as plotter logger = logging.getLogger(__name__) def configure_matplotlib(): plt.ion() # interactive mode plt.rcParams['figure.facecolor'] = 'white' plt.rcParams['axes.facecolor'] = 'white' plt.switch_backend('TkAgg') class M...
gpl-2.0
cgarrard/osgeopy-code
Chapter13/chapter13.py
1
7575
import os import numpy as np from osgeo import gdal, ogr import matplotlib.pyplot as plt import mapnik # Set this variable to your osgeopy-data directory so that the following # examples will work without editing. We'll use the os.path.join() function # to combine this directory and the filenames to make a complete p...
mit
luyaozou/PySpec
PySpec.py
1
24448
#! /usr/bin/env python #-*- coding: utf-8 -*- """ Integrated Python GUI for spectral analysis. Designed functionalities: > Plot spectra (x,y) file > Fit spectral lines to common lineshape functions (Gaussian/Lorentzian/Voigt) > Baseline removal > Peak selection > Catalog simulation (JPL/CDMS) ...
gpl-3.0
crichardson17/starburst_atlas
Low_resolution_sims/DustFree_LowRes/Padova_cont_supersolar_5/MoreLines.py
3
7227
import csv import matplotlib.pyplot as plt from numpy import * import scipy.interpolate import math from pylab import * from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.patches as patches from matplotlib.path import Path import os # --------------------------------------------------...
gpl-2.0
elijah513/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
toastedcornflakes/scikit-learn
examples/cluster/plot_digits_linkage.py
369
2959
""" ============================================================================= Various Agglomerative Clustering on a 2D embedding of digits ============================================================================= An illustration of various linkage option for agglomerative clustering on a 2D embedding of the di...
bsd-3-clause
PythonCharmers/bokeh
bokeh/charts/_data_adapter.py
43
8802
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the ChartObject class, a minimal prototype class to build more chart types on top of it. It provides the mechanisms to support the shared chained methods. """ #-------------------------------------------...
bsd-3-clause
adrienpacifico/openfisca-france-data
openfisca_france_data/input_data_builders/build_eipp_survey_data/eipp_utils.py
3
8464
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify...
agpl-3.0
shusenl/scikit-learn
examples/mixture/plot_gmm.py
248
2817
""" ================================= Gaussian Mixture Model Ellipsoids ================================= Plot the confidence ellipsoids of a mixture of two Gaussians with EM and variational Dirichlet process. Both models have access to five components with which to fit the data. Note that the EM model will necessari...
bsd-3-clause
MariaRigaki/kaggle
africa/predict.py
1
1802
__author__ = 'marik0' #!/usr/bin/env python # coding: utf-8 """ prediction code for regression """ import sys import numpy as np import pandas as pd from pylearn2.utils import serial from theano import tensor as T from theano import function if __name__ == "__main__": try: model_path = sys.argv[1] ...
mit
yutiansut/QUANTAXIS
QUANTAXIS/QAApplication/OldBacktest.py
2
3257
# @Hakase import QUANTAXIS as QA import numpy as np import pandas as pd import datetime import sys import random class backtest(): """依据回测场景的建模 """ def __init__(self, start_time='2015-01-01', end_time='2018-09-24', init_cash=500000, code='RBL8', frequence=QA.FREQUENCE.FIFTEEN_MIN): self.start_ti...
mit
cl4rke/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
allisony/aplpy
aplpy/labels.py
2
16255
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division, unicode_literals import warnings import numpy as np import matplotlib.pyplot as mpl from matplotlib.font_manager import FontProperties from . import wcs_util from . import angle_util as au from .decorators import auto_refresh,...
mit
datapythonista/pandas
pandas/tests/indexes/object/test_indexing.py
3
4370
import numpy as np import pytest import pandas as pd from pandas import Index import pandas._testing as tm class TestGetLoc: def test_get_loc_raises_object_nearest(self): index = Index(["a", "c"]) with pytest.raises(TypeError, match="unsupported operand type"): index.get_loc("a", meth...
bsd-3-clause
alekz112/statsmodels
statsmodels/datasets/cpunish/data.py
25
2597
"""US Capital Punishment dataset.""" __docformat__ = 'restructuredtext' COPYRIGHT = """Used with express permission from the original author, who retains all rights.""" TITLE = __doc__ SOURCE = """ Jeff Gill's `Generalized Linear Models: A Unified Approach` http://jgill.wustl.edu/research/books.html """...
bsd-3-clause
sld/computer_vision_workshop
kaggle/MNIST_recognizer/digit_recognizer.py
1
3248
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import numpy.random as random import matplotlib.pyplot as plt from sklearn import neighbors, datasets, cross_validation import cv2 import csv import sys class DigitClassifier: def __init__(self, data_source, k=10): self.data = data_source.data() ...
mit
sobomax/virtualbox_64bit_edd
src/VBox/ValidationKit/testmanager/webui/wuihlpgraph.py
2
4253
# -*- coding: utf-8 -*- # $Id: wuihlpgraph.py $ """ Test Manager Web-UI - Graph Helpers. """ __copyright__ = \ """ Copyright (C) 2012-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and...
gpl-2.0
hitszxp/scikit-learn
sklearn/learning_curve.py
28
13300
"""Utilities to evaluate models with respect to a variable """ # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import warnings import numpy as np from .base import is_classifier, clone from .cross_validation import _check_cv from .externals.joblib import Parallel, delayed fr...
bsd-3-clause
zorroblue/scikit-learn
examples/svm/plot_iris.py
65
3742
""" ================================================== Plot different SVM classifiers in the iris dataset ================================================== Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only consider the first 2 features of this dataset: - Sepal length - Se...
bsd-3-clause
lazywei/scikit-learn
sklearn/preprocessing/tests/test_imputation.py
213
11911
import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.preprocessing.imputa...
bsd-3-clause
raghavrv/scikit-learn
sklearn/utils/tests/test_testing.py
7
8098
import warnings import unittest import sys import numpy as np from scipy import sparse from sklearn.utils.testing import ( assert_raises, assert_less, assert_greater, assert_less_equal, assert_greater_equal, assert_warns, assert_no_warnings, assert_equal, set_random_state, asser...
bsd-3-clause
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/statistics/multiple_histograms_side_by_side.py
1
3066
""" ========================================== Producing multiple histograms side by side ========================================== This example plots horizontal histograms of different samples along a categorical x-axis. Additionally, the histograms are plotted to be symmetrical about their x-position, thus making t...
mit
glennq/scikit-learn
examples/ensemble/plot_feature_transformation.py
115
4327
""" =============================================== Feature transformations with ensembles of trees =============================================== Transform your features into a higher dimensional, sparse space. Then train a linear model on these features. First fit an ensemble of trees (totally random trees, a rand...
bsd-3-clause
paulbrodersen/netgraph
netgraph/_interactive_variants.py
1
23119
#!/usr/bin/env python # -*- coding: utf-8 -*- """ InteractiveGraph variants. """ import numpy as np import matplotlib.pyplot as plt import itertools from functools import partial from matplotlib.patches import Rectangle try: from ._main import InteractiveGraph, BASE_SCALE from ._line_supercover import line_...
gpl-3.0
GGoussar/scikit-image
doc/examples/transform/plot_register_translation.py
14
2717
""" ===================================== Cross-Correlation (Phase Correlation) ===================================== In this example, we use phase correlation to identify the relative shift between two similar-sized images. The ``register_translation`` function uses cross-correlation in Fourier space, optionally emp...
bsd-3-clause
ahealy19/F-IDE-2016
make_fig1.py
1
1660
import numpy as np import matplotlib.pyplot as plt from pandas import DataFrame """ read a csv file and render a stacked bar chart showing each prover's results for 60 second timeout Andrew Healy, Aug. 2016 """ df = DataFrame.from_csv('fig1_data.csv') provers = df.index N = len(provers) valids = list(df['Valid']) ...
apache-2.0
klaus385/openpilot
panda/tests/tucan_loopback.py
2
3331
#!/usr/bin/env python from __future__ import print_function import os import sys import time import random import argparse from hexdump import hexdump from itertools import permutations sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) from panda import Panda def get_test_string(): r...
mit
M-R-Houghton/euroscipy_2015
bokeh/bokeh/charts/builder/tests/test_dot_builder.py
33
3939
""" 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 thi...
mit
cjayb/mne-python
examples/inverse/plot_source_space_snr.py
3
3461
# -*- coding: utf-8 -*- """ =============================== Computing source space SNR =============================== This example shows how to compute and plot source space SNR as in [1]_. """ # Author: Padma Sundaram <tottochan@gmail.com> # Kaisu Lankinen <klankinen@mgh.harvard.edu> # # License: BSD (3-clau...
bsd-3-clause
syedjafri/ThinkStats2
code/analytic.py
69
6265
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import math import numpy as np import pandas import nsfg import thinkplot import th...
gpl-3.0
OXPHOS/shogun
examples/undocumented/python/graphical/classifier_perceptron_graphical.py
10
2302
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import latex_plot_inits parameter_list = [[20, 5, 1., 1000, 1, None, 5], [100, 5, 1., 1000, 1, None, 10]] def classifier_perceptron_graphical(n=100, distance=5, learn_rate=1., max_iter=1000, num_threads=1, seed=None, nperceptrons=5): from shog...
gpl-3.0
stharrold/bench_fastq
bench_fastq/utils.py
2
15946
#!/usr/bin/env python """Utils to parse the terminal output from bench_compress.sh """ from __future__ import print_function, division, absolute_import import os import sys import json import datetime as dt import numpy as np import pandas as pd import matplotlib.pyplot as plt def parse_elapsed(elapsed): """Pars...
mit
jdmcbr/geopandas
geopandas/io/tests/test_infer_schema.py
2
8015
from collections import OrderedDict from shapely.geometry import ( LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, ) import pandas as pd import numpy as np from geopandas import GeoDataFrame from geopandas.io.file import infer_schema # Credit: Polygons below come from M...
bsd-3-clause
zrhans/pythonanywhere
w3/bns/bns.py
1
14997
#!/usr/bin/python3 #-*- coding:utf-8 -*- """ Created on Sat May 30 14:34:56 2015 @author: hans """ import os import subprocess import pandas as pd import matplotlib matplotlib.use('Agg') #matplotlib.rcParams['font.family'] = 'sans-serif' #matplotlib.rcParams['font.sans-serif'] = ['Tahoma']#,'Bitstream Vera Sans','Lu...
apache-2.0
jorge2703/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
228
11221
from bz2 import BZ2File import gzip from io import BytesIO import numpy as np import os import shutil from tempfile import NamedTemporaryFile from sklearn.externals.six import b from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert...
bsd-3-clause
CellModels/tyssue
tyssue/particles/point_cloud.py
2
10119
"""Utilities to generate point clouds The positions of the points are generated along the architecture of the epithelium. """ from collections import abc import numpy as np import pandas as pd from ..config.subdiv import bulk_spec class EdgeSubdiv: """ Container class to ease discretisation along the edges ...
gpl-2.0
madjelan/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
alimuldal/numpy
numpy/core/code_generators/ufunc_docstrings.py
9
90842
""" 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
feiyanzhandui/tware
vizdom/server.py
2
5144
#!/usr/bin/python import json import pandas as pd import traceback import uuid from BaseHTTPServer import BaseHTTPRequestHandler from BaseHTTPServer import HTTPServer from csv import DictReader from cache import Cache from executor import BasicExecutor from util import Timer icd9s = [('infectious',1,140), ('...
apache-2.0
bcimontreal/bci_workshop
python/lsl-viewer.py
1
6793
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from scipy.signal import butter, lfilter, lfilter_zi, firwin from time import sleep from pylsl import StreamInlet, resolve_byprop from optparse import OptionParser import seaborn as sns from threading import Thread sns.set(style="whitegrid") par...
mit
TomAugspurger/pandas
pandas/core/internals/construction.py
1
23734
""" Functions for preparing various inputs passed to the DataFrame or Series constructors before passing them to a BlockManager. """ from collections import abc from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Tuple, Union import numpy as np import numpy.ma as ma from pandas._libs import lib fro...
bsd-3-clause
arokem/scipy
scipy/linalg/basic.py
2
56439
# # Author: Pearu Peterson, March 2002 # # w/ additions by Travis Oliphant, March 2002 # and Jake Vanderplas, August 2012 from __future__ import division, print_function, absolute_import from warnings import warn import numpy as np from numpy import atleast_1d, atleast_2d from .flinalg import get_flinalg...
bsd-3-clause
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/sklearn/linear_model/bayes.py
50
16145
""" Various bayesian regression """ from __future__ import print_function # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from .base import LinearModel from ..base import RegressorMixin from ..utils.extmath import fast_logdet, p...
mit
pratapvardhan/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
themrmax/scikit-learn
sklearn/tree/tree.py
11
50091
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Da...
bsd-3-clause
jamestwebber/scipy
scipy/interpolate/ndgriddata.py
2
7566
""" Convenience interface to N-D interpolation .. versionadded:: 0.9 """ from __future__ import division, print_function, absolute_import import numpy as np from .interpnd import LinearNDInterpolator, NDInterpolatorBase, \ CloughTocher2DInterpolator, _ndim_coords_from_arrays from scipy.spatial import cKDTree _...
bsd-3-clause
RuthAngus/K2rotation
plots/raw_and_vbg.py
1
3921
import numpy as np import matplotlib.pyplot as plt from gatspy.periodic import LombScargle import fitsio import time def raw_and_vbg(): plotpar = {'axes.labelsize': 12, 'text.fontsize': 18, 'legend.fontsize': 18, 'xtick.labelsize': 14, 'ytick.labelsize'...
mit
mmilutinovic1313/zipline-with-algorithms
zipline/history/history_container.py
18
33931
# # Copyright 2014 Quantopian, 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 wr...
apache-2.0
aalmah/pylearn2
pylearn2/cross_validation/dataset_iterators.py
29
19389
""" Cross-validation dataset iterators. """ __author__ = "Steven Kearnes" __copyright__ = "Copyright 2014, Stanford University" __license__ = "3-clause BSD" import numpy as np import warnings try: from sklearn.cross_validation import (KFold, StratifiedKFold, ShuffleSplit, ...
bsd-3-clause
diharaw/EmoLib
scripts/preprocess/4_trim.py
1
3138
from __future__ import division import pickle import pandas as pd import numpy as np import librosa import matplotlib.pyplot as plt import thinkdsp import thinkplot import os import sys import glob import shutil from itertools import compress from itertools import compress from collections import Counter from pydub imp...
mit
KNMI/VERCE
verce-hpc-pe/src/test/rtxcorr/rtxcorr3.py
2
28286
from dispel4py.workflow_graph import WorkflowGraph from dispel4py.provenance import * from dispel4py.new.processor import * import time import random import numpy import traceback from dispel4py.base import create_iterative_chain, GenericPE, ConsumerPE, IterativePE, SimpleFunctionPE from dispel4py.new.simple_process i...
mit
Robak23/forex_deep
Final/LSTM_model.py
1
2901
# coding: utf-8 # In[1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import functions as f import os import sys nb_dir = os.getcwd() if nb_dir not in sys.path: sys.path.append(nb_dir) # In[2]: data = pd.read_csv("data/EURUSD_daily.csv", index_col='Date') data.index = pd.to_datet...
gpl-3.0
china-quant/backtrader
backtrader/plot/plot.py
1
24966
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
gpl-3.0
aborovin/trading-with-python
lib/extra.py
77
2540
''' Created on Apr 28, 2013 Copyright: Jev Kuznetsov License: BSD ''' from __future__ import print_function import sys import urllib import os import xlrd # module for excel file reading import pandas as pd class ProgressBar: def __init__(self, iterations): self.iterations = iterations ...
bsd-3-clause
eusoubrasileiro/fatiando_seismic
fatiando/seismic/utils.py
1
4028
r""" Tools for seismic processing **Auxiliary functions** * :func:`~fatiando.seismic.utils.vrms`: Calculate RMS velocity from interval thickness and velocity (horizontally layered model) * :func:`~fatiando.seismic.utils.nmo`: Apply nmo correction on a CMP gather * :func:`~fatiando.seismic.utils.plot_vnmo`: Draw nmo...
bsd-3-clause
eranchetz/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/__init__.py
72
2225
import matplotlib import inspect import warnings # ipython relies on interactive_bk being defined here from matplotlib.rcsetup import interactive_bk __all__ = ['backend','show','draw_if_interactive', 'new_figure_manager', 'backend_version'] backend = matplotlib.get_backend() # validates, to match all_bac...
agpl-3.0
sgenoud/scikit-learn
examples/plot_permutation_test_for_classification.py
5
2319
""" ================================================================= Test with permutations the significance of a classification score ================================================================= In order to test if a classification score is significative a technique in repeating the classification procedure aft...
bsd-3-clause
toddheitmann/PetroPy
examples/wolfcamp_bulk.py
1
8772
""" ========================================= Wolfcamp Example - Bulk Process las files ========================================= This example shows the full petrophysical workflow avaiable in PetroPy for a folder of wolfcamp las file courtesy of University Lands Texas. The workflow progresses in 3 iterations to edit...
mit
oscarxie/tushare
tushare/datayes/basics.py
14
3722
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Created on 2015年7月4日 @author: JimmyLiu @QQ:52799046 """ from tushare.datayes import vars as vs import pandas as pd from pandas.compat import StringIO class Basics(): def __init__(self , client): self.client = client def dy_master_secID(self, tick...
bsd-3-clause
deepfield/ibis
ibis/sql/postgres/tests/test_client.py
1
3736
# 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
flightgong/scikit-learn
sklearn/feature_selection/tests/test_rfe.py
3
3357
""" Testing Recursive feature elimination """ import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_equal from scipy import sparse from sklearn.feature_selection.rfe import RFE, RFECV from sklearn.datasets import load_iris from sklearn.metrics import ...
bsd-3-clause
pllim/astropy
examples/io/plot_fits-image.py
11
1898
# -*- coding: utf-8 -*- """ ======================================= Read and plot an image from a FITS file ======================================= This example opens an image stored in a FITS file and displays it to the screen. This example uses `astropy.utils.data` to download the file, `astropy.io.fits` to open th...
bsd-3-clause
sho-87/python-machine-learning
Linear Regression/multiple_regression.py
1
1719
# Basic OLS regression using base python (and numpy) import numpy as np import matplotlib.pyplot as plt # Load data dataset = np.genfromtxt('../data/regression_heart.csv', delimiter=",") x = dataset[:,1:] y = dataset[:,0] y = np.reshape(y, (y.shape[0],1)) # Reshape to a column vector # Scale (standardize) data for...
mit
ishank08/scikit-learn
sklearn/linear_model/bayes.py
14
19671
""" Various bayesian regression """ from __future__ import print_function # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from .base import LinearModel from ..base import RegressorMixin from ..utils.extmath import fast_logdet, p...
bsd-3-clause
satiros12/MUIA
META/GS/META2.py
1
13340
import numpy as np import matplotlib.pyplot as plt %matplotlib inline import SA import time import matplotlib.pylab as pylab pylab.rcParams['figure.figsize'] = (16.0, 10.0) import itertools #Default maximization class SimulatedAnnealing: def __init__(self): self.T_initial, self.T_final, self.K_steps, sel...
apache-2.0
sappo/simindex
tests/test_engine.py
1
9171
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_simindex ---------------------------------- Tests for `simindex` module. """ import os import pytest from pprint import pprint import tempfile import pandas as pd from .testprofiler import profile from .testdata import restaurant_records import simindex.helper...
mpl-2.0
toobaz/pandas
pandas/tests/sparse/test_combine_concat.py
1
18880
import itertools import numpy as np import pytest from pandas.errors import PerformanceWarning import pandas as pd import pandas.util.testing as tm class TestSparseArrayConcat: @pytest.mark.parametrize("kind", ["integer", "block"]) def test_basic(self, kind): a = pd.SparseArray([1, 0, 0, 2], kind=k...
bsd-3-clause
ShapeNet/JointEmbedding
src/image_embedding_testing/prepare_testing.py
1
1733
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import shutil import argparse import fileinput #https://github.com/BVLC/caffe/issues/861#issuecomment-70124809 import matplotlib matplotlib.use('Agg') BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(BASE_DIR)) from ...
bsd-3-clause
bmazin/SDR
Projects/BestBeammap/palDiff.py
1
1891
#!/bin/python import numpy as np import matplotlib.pyplot as plt import matplotlib def getList(file): posList= np.recfromtxt(file) l = [posList['f0'],posList['f2'],posList['f3']] l = np.array(l) l = l.T names = posList['f4'] return l,names left,leftNames = getList('freq_atten_x_y_palleft.txt')...
gpl-2.0
mwiebe/numpy
numpy/lib/npyio.py
35
71412
from __future__ import division, absolute_import, print_function import sys import os import re import itertools import warnings import weakref from operator import itemgetter import numpy as np from . import format from ._datasource import DataSource from numpy.core.multiarray import packbits, unpackbits from ._ioto...
bsd-3-clause
sunk/spacetime
nips_exp.py
1
11758
#!/usr/bin/env python from __future__ import print_function import dist2, spacetime import numpy as np import scipy.io import os, sys, itertools EPS = np.finfo( float ).eps def __rebuild( data_file, bin_file, num_vols, dtype, binary ): ''' parse the raw data in data_file and store the co-authorship m...
bsd-2-clause
enigmampc/catalyst
catalyst/data/treasuries_can.py
15
5257
# # Copyright 2013 Quantopian, 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 wr...
apache-2.0
quiltdata/quilt
api/python/quilt3/bucket.py
1
6293
""" bucket.py Contains the Bucket class, which provides several useful functions over an s3 bucket. """ import pathlib from .data_transfer import ( copy_file, delete_object, list_object_versions, list_objects, select, ) from .search_util import search_api from .util import PhysicalKey, QuiltEx...
apache-2.0
zohannn/motion_manager
scripts/old/task_2_reaching/var_1/predicting_task_2_var_1_10k.py
2
138480
#!/usr/bin/env python3 import sys import pandas as pd from sklearn import decomposition from sklearn import metrics from sklearn.externals import joblib import matplotlib.pyplot as plt import tensorflow as tf import numpy as np import math from random import randint # HUPL from HUPL.learner import preprocess_featur...
mit
Adai0808/BuildingMachineLearningSystemsWithPython
ch09/01_fft_based_classifier.py
24
3740
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import numpy as np from collections import defaultdict from sklearn.metrics import precision_recall_cu...
mit
idlead/scikit-learn
sklearn/datasets/mlcomp.py
289
3855
# Copyright (c) 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause """Glue code to load http://mlcomp.org data as a scikit.learn dataset""" import os import numbers from sklearn.datasets.base import load_files def _load_document_classification(dataset_path, metadata, set_=None, **kwargs): if ...
bsd-3-clause
baptistelabat/kiteEnergySimulator
Carousel/Carousel.py
1
3554
#!/usr/bin/env python # -*- coding: utf8 -*- # Licensed under the MIT License, # https://github.com/baptistelabat/kiteEnergySimulator # @author: Charles Spraul # Created on Fri Mar 14 16:04:44 2014 from scipy.optimize import minimize_scalar import matplotlib.pyplot as plt import numpy as np from numpy import...
mit
wavelets/lifelines
tests/test_plotting.py
3
7586
from __future__ import print_function import os import pytest import numpy as np from lifelines.estimation import NelsonAalenFitter, KaplanMeierFitter, AalenAdditiveFitter from lifelines.generate_datasets import generate_random_lifetimes, generate_hazard_rates from lifelines.plotting import plot_lifetimes @pytest.ma...
mit
vivekmishra1991/scikit-learn
sklearn/manifold/tests/test_t_sne.py
53
21055
import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import scipy.sparse as sp from sklearn.neighbors import BallTree from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal fr...
bsd-3-clause
toastedcornflakes/scikit-learn
sklearn/cluster/tests/test_dbscan.py
176
12155
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from scipy.spatial import distance from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing im...
bsd-3-clause
Gillu13/scipy
doc/source/tutorial/stats/plots/kde_plot4.py
142
1457
from functools import partial import numpy as np from scipy import stats import matplotlib.pyplot as plt def my_kde_bandwidth(obj, fac=1./5): """We use Scott's Rule, multiplied by a constant factor.""" return np.power(obj.n, -1./(obj.d+4)) * fac loc1, scale1, size1 = (-2, 1, 175) loc2, scale2, size2 = (2, ...
bsd-3-clause
antiface/mne-python
examples/preprocessing/plot_resample.py
12
3364
""" =============== Resampling data =============== When performing experiments where timing is critical, a signal with a high sampling rate is desired. However, having a signal with a much higher sampling rate than is necessary needlessly consumes memory and slows down computations operating on the data. This exampl...
bsd-3-clause
glemaitre/UnbalancedDataset
examples/combine/plot_comparison_combine.py
2
4390
""" ==================================================================== Comparison of the combination of over- and under-sampling algorithms ==================================================================== This example shows the effect of applying an under-sampling algorithms after SMOTE over-sampling. In the lit...
mit
jerryjiahaha/rts2
python/rts2/gpoint.py
3
52726
# g(pl)-Point - GPLed Telescope pointing model fit, as described in paper by Marc Buie: # # ftp://ftp.lowell.edu/pub/buie/idl/pointing/pointing.pdf # # (C) 2015-2016 Petr Kubanek <petr@kubanek.net> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public Li...
lgpl-3.0
oemof/oemof_examples
oemof_examples/oemof.solph/v0.3.x/simple_dispatch/simple_dispatch.py
2
6730
# -*- coding: utf-8 -*- """ General description ------------------- This example shows how to create an energysystem with oemof objects and solve it with the solph module. Results are plotted with outputlib. Dispatch modelling is a typical thing to do with solph. However cost does not have to be monetary but can be e...
gpl-3.0
borisz264/mono_seq
uniform_colormaps.py
28
50518
# New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt, # and (in the case of viridis) Eric Firing. # # This file and the colormaps in it are released under the CC0 license / # public domain dedication. We would appreciate credit if you use or # redistribute these colormaps, but do not impose any legal r...
mit
rajat1994/scikit-learn
examples/svm/plot_separating_hyperplane.py
294
1273
""" ========================================= SVM: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a Support Vector Machine classifier with linear kernel. """ print(__doc__) import numpy as np impor...
bsd-3-clause
Adai0808/scikit-learn
examples/calibration/plot_compare_calibration.py
241
5008
""" ======================================== Comparison of Calibration of Classifiers ======================================== Well calibrated classifiers are probabilistic classifiers for which the output of the predict_proba method can be directly interpreted as a confidence level. For instance a well calibrated (bi...
bsd-3-clause
gclenaghan/scikit-learn
examples/linear_model/plot_sgd_iris.py
286
2202
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print(__doc__) ...
bsd-3-clause