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
zachcp/qiime
qiime/make_otu_heatmap.py
15
7171
from __future__ import division __author__ = "Dan Knights" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Dan Knights", "Greg Caporaso", "Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Dan Knights" __email__ = "daniel.knights@colorado.edu" import numpy as np imp...
gpl-2.0
mne-tools/mne-python
mne/annotations.py
1
51935
# Authors: Jaakko Leppakangas <jaeilepp@student.jyu.fi> # Robert Luke <mail@robertluke.net> # # License: BSD (3-clause) from collections import OrderedDict from datetime import datetime, timedelta, timezone import os.path as op import re from copy import deepcopy from itertools import takewhile import json fr...
bsd-3-clause
jinified/selam
examples/preprocess_data.py
1
2719
#!/usr/bin/env python """ Explore different preprocessing transformation on data before training """ import cv2 import numpy as np from selam.utils import img from sklearn import pipeline from sklearn.preprocessing import MinMaxScaler, StandardScaler, scale def incrementalPreprocesser(data, method, batch_size=3): ...
mit
TNT-Samuel/Coding-Projects
DNS Server/Source/Lib/site-packages/dask/dataframe/tests/test_multi.py
2
50298
import dask.dataframe as dd import numpy as np import pandas as pd import pandas.util.testing as tm from dask.base import compute_as_if_collection from dask.dataframe.core import _Frame from dask.dataframe.methods import concat from dask.dataframe.multi import (align_partitions, merge_indexed_dataframes, ...
gpl-3.0
ashwinpathak20/ashwinpathak20.github.io
markdown_generator/publications.py
197
3887
# coding: utf-8 # # Publications markdown generator for academicpages # # Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook, with the core python code in publications.py. Run either from the `markdown_g...
mit
meee1/ardupilot
Tools/FilterTestTool/FilterTest.py
30
22307
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ArduPilot IMU Filter Test Class This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later versi...
gpl-3.0
erikness/AlephOne
zipline/examples/pairtrade.py
11
4925
#!/usr/bin/env python # # 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 ...
apache-2.0
jakobworldpeace/scikit-learn
sklearn/linear_model/tests/test_sgd.py
34
47824
import pickle import unittest import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing ...
bsd-3-clause
paulscherrerinstitute/pshell
src/main/assembly/help/Tutorial_py/5_Utils/57_EmbedingCPython.py
1
2502
################################################################################################### # Embedding CPython with JEP: USe of numpy, pandas and matpplotlib in the same process. # Requires cpython.py to be put in the scripts folder, or else in the python path. ################################################...
gpl-3.0
bpsmith/tia
tia/analysis/plots.py
1
3032
import matplotlib.pyplot as plt import pandas as pd import numpy as np from tia.analysis.perf import returns_cumulative, max_drawdown, guess_freq from tia.util.mplot import AxesFormat from tia.util.fmt import new_float_formatter def plot_return_on_dollar(rets, title='Return on $1', show_maxdd=0, figsize=None, ax=None...
bsd-3-clause
rs2/pandas
pandas/tests/frame/indexing/test_insert.py
2
2291
""" test_insert is specifically for the DataFrame.insert method; not to be confused with tests with "insert" in their names that are really testing __setitem__. """ import numpy as np import pytest from pandas import DataFrame, Index import pandas._testing as tm class TestDataFrameInsert: def test_insert(self): ...
bsd-3-clause
bbfrederick/rapidtide
rapidtide/tests/test_fullrunrapidtide_v4.py
1
1733
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016-2021 Blaise Frederick # # 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/LICEN...
apache-2.0
plotly/plotly.py
packages/python/plotly/plotly/graph_objs/table/_cells.py
1
17840
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Cells(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "table" _path_str = "table.cells" _valid_props = { "align", "alignsrc", ...
mit
ZxlAaron/mypros
python/pyspark/sql/dataframe.py
10
64367
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
AlertaDengue/InfoDenguePredict
infodenguepredict/models/rgf_model.py
2
5373
import numpy as np import matplotlib.pyplot as plt import pandas as pd import os from rgf.sklearn import RGFRegressor from sklearn.model_selection import train_test_split from sklearn.metrics import * from infodenguepredict.data.infodengue import get_cluster_data, get_city_names, build_multicity_dataset, get_alerta_t...
gpl-3.0
apeyser/nest-simulator
examples/neuronview/neuronview.py
13
10676
# -*- coding: utf-8 -*- # # neuronview.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 ...
gpl-2.0
wangmiao1981/spark
python/pyspark/sql/group.py
23
10681
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
rbalda/neural_ocr
env/lib/python2.7/site-packages/scipy/cluster/tests/test_hierarchy.py
3
37641
#! /usr/bin/env python # # Author: Damian Eads # Date: April 17, 2008 # # Copyright (C) 2008 Damian Eads # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copy...
mit
mohitganguly/IRBlock_Vanderbilt
4/mHH/make_fig.py
1
1150
from __future__ import division import numpy as np import matplotlib import matplotlib.pyplot as plt temp = [25,26,27,28,29,29.5] pas = [17575,17575,17575,17575,17575,17575] na_only = [7275,7250,7225,7200,7175,7150] k_only = [1070,980,930,910,900,875] norm = [1300,1100,1030,950,925,900] plt.plot(temp, pas, '-o', ...
gpl-3.0
PyRsw/PyRsw
src/Plot_tools/update_save_2D.py
1
3510
# Update plot objects if saving import numpy as np from smart_time import smart_time import matplotlib.pyplot as plt def update_save_2D(sim): Nx, Ny = sim.Nx, sim.Ny for var_cnt in range(len(sim.plot_vars)): var = sim.plot_vars[var_cnt] for L in range(sim.Nz): if var == 'u': ...
mit
imaculate/scikit-learn
examples/manifold/plot_swissroll.py
330
1446
""" =================================== Swiss Roll reduction with LLE =================================== An illustration of Swiss Roll reduction with locally linear embedding """ # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # License: BSD 3 clause (C) INRIA 2011 print(__doc__) import matplotlib.pyplot...
bsd-3-clause
CforED/Machine-Learning
sklearn/cross_decomposition/cca_.py
151
3192
from .pls_ import _PLS __all__ = ['CCA'] class CCA(_PLS): """CCA Canonical Correlation Analysis. CCA inherits from PLS with mode="B" and deflation_mode="canonical". Read more in the :ref:`User Guide <cross_decomposition>`. Parameters ---------- n_components : int, (default 2). numb...
bsd-3-clause
bibsian/database-development
poplerGUI/ui_logic_main.py
1
8237
from PyQt4 import QtGui, QtCore from pandas import read_sql from collections import OrderedDict, namedtuple from Views import ui_dialog_main as dmainw from poplerGUI import ui_logic_preview as tprev from poplerGUI import class_inputhandler as ini from poplerGUI import class_modelviewpandas as view from poplerGUI.logicl...
mit
yavalvas/yav_com
build/matplotlib/doc/mpl_examples/axes_grid/inset_locator_demo2.py
8
1239
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes from mpl_toolkits.axes_grid1.inset_locator import mark_inset import numpy as np def get_demo_image(): from matplotlib.cbook import get_sample_data import numpy as np f = get_sample_data("axes_grid/bivariat...
mit
dimkal/mne-python
mne/decoding/tests/test_ems.py
19
1969
# Author: Denis A. Engemann <d.engemann@gmail.com> # # License: BSD (3-clause) import os.path as op from nose.tools import assert_equal, assert_raises from mne import io, Epochs, read_events, pick_types from mne.utils import requires_sklearn from mne.decoding import compute_ems data_dir = op.join(op.dirname(__file_...
bsd-3-clause
hainm/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
farmlab/AgronoPy
agronopy/simulator/aqyield.py
1
24456
"""File File: aqyield.py Author: Jerome Dury Email: jerome.dury@flyingheep.fr Github: https://github.com/farmlab Description: http://maelia-platform.inra.fr/modeles/processus-agricoles/dynamique-sol-culture-2/dynamique-sol-culture/ Reference: Constantin, J. , Willaume, M., Murgue, C., Lacroix, B., Therond, O. (2015). ...
mit
door2door-io/gtfs-merger
tests/test_gtfsmerger.py
1
2658
from gtfsmerger import GTFSMerger import pandas as pd from pandas.util import testing as tm import numpy as np import pytest def test_gtfs_merger(gtfs_merger): assert gtfs_merger.merged['stops'].iloc[:5]['stop_id'].tolist() == [ u'0-n1502-1', u'0-n62046-1', u'0-n1520-1', u'0-n1522-...
mit
farthir/msc-project
data_processing.py
1
12356
"""Module containing classes and methods for data processing""" import copy import numpy as np import pandas as pd class ProcessingError(Exception): """Base class for exceptions in this module.""" pass class VariableTypeError(ProcessingError): """Raise error if type of variable not handled.""" pass c...
mit
UManPychron/pychron
pychron/mv/zoom/zoom.py
2
6536
# =============================================================================== # Copyright 2016 Jake Ross # # 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...
apache-2.0
simon-pepin/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
286
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
mcflugen/bmi-tutorial
examples/heat_2.py
1
1879
#! /usr/bin/env python import sys import numpy as np import matplotlib.pyplot as plt from heat_utils import solve_2d_heat_eqn, read_params_from_file class Heat(object): """Basic Model Interface for heat component""" def __init__(self): self._spacing = (1., 1.) self._alpha = 1. self....
mit
akhilpm/Masters-Project
UMKL/classifiers.py
1
1851
import numpy as np import scipy.io from scipy.io import loadmat from sklearn.cross_validation import train_test_split from sklearn.metrics import accuracy_score from sklearn.metrics import confusion_matrix import warnings import time from sklearn.neighbors import KNeighborsClassifier from sklearn.tree import DecisionT...
mit
jnarhan/Breast_Cancer
src/helper_modules/jn_bc_helper.py
1
13754
# coding: utf-8 # A package of helper functions for Neural Net processing in breast cancer detection/diagnosis # Author: Jay Narhan # Date: April-2017 import os import gc import csv import sys import time import shutil import itertools import collections import numpy as np from scipy import misc import keras.call...
mit
Reagankm/KnockKnock
venv/lib/python3.4/site-packages/mpl_toolkits/tests/test_axes_grid1.py
7
1871
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import matplotlib.pyplot as plt from matplotlib.testing.decorators import image_comparison from mpl_toolkits.axes_grid1 import make_axes_locatable import numpy as np @image_comparison(baseline_ima...
gpl-2.0
DonBeo/statsmodels
statsmodels/examples/ex_lowess.py
34
2827
# -*- coding: utf-8 -*- """ Created on Mon Oct 31 15:26:06 2011 Author: Chris Jordan Squire extracted from test suite by josef-pktd """ from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm lowess = sm.nonparametric.lowess # this is just to check dire...
bsd-3-clause
lstout/GendERC
CVs.py
1
7608
from __future__ import division, print_function import cPickle import os import re import time from collections import defaultdict from functools import partial from os import listdir import pandas as pd import requests from SPARQLWrapper import JSON, SPARQLWrapper import reader from spotlight import SpotlightExcept...
mit
pv/scikit-learn
examples/applications/plot_outlier_detection_housing.py
243
5577
""" ==================================== Outlier detection on a real data set ==================================== This example illustrates the need for robust covariance estimation on a real data set. It is useful both for outlier detection and for a better understanding of the data structure. We selected two sets o...
bsd-3-clause
pythonvietnam/scikit-learn
sklearn/linear_model/tests/test_passive_aggressive.py
169
8809
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_rais...
bsd-3-clause
huanzhang12/LightGBM
tests/python_package_test/test_plotting.py
5
4569
# coding: utf-8 # pylint: skip-file import unittest import lightgbm as lgb from sklearn.datasets import load_breast_cancer from sklearn.model_selection import train_test_split try: import matplotlib matplotlib.use('Agg') matplotlib_installed = True except ImportError: matplotlib_installed = False cl...
mit
tobbad/pydwf
digilent_samples/AnalogOutIn.py
1
1665
""" DWF Python Example translated to swig bindings Author: Tobias Badertscher based on work by Digilent, Inc. Revision: 12/31/2013 """ import sys sys.path.append('..') from pydwf import dwf import time import matplotlib.pyplot as plt import numpy as np def AnalogOutIn(): version = dwf.GetVersion() ...
lgpl-3.0
smsolivier/VEF
tex/ictt/src/mms.py
1
3266
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt import sys sys.path.append('../../code') import ld as LD import dd as DD from scipy.interpolate import interp1d from hidespines import * from R2 import * import texTools as tex ''' Test order of accuracy for LD options ''' if (len(...
mit
amerc/TCP3
chips2/examples/example_5.py
3
3116
#!/usr/bin/env python import subprocess import atexit from math import pi try: import scipy as s except ImportError: print "You need scipy to run this script!" exit(0) try: import numpy as n except ImportError: print "You need numpy to run this script!" exit(0) try: from matplotlib impor...
mit
jreback/pandas
pandas/tests/series/methods/test_nlargest.py
5
7121
""" Note: for naming purposes, most tests are title with as e.g. "test_nlargest_foo" but are implicitly also testing nsmallest_foo. """ from itertools import product import numpy as np import pytest import pandas as pd from pandas import Series import pandas._testing as tm main_dtypes = [ "datetime", "dateti...
bsd-3-clause
chetan51/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/projections/polar.py
69
20981
import math import numpy as npy import matplotlib rcParams = matplotlib.rcParams from matplotlib.artist import kwdocd from matplotlib.axes import Axes from matplotlib import cbook from matplotlib.patches import Circle from matplotlib.path import Path from matplotlib.ticker import Formatter, Locator from matplotlib.tr...
gpl-3.0
abhishekgahlot/scikit-learn
examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py
30
3909
""" ============================================== Feature agglomeration vs. univariate selection ============================================== This example compares 2 dimensionality reduction strategies: - univariate feature selection with Anova - feature agglomeration with Ward hierarchical clustering Both metho...
bsd-3-clause
ngoix/OCRF
examples/svm/plot_svm_anova.py
85
2024
""" ================================================= SVM-Anova: SVM with univariate feature selection ================================================= This example shows how to perform univariate feature selection before running a SVC (support vector classifier) to improve the classification scores. """ print(__doc_...
bsd-3-clause
mlyundin/scikit-learn
examples/model_selection/plot_train_error_vs_test_error.py
349
2577
""" ========================= Train error vs Test error ========================= Illustration of how the performance of an estimator on unseen data (test data) is not the same as the performance on training data. As the regularization increases the performance on train decreases while the performance on test is optim...
bsd-3-clause
ch3ll0v3k/scikit-learn
sklearn/utils/tests/test_murmurhash.py
261
2836
# Author: Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import numpy as np from sklearn.externals.six import b, u from sklearn.utils.murmurhash import murmurhash3_32 from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from nose.tools import assert_equa...
bsd-3-clause
MSeifert04/astropy
astropy/visualization/wcsaxes/tests/test_frame.py
11
5290
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np import matplotlib.pyplot as plt from astropy.wcs import WCS from astropy.visualization.wcsaxes import WCSAxes from astropy.visualization.wcsaxes.frame import BaseFrame from astropy.tests.image_tests import IMAGE_REFEREN...
bsd-3-clause
kostajaitachi/shogun
examples/undocumented/python_modular/graphical/preprocessor_kpca_graphical.py
26
1893
from numpy import * import matplotlib.pyplot as p import os, sys, inspect path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../tools')) if not path in sys.path: sys.path.insert(1, path) del path from generate_circle_data import circle_data cir=circle_data() number_of_points_for_circle1=42 number_of_p...
gpl-3.0
xyguo/scikit-learn
sklearn/linear_model/tests/test_sparse_coordinate_descent.py
34
9987
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_true from sklearn.utils.t...
bsd-3-clause
arjoly/scikit-learn
sklearn/linear_model/tests/test_logistic.py
3
37569
import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse import scipy from sklearn.utils.testing import assert_almost_equal 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...
bsd-3-clause
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/scipy/ndimage/io.py
9
1248
from __future__ import division, print_function, absolute_import import numpy as np _have_pil = True try: from scipy.misc.pilutil import imread as _imread except ImportError: _have_pil = False __all__ = ['imread'] # Use the implementation of `imread` in `scipy.misc.pilutil.imread`. # If it weren't for th...
mit
rjosest/WTC
Scripts/QueryingOrthanc.py
1
2915
#from urllib2 import Request, urlopen, URLError #import json # # #remote='http://54.208.95.22/' # #query='patients' # #request = Request(remote+query) # #try: # response = urlopen(request) # return json.loads(response.read()) # #except URLError, e: # print 'No patient', e import requests import pandas as pd ...
bsd-3-clause
nelson-liu/scikit-learn
examples/model_selection/plot_roc_crossval.py
21
3477
""" ============================================================= Receiver Operating Characteristic (ROC) with cross validation ============================================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality using cross-validation. ROC curv...
bsd-3-clause
herilalaina/scikit-learn
sklearn/cluster/spectral.py
7
19261
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
bsd-3-clause
Batch21/pywr
tests/test_agg_constraints.py
1
7631
from pywr.core import Model, Input, Output, Link, Storage, AggregatedNode, PiecewiseLink, MultiSplitLink from pywr.parameters import ConstantParameter import pytest from numpy.testing import assert_allclose import pandas from pandas import Timestamp from helpers import load_model @pytest.fixture def model(solver): ...
gpl-3.0
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/mpl_examples/axes_grid/demo_axes_rgb.py
8
1876
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.axes_rgb import make_rgb_axes, RGBAxes def get_demo_image(): from matplotlib.cbook import get_sample_data f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False) z = np.load(f) # z is a numpy array of 15x15 ...
gpl-2.0
cngo-github/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/offsetbox.py
69
17728
""" The OffsetBox is a simple container artist. The child artist are meant to be drawn at a relative position to its parent. The [VH]Packer, DrawingArea and TextArea are derived from the OffsetBox. The [VH]Packer automatically adjust the relative postisions of their children, which should be instances of the OffsetBo...
agpl-3.0
iamkingmaker/trading-with-python
cookbook/getDataFromYahooFinance.py
77
1391
# -*- coding: utf-8 -*- """ Created on Sun Oct 16 18:37:23 2011 @author: jev """ from urllib import urlretrieve from urllib2 import urlopen from pandas import Index, DataFrame from datetime import datetime import matplotlib.pyplot as plt sDate = (2005,1,1) eDate = (2011,10,1) symbol = 'SPY' fNa...
bsd-3-clause
google/timesketch
timesketch/api/v1/resources/event.py
1
29673
# Copyright 2020 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 a...
apache-2.0
rseubert/scikit-learn
sklearn/feature_extraction/text.py
6
49520
# -*- coding: utf-8 -*- # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Lars Buitinck <L.J.Buitinck@uva.nl> # Robert Layton <robertlayton@gmail.com> # Jochen Wersdörfer <jochen@wersdoerfer.de> # Roman Sinayev <roman.sinayev@gma...
bsd-3-clause
ruthfranklin/hande
tools/dmqmc/plot_excit_dist.py
2
2290
#!/usr/bin/env python '''Plot excitation distribution from dmqmc output.''' import os import pkgutil import sys import matplotlib.pyplot as pl import argparse if not pkgutil.find_loader('pyhande'): _script_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(_script_dir, '../pyhande')...
lgpl-2.1
homeslike/OpticalTweezer
scripts/p0.3_at0.05/vCOMhistogramMass.py
27
3006
import math import sys import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab from subprocess import call from scipy.stats import norm # proc = call("ls *.dat",shell=True) # datetime = "170123_2033_" datetime = sys.argv[1]+"_" gasTempDataIn = np.genfromtxt(datetime+"gasTempData.dat",usecols...
mit
cwu2011/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py
221
5517
""" Testing for the gradient boosting loss functions and initial estimators. """ import numpy as np from numpy.testing import assert_array_equal from numpy.testing import assert_almost_equal from numpy.testing import assert_equal from nose.tools import assert_raises from sklearn.utils import check_random_state from ...
bsd-3-clause
scr4t/rep
rep/plotting.py
3
45902
""" There are different plotting backends supported: * *matplotlib* (default, de-facto standard plotting library), * *plotly* (proprietary package with interactive plots, information is kept on the server), * *ROOT* (the library used by CERN people), * *bokeh* (open-source package with interactive plot...
apache-2.0
Bismarrck/pymatgen
pymatgen/analysis/transition_state.py
3
16550
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals import os import glob import numpy as np from monty.json import jsanitize from monty.json import MSONable scipy_old_piecewisepolynomial = True try: from s...
mit
Split-Screen/android_kernel_htc_flounder
scripts/tracing/dma-api/trace.py
96
12420
"""Main program and stuff""" #from pprint import pprint from sys import stdin import os.path import re from argparse import ArgumentParser import cPickle as pickle from collections import namedtuple from plotting import plotseries, disp_pic import smmu class TracelineParser(object): """Parse the needed informatio...
gpl-2.0
olinguyen/shogun
examples/undocumented/python/graphical/regression_lars.py
11
3318
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt from shogun import RegressionLabels, RealFeatures from shogun import LeastAngleRegression, LinearRidgeRegression, LeastSquaresRegression from shogun import MeanSquaredError # we compare LASSO with ordinary least-squares (OLE) # in the ideal case, t...
gpl-3.0
jungla/ICOM-fluidity-toolbox
Detectors/offline_advection/plot_dispersion_23D.py
1
17046
#!~/python import fluidity_tools import matplotlib as mpl mpl.use('ps') import matplotlib.pyplot as plt import myfun import numpy as np from scipy import optimize import os import scipy.stats as sp import scipy import lagrangian_stats import advect_functions from scipy.interpolate import interp1d import csv def RD_t(...
gpl-2.0
ESSS/numpy
numpy/core/tests/test_multiarray.py
4
238197
from __future__ import division, absolute_import, print_function import collections import tempfile import sys import shutil import warnings import operator import io import itertools import ctypes import os if sys.version_info[0] >= 3: import builtins else: import __builtin__ as builtins from decimal import D...
bsd-3-clause
holsety/tushare
tushare/datayes/macro.py
17
191349
# -*- coding:utf-8 -*- """ 通联数据 Created on 2015/08/24 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ from pandas.compat import StringIO import pandas as pd from tushare.util import vars as vs from tushare.util.common import Client from tushare.util import upass as up class Macro(): def __...
bsd-3-clause
ismailakbudak/election-algorithm-on-graph
graph.py
1
24608
# -*- coding: utf-8 -*- # Node and graph implementation # Developer # Ismail AKBUDAK # ismailakbudak.com from matplotlib import pyplot as plt import networkx as nx import random from collections import OrderedDict import pprint pp = pprint.PrettyPrinter(indent=4) # Node objects for graph structure class Node(object)...
mit
richardotis/scipy
scipy/signal/signaltools.py
6
87532
# Author: Travis Oliphant # 1999 -- 2002 from __future__ import division, print_function, absolute_import import warnings import threading from . import sigtools from scipy._lib.six import callable from scipy._lib._version import NumpyVersion from scipy import linalg from scipy.fftpack import (fft, ifft, ifftshift, ...
bsd-3-clause
meduz/scikit-learn
sklearn/feature_selection/rfe.py
33
16667
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause """Recursive feature elimination for feature ranking""" import numpy as np from ..utils import check_X_y, safe_sqr from ..utils.metaes...
bsd-3-clause
scholer/nascent
nascent/utils/simple_system.py
2
8427
# -*- coding: utf-8 -*- ## Copyright 2015 Rasmus Scholer Sorensen, rasmusscholer@gmail.com ## ## This file is part of Nascent. ## ## Nascent 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 Foundati...
agpl-3.0
yonglehou/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
dsullivan7/scikit-learn
sklearn/__check_build/__init__.py
345
1671
""" Module to give helpful messages to the user that did not compile the scikit properly. """ import os INPLACE_MSG = """ It appears that you are importing a local scikit-learn source tree. For this, you need to have an inplace install. Maybe you are in the source directory and you need to try from another location.""...
bsd-3-clause
silburt/rebound2
examples/planetesimals2/Removed_plot.py
1
3024
#This macro plots the distribution of ejections/collisions for a given run(s). Can also compare identical runs from Swifter and my Hybrid integrator. Takes *_removed.txt as input, or the corresponding file for swifter. import sys import matplotlib.pyplot as plt import numpy as np import pylab as pl import re swifter_...
gpl-3.0
n3011/deeprl
train_cartpole.py
1
2378
import gym from tqdm import tqdm import matplotlib.pyplot as plt from core.solver_pg import VanillaPolicyGradient, tf import core.logger as log def main(): gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.8) DISPLAY = True DISPLAY_REWARD_THRESHOLD = 400 with tf.Session(config=tf.ConfigPro...
mit
wilsonqin/pandas-mint-taxes
review_transactions.py
1
1774
### DISCLAIMER: ### THIS DEMO IS DISTRIBUTED FOR EDUCATIONAL PURPOSES ONLY. IT IS NOT TAX-RELATED ADVICE OR FILING SOFTWARE. ### FOR ALL TAX-RELATED QUESTIONS AND CONCERNS PLEASE ASK A CERTIFIED ACCOUNTANT import pandas as pd # TODO: move your MINT.com transactions.csv into this project directory # / the directory wh...
mit
frank-tancf/scikit-learn
sklearn/neighbors/approximate.py
40
22369
"""Approximate nearest neighbor search""" # Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk> # Joel Nothman <joel.nothman@gmail.com> import numpy as np import warnings from scipy import sparse from .base import KNeighborsMixin, RadiusNeighborsMixin from ..base import BaseEstimator from ..utils.va...
bsd-3-clause
sgenoud/scikit-learn
sklearn/neighbors/tests/test_ball_tree.py
8
3174
import numpy as np from numpy.testing import assert_array_almost_equal from scipy.spatial import cKDTree from sklearn import neighbors # Note: simple tests of BallTree.query() and BallTree.query_radius() # are contained within the tests of test_neighbors.py rng = np.random.RandomState(0) def test_warning_flag(n_s...
bsd-3-clause
seakers/daphne_brain
AT/analysis/detectMultivariateAnomalies.py
1
3177
from rest_framework.views import APIView from rest_framework.response import Response import pandas as pd import numpy as np import json class DetectMultivariateAnomaliesThreshold (APIView): def post(self, request, format=None): method = request.data['selectedMultiVarAlgorithm'] anomalyScore =...
mit
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/pandas/core/indexes/range.py
6
21868
from sys import getsizeof import operator import numpy as np from pandas._libs import index as libindex from pandas.core.dtypes.common import ( is_integer, is_scalar, is_int64_dtype) from pandas import compat from pandas.compat import lrange, range from pandas.compat.numpy import function as nv from pand...
mit
jangorecki/h2o-3
h2o-py/tests/testdir_algos/gbm/pyunit_bernoulli_gbm.py
6
2766
from builtins import range import sys, os sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils import numpy as np from sklearn import ensemble from sklearn.metrics import roc_auc_score from h2o.estimators.gbm import H2OGradientBoostingEstimator def bernoulli_gbm(): #Log.info("I...
apache-2.0
ThomasMiconi/htmresearch
projects/poolingCapacity/layer2_capacity.py
3
16286
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
florentchandelier/zipline
zipline/utils/calendars/exchange_calendar_cme.py
7
3143
# # Copyright 2016 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
dwhswenson/openpathsampling
openpathsampling/tests/test_shooting_point_analysis.py
2
12078
from __future__ import division from __future__ import absolute_import from builtins import zip from builtins import range from past.utils import old_div from builtins import object from nose.tools import (assert_equal, raises, assert_almost_equal, assert_true, assert_in) from numpy.testing impo...
mit
jinzishuai/learn2deeplearn
deeplearning.ai/C1.NN_DL/week3/week3.py
1
30275
#!/usr/bin/python3 # coding: utf-8 # # Planar data classification with one hidden layer # # Welcome to your week 3 programming assignment. It's time to build your first neural network, which will have a hidden layer. You will see a big difference between this model and the one you implemented using logistic regressio...
gpl-3.0
rseubert/scikit-learn
sklearn/feature_selection/tests/test_feature_select.py
3
22744
""" Todo: cross-check the F-value with stats model """ import itertools import numpy as np from scipy import stats, sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_true ...
bsd-3-clause
barentsen/dave
susanplay/thrusterMatchup.py
1
3128
# -*- coding: utf-8 -*- """ Created on Mon Mar 7 09:36:25 2016 @author: smullall """ import dave.susanplay.mainSusan as mS import dave.pipeline.pipeline as pipe import dave.pipeline.main as main import numpy as np #import dave.pipeline.plotting as pp import matplotlib.pyplot as plt import dave.susanplay.sueplotting ...
mit
zhuango/python
machine-learning-algorithms/mlalg/EM/twoDimGaussian3D.py
2
1095
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def multivariateDensity(x, mu, sigma): d = mu.shape[0] density = 1.0 / ((2.0*np.pi) ** (d / 2.0)) density *= 1 / (np.linalg.det(sigma) ** 0.5) dur = x - mu density *= np.exp(-0.5 * np.dot(np.dot(du...
gpl-2.0
perpetua1/django-pandas
runtests.py
3
1374
#!/usr/bin/env python import os import sys import django from django.conf import settings if not settings.configured: settings_dict = dict( INSTALLED_APPS=( 'django.contrib.contenttypes', 'django_pandas', 'django_pandas.tests', ), DATABASES={ ...
bsd-3-clause
dcprojects/CoolProp
wrappers/Python/CoolProp/Plots/SimpleCycles.py
3
26676
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import matplotlib, warnings import numpy as np import CoolProp from CoolProp.CoolProp import PropsSI from CoolProp.Plots.Common import BasePlot, PropertyDict, SIunits def SimpleCycle(Ref,Te,Tc,DTsh,DTsc,eta_a,Ts_Ph='Ph',**kw...
mit
kaichogami/scikit-learn
sklearn/decomposition/tests/test_dict_learning.py
67
9084
import numpy as np from sklearn.utils import check_array from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklea...
bsd-3-clause
surgebiswas/poker
PokerBots_2017/Johnny/scipy/optimize/_lsq/least_squares.py
22
36536
"""Generic interface for least-square minimization.""" from __future__ import division, print_function, absolute_import from warnings import warn import numpy as np from numpy.linalg import norm from scipy.sparse import issparse, csr_matrix from scipy.sparse.linalg import LinearOperator from scipy.optimize import _m...
mit
TiKeil/Master-thesis-LOD
python_files/generate_figures/7.1_Refinement.py
1
2195
# This file is part of the master thesis "Variational crimes in the Localized orthogonal decomposition method": # https://github.com/TiKeil/Masterthesis-LOD.git # Copyright holder: Tim Keil # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) import numpy as np import matplotlib.pyplot as ...
apache-2.0
dsquareindia/scikit-learn
sklearn/ensemble/tests/test_forest.py
19
41737
""" Testing for the forest module (sklearn.ensemble.forest). """ # Authors: Gilles Louppe, # Brian Holt, # Andreas Mueller, # Arnaud Joly # License: BSD 3 clause import pickle from collections import defaultdict from itertools import combinations from itertools import product import numpy ...
bsd-3-clause