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
jswanljung/iris
docs/iris/example_code/Meteorology/hovmoller.py
6
1622
""" Hovmoller diagram of monthly surface temperature ================================================ This example demonstrates the creation of a Hovmoller diagram with fine control over plot ticks and labels. The data comes from the Met Office OSTIA project and has been pre-processed to calculate the monthly mean sea...
lgpl-3.0
bderembl/mitgcm_configs
eddy_iwave/analysis/azimuthal_average.py
1
9428
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import matplotlib import scipy.interpolate as spint import scipy.spatial.qhull as qhull import itertools import MITgcmutils as mit import f90nml plt.ion() def interp_weights(xyz, uvw): naux,d = xyz.shape tri = qhull.Delaunay(xyz) ...
mit
cuttlefishh/papers
red-sea-single-cell-genomes/code/make_rarefaction_plots_tara.py
1
11809
#!/usr/bin/env python import click import numpy as np import pandas as pd import random import math import matplotlib.pyplot as plt # Function: Randomize columns order of pandas DataFrame def randomize_df_column_order(df): cols = df.columns.tolist() np.random.shuffle(cols) df_copy = df[cols] return d...
mit
phoebe-project/phoebe2-docs
2.0/tutorials/RV.py
1
5401
#!/usr/bin/env python # coding: utf-8 # 'rv' Datasets and Options # ============================ # # Setup # ----------------------------- # Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to t...
gpl-3.0
dpaiton/OpenPV
pv-core/analysis/python/plot_fourier_kcluster.py
1
20158
""" Plots the k-means clustering """ import sys import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab import matplotlib.cm as cm import PVReadWeights as rw import PVConversions as conv import scipy.cluster.vq as sp import math import radialProfile import pylab as py if len(sys.argv) < 3: ...
epl-1.0
CagataySonmez/EdgeCloudSim
scripts/sample_app5/ai_trainer/data_convertor.py
1
5014
import pandas as pd import json import sys if len (sys.argv) != 5: print('invalid arguments. Usage:') print('python data_conventor.py config.json [edge|cloud_rsu|cloud_gsm] [classifier|regression] [train|test]') sys.exit(1) with open(sys.argv[1]) as json_data_file: data = json.load(json_data_file)...
gpl-3.0
jwi078/incubator-airflow
airflow/hooks/presto_hook.py
1
2964
from builtins import str from pyhive import presto from pyhive.exc import DatabaseError from airflow.hooks.dbapi_hook import DbApiHook import logging logging.getLogger("pyhive").setLevel(logging.INFO) class PrestoException(Exception): pass class PrestoHook(DbApiHook): """ Interact with Presto through ...
apache-2.0
herberthudson/pynance
pynance/opt/price.py
2
7070
""" .. Copyright (c) 2014, 2015 Marshall Farrier license http://opensource.org/licenses/MIT Options - price (:mod:`pynance.opt.price`) ================================================== .. currentmodule:: pynance.opt.price """ from __future__ import absolute_import import pandas as pd from ._common import _getp...
mit
molpopgen/pylibseq
docs/conf.py
2
9974
# -*- coding: utf-8 -*- # # pylibseq documentation build configuration file, created by # sphinx-quickstart on Mon Oct 19 19:11:29 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
gpl-3.0
kaiseu/pat-data-processing
component/cpu.py
1
2039
#!/usr/bin/python # encoding: utf-8 """ @author: xuk1 @license: (C) Copyright 2013-2017 @contact: kai.a.xu@intel.com @file: cpu.py @time: 8/15/2017 10:50 @desc: """ import numpy as np import pandas as pd from component import base class Cpu(base.CommonBase): """ Node CPU attribute, p...
apache-2.0
mrshu/scikit-learn
examples/applications/plot_tomography_l1_reconstruction.py
4
5464
""" ====================================================================== Compressive sensing: tomography reconstruction with L1 prior (Lasso) ====================================================================== This example shows the reconstruction of an image from a set of parallel projections, acquired along dif...
bsd-3-clause
aborovin/trading-with-python
lib/csvDatabase.py
77
6045
# -*- coding: utf-8 -*- """ intraday data handlers in csv format. @author: jev """ from __future__ import division import pandas as pd import datetime as dt import os from extra import ProgressBar dateFormat = "%Y%m%d" # date format for converting filenames to dates dateTimeFormat = "%Y%m%d %H:%M:%S"...
bsd-3-clause
mbonsma/phageParser
populate.py
3
6935
#!/usr/bin/env python import argparse import os import pickle import pandas import requests from Bio import Entrez, SeqIO from lxml import html, etree from tqdm import tqdm os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'phageAPI.settings') import django django.setup() from util.acc import read_accession_file fro...
mit
massmutual/scikit-learn
sklearn/cluster/spectral.py
233
18153
# -*- 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
ortylp/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
huzq/scikit-learn
examples/neighbors/plot_nca_dim_reduction.py
24
3839
""" ============================================================== Dimensionality Reduction with Neighborhood Components Analysis ============================================================== Sample usage of Neighborhood Components Analysis for dimensionality reduction. This example compares different (linear) dimen...
bsd-3-clause
tcmoore3/mdtraj
mdtraj/tests/test_topology.py
5
8412
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2014 Stanford University and the Authors # # Authors: Kyle A. Beauchamp # Contributors: Robert McGibbon, Matthew Har...
lgpl-2.1
costypetrisor/scikit-learn
sklearn/metrics/ranking.py
5
24965
"""Metrics to assess performance on classification task given scores Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria....
bsd-3-clause
camsas/qjump-nsdi15-plotting
figure1c_3c/plot_naiad_latency_cdfs.py
2
7009
# Copyright (c) 2015, Malte Schwarzkopf # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and...
bsd-3-clause
zaxtax/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
CarterBain/AlephNull
alephnull/transforms/batch_transform.py
1
16947
# # 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
ntbrewer/DAQ_1
kick-u3/KickPlot.py
1
4859
#!/usr/bin/python3 # /bin/python3 # ##################################################### # This script makes plots of the mtc cycle # written to the labjack outputs for control and monitoring. # This script can be used anywhere by changing the # location of the python3 directive after #!. # usage: ./KickPlot.py and u...
gpl-3.0
henridwyer/scikit-learn
sklearn/manifold/tests/test_mds.py
324
1862
import numpy as np from numpy.testing import assert_array_almost_equal from nose.tools import assert_raises from sklearn.manifold import mds def test_smacof(): # test metric smacof using the data of "Modern Multidimensional Scaling", # Borg & Groenen, p 154 sim = np.array([[0, 5, 3, 4], ...
bsd-3-clause
wclark3/machine-learning
final-project/md_sandbox/main.py
1
3481
#!/usr/bin/env python import abc import operator import time import lasagne import numpy as np import theano import theano.tensor as T from sklearn.metrics import confusion_matrix import fileio import perceptron # class Batch: # def __init__(self, batchsize, shuffle): # self.batchsize = batchsize # self.shuffle...
mit
crichardson17/starburst_atlas
HighResSims/Old/Baseline_Dusty_supersolar_5solar_cutat17/Baseline_plotter.py
1
12649
############################################################ ############# Plotting File for Contour Plots ############## ################## Data read from Cloudy ################### ################ Helen Meskhidze, Fall 2015 ################ #################### Elon University ####################### #--------------...
gpl-2.0
aetilley/scikit-learn
sklearn/tests/test_naive_bayes.py
142
17496
import pickle from io import BytesIO import numpy as np import scipy.sparse from sklearn.datasets import load_digits, load_iris from sklearn.cross_validation import cross_val_score, train_test_split from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_almost_equal from sklearn.utils.te...
bsd-3-clause
ch3ll0v3k/scikit-learn
examples/datasets/plot_random_multilabel_dataset.py
93
3460
""" ============================================== Plot randomly generated multilabel dataset ============================================== This illustrates the `datasets.make_multilabel_classification` dataset generator. Each sample consists of counts of two features (up to 50 in total), which are differently distri...
bsd-3-clause
Tjorriemorrie/trading
09_scalping/features.py
2
11161
import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.cross_validation import cross_val_score import sklearn as sk import operator from pprint import pprint class FeatureFactory(): def ema(self, s, n): """ returns an n period exponential moving average for...
mit
adammenges/statsmodels
statsmodels/datasets/elnino/data.py
25
1779
"""El Nino dataset, 1950 - 2010""" __docformat__ = 'restructuredtext' COPYRIGHT = """This data is in the public domain.""" TITLE = """El Nino - Sea Surface Temperatures""" SOURCE = """ National Oceanic and Atmospheric Administration's National Weather Service ERSST.V3B dataset, Nino 1+2 http://www.cpc...
bsd-3-clause
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/examples/pylab_examples/fancyarrow_demo.py
12
1386
import matplotlib.patches as mpatches import matplotlib.pyplot as plt styles = mpatches.ArrowStyle.get_styles() ncol=2 nrow = (len(styles)+1) // ncol figheight = (nrow+0.5) fig1 = plt.figure(1, (4.*ncol/1.5, figheight/1.5)) fontsize = 0.2 * 70 ax = fig1.add_axes([0, 0, 1, 1], frameon=False, aspect=1.) ax.set_xlim(...
mit
jasonabele/gnuradio
gr-msdd6000/src/python-examples/msdd_spectrum_sense.py
8
10553
#!/usr/bin/env python # # Copyright 2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) ...
gpl-3.0
raghavrv/scikit-learn
sklearn/datasets/samples_generator.py
8
56767
""" Generate samples of synthetic data sets. """ # Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel, # G. Louppe, J. Nothman # License: BSD 3 clause import numbers import array import numpy as np from scipy import linalg import scipy.sparse as sp from ..preprocessing import MultiLabelBin...
bsd-3-clause
awanke/bokeh
examples/glyphs/trail.py
33
4656
# -*- coding: utf-8 -*- from __future__ import print_function from math import sin, cos, atan2, sqrt, radians import numpy as np import scipy.ndimage as im from bokeh.document import Document from bokeh.embed import file_html from bokeh.resources import INLINE from bokeh.browserlib import view from bokeh.models.gl...
bsd-3-clause
hugobowne/scikit-learn
examples/ensemble/plot_bias_variance.py
357
7324
""" ============================================================ Single estimator versus bagging: bias-variance decomposition ============================================================ This example illustrates and compares the bias-variance decomposition of the expected mean squared error of a single estimator again...
bsd-3-clause
larsmans/scikit-learn
examples/svm/plot_svm_nonlinear.py
61
1089
""" ============== Non-linear SVM ============== Perform binary classification using non-linear SVC with RBF kernel. The target to predict is a XOR of the inputs. The color map illustrates the decision function learn by the SVC. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn impor...
bsd-3-clause
eg-zhang/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
jgphpc/linux
slurm/crayvis/crayvis_pmessmer.py
1
4263
#!/usr/bin/env python3 # Thanks goes to Peter Messmer at NVIDIA # mll daint-gpu PyExtensions/3.6.1.1-CrayGNU-17.08 # https://github.com/eth-cscs/pyfr/issues/11 # Gray are the compute nodes # Yellow the service nodes # Blue the nodes allocated in the run # Red the failed node import matplotlib.pyplot...
gpl-2.0
ronojoy/BDA_py_demos
demos_ch6/demo6_2.py
19
1366
"""Bayesian Data Analysis, 3rd ed Chapter 6, demo 2 Posterior predictive checking Binomial example - Testing sequential dependence example """ from __future__ import division import numpy as np import matplotlib.pyplot as plt # edit default plot settings (colours from colorbrewer2.org) plt.rc('font', size=14) plt.r...
gpl-3.0
JingheZ/shogun
applications/tapkee/faces_embedding.py
26
2078
#!/usr/bin/env python # 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 version. # # Written (W) 2011 Sergey Lisitsyn # Copyright ...
gpl-3.0
AIML/scikit-learn
examples/model_selection/randomized_search.py
201
3214
""" ========================================================================= Comparing randomized search and grid search for hyperparameter estimation ========================================================================= Compare randomized search and grid search for optimizing hyperparameters of a random forest. ...
bsd-3-clause
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/numpy-1.9.2/numpy/lib/function_base.py
30
124613
from __future__ import division, absolute_import, print_function import warnings import sys import collections import operator import numpy as np import numpy.core.numeric as _nx from numpy.core import linspace, atleast_1d, atleast_2d from numpy.core.numeric import ( ones, zeros, arange, concatenate, array, asarr...
mit
cdegroc/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
rubind/SimpleBayesJLA
plot_cosmo.py
1
2375
import numpy as np import matplotlib.pyplot as plt from scipy.stats import gaussian_kde import pickle from IPython import embed plt.rcParams["font.family"] = "serif" def reflect(samps, othersamps = None, reflect_cut = 0.2): the_min = min(samps) the_max = max(samps) inds = np.where((samps < the_min*(1. - r...
mit
aminert/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
idbedead/RNA-sequence-tools
make_geo_list2.py
2
2850
import os import pandas as pd import shutil import sys import hashlib def md5(fname): hash_md5 = hashlib.md5() with open(fname, "rb") as f: for chunk in iter(lambda: f.read(4096), b""): hash_md5.update(chunk) return hash_md5.hexdigest() pats = ['/Volumes/Seq_data/09142015_BU3_ips17_ra...
mit
jreback/pandas
pandas/compat/pickle_compat.py
1
7903
""" Support pre-0.12 series pickle compatibility. """ import contextlib import copy import io import pickle as pkl from typing import TYPE_CHECKING, Optional import warnings from pandas._libs.tslibs import BaseOffset from pandas import Index if TYPE_CHECKING: from pandas import DataFrame, Series def load_redu...
bsd-3-clause
Elarnon/mangaki
mangaki/mangaki/utils/svd.py
2
5410
from django.contrib.auth.models import User from mangaki.models import Rating, Work, Recommendation from mangaki.utils.chrono import Chrono from mangaki.utils.values import rating_values from scipy.sparse import lil_matrix from sklearn.utils.extmath import randomized_svd import numpy as np from django.db import connect...
agpl-3.0
JeanKossaifi/scikit-learn
examples/gaussian_process/gp_diabetes_dataset.py
223
1976
#!/usr/bin/python # -*- coding: utf-8 -*- """ ======================================================================== Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset ======================================================================== In this example, we fit a Gaussian Process model onto...
bsd-3-clause
berkeley-stat159/project-zeta
code/linear_model_scripts_sub4.py
3
25730
# Goal for this scripts: # # Perform linear regression and analyze the similarity in terms of the activated brain area when recognizing different # objects in odd and even runs of subject 1 # Load required function and modules: from __future__ import print_function, division import numpy as np import numpy.linalg as ...
bsd-3-clause
stwunsch/gnuradio
gr-utils/python/utils/plot_data.py
59
5818
# # Copyright 2007,2008,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later ve...
gpl-3.0
dustinbcox/biodatalogger
biodata_grapher.py
1
1356
#!/usr/bin/python2.7 """ Biodata_grapher 2015-08-30 """ import glob import csv import os import matplotlib.pyplot as plt import matplotlib from datetime import datetime import traceback for filename in glob.glob('*_biodatalogger_readings.csv'): filename_png = filename.replace('.csv', '.png') if os.path.exist...
gpl-2.0
ssaeger/scikit-learn
sklearn/cross_validation.py
7
67336
""" The :mod:`sklearn.cross_validation` module includes utilities for cross- validation and performance evaluation. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause fro...
bsd-3-clause
janhahne/nest-simulator
pynest/nest/tests/test_spatial/test_plotting.py
12
5748
# -*- coding: utf-8 -*- # # test_plotting.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, ...
gpl-2.0
RRCKI/pilot
ATLASSiteInformation.py
1
42230
# Class definition: # ATLASSiteInformation # This class is the ATLAS site information class inheriting from SiteInformation # Instances are generated with SiteInformationFactory via pUtil::getSiteInformation() # Implemented as a singleton class # http://stackoverflow.com/questions/42558/python-and-the-singlet...
apache-2.0
yavalvas/yav_com
build/matplotlib/examples/pylab_examples/transoffset.py
13
1666
#!/usr/bin/env python ''' This illustrates the use of transforms.offset_copy to make a transform that positions a drawing element such as a text string at a specified offset in screen coordinates (dots or inches) relative to a location given in any coordinates. Every Artist--the mpl class from which classes such as T...
mit
niknow/scipy
doc/source/tutorial/examples/normdiscr_plot1.py
84
1547
import numpy as np import matplotlib.pyplot as plt from scipy import stats npoints = 20 # number of integer support points of the distribution minus 1 npointsh = npoints / 2 npointsf = float(npoints) nbound = 4 #bounds for the truncated normal normbound = (1 + 1 / npointsf) * nbound #actual bounds of truncated normal ...
bsd-3-clause
mit-crpg/openmc
tests/regression_tests/mgxs_library_condense/test.py
7
2471
import hashlib import openmc import openmc.mgxs from openmc.examples import pwr_pin_cell from tests.testing_harness import PyAPITestHarness class MGXSTestHarness(PyAPITestHarness): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Initialize a two-group structure ...
mit
f3r/scikit-learn
sklearn/naive_bayes.py
29
28917
# -*- coding: utf-8 -*- """ The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These are supervised learning methods based on applying Bayes' theorem with strong (naive) feature independence assumptions. """ # Author: Vincent Michel <vincent.michel@inria.fr> # Minor fixes by Fabian Pedre...
bsd-3-clause
rudhir-upretee/Sumo17_With_Netsim
tools/projects/TaxiFCD_Krieg/src/taxiQuantity/QuantityOverDay.py
1
2316
# -*- coding: Latin-1 -*- """ @file QuantityOverDay.py @author Sascha Krieg @author Daniel Krajzewicz @author Michael Behrisch @date 2008-04-01 Counts for an given interval all unique taxis in an FCD file and draws the result as a bar chart. SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.ne...
gpl-3.0
Aghosh993/QuadcopterCodebase
GroundSoftware/csv_display.py
1
1948
#!/usr/bin/python3 import matplotlib as mp import numpy as np import matplotlib.pyplot as plt import argparse message_set = "sf11_bno055 v_z ahrs_rp yaw_height flow bno055_att esc_cmds" def plot_file(file): fig = plt.figure() input_data = np.loadtxt(file, delimiter=', ') col = input_data.shape[1] xdata = input_...
gpl-3.0
bzero/arctic
tests/util.py
2
1376
from contextlib import contextmanager from cStringIO import StringIO from dateutil.rrule import rrule, DAILY import dateutil from datetime import datetime as dt import pandas import numpy as np import sys def read_str_as_pandas(ts_str): labels = [x.strip() for x in ts_str.split('\n')[0].split('|')] pd = panda...
lgpl-2.1
rmeertens/paparazzi
sw/misc/attitude_reference/att_ref_gui.py
49
12483
#!/usr/bin/env python # # Copyright (C) 2014 Antoine Drouin # # This file is part of paparazzi. # # paparazzi 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, or (at your option) # any later ...
gpl-2.0
marcoitur/Freecad_test
src/Mod/Plot/plotSeries/TaskPanel.py
26
17784
#*************************************************************************** #* * #* Copyright (c) 2011, 2012 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* ...
lgpl-2.1
grlee77/scipy
scipy/signal/ltisys.py
12
128865
""" ltisys -- a collection of classes and functions for modeling linear time invariant systems. """ # # Author: Travis Oliphant 2001 # # Feb 2010: Warren Weckesser # Rewrote lsim2 and added impulse2. # Apr 2011: Jeffrey Armstrong <jeff@approximatrix.com> # Added dlsim, dstep, dimpulse, cont2discrete # Aug 2013: Jua...
bsd-3-clause
jwbuurlage/Zee
script/plot.py
1
2256
#!/usr/bin/python3 # plot.py reads descriptive.mtx, .plt, ... files and plots these` using matplotlib # # FIXME: REQUIRES USETEX, PNGDVI, etc. # TODO: zplot support import argparse import os import yaml import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.ticker a...
gpl-3.0
rubikloud/scikit-learn
examples/decomposition/plot_ica_vs_pca.py
306
3329
""" ========================== FastICA on 2D point clouds ========================== This example illustrates visually in the feature space a comparison by results using two different component analysis techniques. :ref:`ICA` vs :ref:`PCA`. Representing ICA in the feature space gives the view of 'geometric ICA': ICA...
bsd-3-clause
maxvonhippel/q2-diversity
q2_diversity/tests/test_core_metrics.py
1
1666
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2017, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
Chilipp/nc2map
_maps_old.py
1
61976
# -*- coding: utf-8 -*- import glob import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation from itertools import izip, chain, permutations, product from collections import OrderedDict from mapos import mapBase, fieldplot, windplot, returnbounds, round_...
gpl-2.0
NunoEdgarGub1/scikit-learn
examples/cluster/plot_kmeans_silhouette_analysis.py
242
5885
""" =============================================================================== Selecting the number of clusters with silhouette analysis on KMeans clustering =============================================================================== Silhouette analysis can be used to study the separation distance between the...
bsd-3-clause
fabioticconi/scikit-learn
examples/bicluster/plot_spectral_coclustering.py
127
1732
""" ============================================== A demo of the Spectral Co-Clustering algorithm ============================================== This example demonstrates how to generate a dataset and bicluster it using the Spectral Co-Clustering algorithm. The dataset is generated using the ``make_biclusters`` funct...
bsd-3-clause
datapythonista/pandas
pandas/tests/arrays/integer/test_comparison.py
9
4005
import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.tests.extension.base import BaseOpsUtil class TestComparisonOps(BaseOpsUtil): def _compare_other(self, data, op_name, other): op = self.get_op_from_name(op_name) # array result = pd.Series(op(da...
bsd-3-clause
manashmndl/scikit-learn
sklearn/feature_extraction/tests/test_dict_vectorizer.py
276
3790
# Authors: Lars Buitinck <L.J.Buitinck@uva.nl> # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from random import Random import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils.testing import (assert_equal, assert_in, ...
bsd-3-clause
INM-6/hybridLFPy
examples/example_brunel_alpha_topo_exp.py
1
24733
#!/usr/bin/env python ''' Hybrid LFP scheme example script, applying the methodology with a model implementation similar to: Nicolas Brunel. "Dynamics of Sparsely Connected Networks of Excitatory and Inhibitory Spiking Neurons". J Comput Neurosci, May 2000, Volume 8, Issue 3, pp 183-208 But the network is implemented...
gpl-3.0
robbymeals/scikit-learn
sklearn/decomposition/base.py
313
5647
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Kyle Kastner <kastnerkyle@gmail.com> # # Licen...
bsd-3-clause
Fireblend/scikit-learn
examples/manifold/plot_compare_methods.py
259
4031
""" ========================================= Comparison of Manifold Learning methods ========================================= An illustration of dimensionality reduction on the S-curve dataset with various manifold learning methods. For a discussion and comparison of these algorithms, see the :ref:`manifold module...
bsd-3-clause
Unidata/MetPy
v0.6/_downloads/meteogram_metpy.py
2
9460
# Copyright (c) 2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ Meteogram ========= Plots time series data as a meteogram. """ import datetime as dt import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from metpy.ca...
bsd-3-clause
jjx02230808/project0223
examples/feature_stacker.py
50
1910
""" ================================================= 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
metinsay/docluster
docluster/models/word_embedding/word2vec.py
1
14211
import collections import math import multiprocessing import os import random import threading from copy import deepcopy import pandas as pd import numpy as np import tensorflow as tf from docluster.core import Model from docluster.core.document_embedding import TfIdf from docluster.core.preprocessing import Preproce...
mit
ttchin/FaceDetected
FaceTrain.py
1
8343
#! encoding: UTF-8 #%% from __future__ import print_function import random import numpy as np from sklearn.cross_validation import train_test_split from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers...
mit
alpha-beta-soup/errorgeopy
errorgeopy/utils.py
1
14060
"""Utility functions for ErrorGeoPy. Inteded to be private functions, their call signatures are not considered strictly static. .. moduleauthor Richard Law <richard.m.law@gmail.com> """ import numpy as np from collections import namedtuple from functools import partial, wraps from itertools import compress import ins...
mit
kmunve/pysenorge
pysenorge/io/bil.py
1
5484
__docformat__ = "reStructuredText" ''' Binary (.bil) input/output class. :Author: kmu :Created: 14. okt. 2010 ''' # Built-in import os, sys sys.path.append(os.path.abspath('../..')) # Additional from numpy import zeros, fromfile, int8, int16, uint8, uint16, float32, nan # Own from pysenorge.converters...
gpl-3.0
MonoCloud/zipline
zipline/utils/tradingcalendar_tse.py
17
10125
# # 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
Paul-St-Young/share
algorithms/iso3d/hf/chf.py
1
3892
#!/usr/bin/env python import os import numpy as np def show_moR(moR): import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # enable 3D projection from qharv.inspect import volumetric,crystal fig = plt.figure() iplot = 0 for iorb in mo_to_plot: iplot += 1 val = moR[:,iorb].resh...
mit
LouisePaulDelvaux/openfisca-france-data
openfisca_france_data/input_data_builders/build_openfisca_indirect_taxation_survey_data/step_0_4_homogeneisation_revenus_menages.py
1
15961
#! /usr/bin/env python # -*- 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 redist...
agpl-3.0
KirstieJane/BrainsForPublication
scripts/show_cluster_in_volume.py
3
18141
#!/usr/bin/env python #============================================================================= # Created by Michael Notter # at OHBM 2016 Brainhack in Lausanne, June 2016 # Edited with more comments by Kirstie Whitaker # at Cambridge Brainhack-Global 2017, March 2017 # Contact: kw401@cam.ac.uk #=================...
mit
PalNilsson/pilot2
pilot/info/storagedata.py
1
6509
# 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 # # Authors: # - Alexey Anisenkov, anisyonk@cern.ch, 2018 # - Paul Nilsson, paul.nilsson@cern.ch, 20...
apache-2.0
davek44/Basset
src/dev/basset_conv2.py
1
5911
#!/usr/bin/env python from optparse import OptionParser import os import random import subprocess import h5py import matplotlib.pyplot as plt import numpy as np import seaborn as sns ################################################################################ # basset_conv2.py # # Visualize the 2nd convolution la...
mit
gabrevaya/Canto5
main.py
2
2355
''' Función principal. Obtiene silabas separadas y caracterizadas desde un archivo wav. ''' # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from envolvente import envolvente from read_wav import read_wav from get_files_paths import get_files_paths from find_syllables import find_syllables f...
gpl-3.0
jhonatanoliveira/pgmpy
pgmpy/estimators/ConstraintBasedEstimator.py
5
24197
#!/usr/bin/env python from warnings import warn from itertools import combinations from pgmpy.base import UndirectedGraph from pgmpy.models import BayesianModel from pgmpy.estimators import StructureEstimator from pgmpy.independencies import Independencies, IndependenceAssertion class ConstraintBasedEstimator(Struc...
mit
hlin117/statsmodels
statsmodels/sandbox/nonparametric/kdecovclass.py
33
5703
'''subclassing kde Author: josef pktd ''' import numpy as np import scipy from scipy import stats import matplotlib.pylab as plt class gaussian_kde_set_covariance(stats.gaussian_kde): ''' from Anne Archibald in mailinglist: http://www.nabble.com/Width-of-the-gaussian-in-stats.kde.gaussian_kde---td1955892...
bsd-3-clause
markomanninen/strongs
isopsephy/search.py
5
1537
#!/usr/local/bin/python # -*- coding: utf-8 -*- # file: search.py def find_cumulative_indices(list_of_numbers, search_sum): """ find_cumulative_indices([70, 58, 81, 909, 70, 215, 70, 1022, 580, 930, 898], 285) -> [[4, 5],[5, 6]] """ u = 0 y = 0 result = [] for idx, val in enumerate(lis...
mit
jstoxrocky/statsmodels
statsmodels/datasets/randhie/data.py
25
2667
"""RAND Health Insurance Experiment Data""" __docformat__ = 'restructuredtext' COPYRIGHT = """This is in the public domain.""" TITLE = __doc__ SOURCE = """ The data was collected by the RAND corporation as part of the Health Insurance Experiment (HIE). http://www.rand.org/health/projects/hie.html This ...
bsd-3-clause
openpathsampling/openpathsampling
openpathsampling/tests/test_histogram.py
2
11957
from __future__ import division from __future__ import absolute_import from past.utils import old_div from builtins import object from .test_helpers import assert_items_almost_equal, assert_items_equal import pytest import logging logging.getLogger('openpathsampling.initialization').setLevel(logging.CRITICAL) logging.g...
mit
rafiqsaleh/VERCE
verce-hpc-pe/src/postproc.py
2
8125
from verce.GenericPE import GenericPE, NAME import os class WatchDirectory(GenericPE): OUTPUT_NAME='output' def __init__(self, directory): GenericPE.__init__(self) self.outputconnections = { WatchDirectory.OUTPUT_NAME : { NAME : WatchDirectory.OUTPUT_NAME }} self.directory = directory ...
mit
xuewei4d/scikit-learn
sklearn/mixture/_bayesian_mixture.py
7
33397
"""Bayesian Gaussian Mixture Model.""" # Author: Wei Xue <xuewei4d@gmail.com> # Thierry Guillemot <thierry.guillemot.work@gmail.com> # License: BSD 3 clause import math import numpy as np from scipy.special import betaln, digamma, gammaln from ._base import BaseMixture, _check_shape from ._gaussian_mixture im...
bsd-3-clause
abulak/TDA-Cause-Effect-Pairs
identify_outliers.py
1
6251
import os import sys import numpy as np import numpy.ma as ma import logging from sklearn.neighbors import NearestNeighbors import scipy.spatial as spsp def standardise(points): """ Standardise points, i.e. mean = 0 and standard deviation = 1 in both dimensions :param points: np.array :return: n...
gpl-2.0
poryfly/scikit-learn
examples/text/document_clustering.py
230
8356
""" ======================================= Clustering text documents using k-means ======================================= This is an example showing how the scikit-learn can be used to cluster documents by topics using a bag-of-words approach. This example uses a scipy.sparse matrix to store the features instead of ...
bsd-3-clause
mjlong/openmc
tests/test_mgxs_library_nuclides/test_mgxs_library_nuclides.py
2
2643
#!/usr/bin/env python import os import sys import glob import hashlib sys.path.insert(0, os.pardir) from testing_harness import PyAPITestHarness import openmc import openmc.mgxs class MGXSTestHarness(PyAPITestHarness): def _build_inputs(self): # The openmc.mgxs module needs a summary.h5 file sel...
mit
PaddlePaddle/models
PaddleCV/gan/trainer/CGAN.py
1
8924
#copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # #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 l...
apache-2.0
woozzu/pylearn2
pylearn2/scripts/datasets/browse_norb.py
44
15741
#!/usr/bin/env python """ A browser for the NORB and small NORB datasets. Navigate the images by choosing the values for the label vector. Note that for the 'big' NORB dataset, you can only set the first 5 label dimensions. You can then cycle through the 3-12 images that fit those labels. """ import sys import os imp...
bsd-3-clause