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 |
|---|---|---|---|---|---|
royshan/portfolioopt | example.py | 1 | 3337 | #!/usr/bin/python
# The MIT License (MIT)
#
# Copyright (c) 2015 Christian Zielinski
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the r... | mit |
pianomania/scikit-learn | examples/bicluster/bicluster_newsgroups.py | 142 | 7183 | """
================================================================
Biclustering documents with the Spectral Co-clustering algorithm
================================================================
This example demonstrates the Spectral Co-clustering algorithm on the
twenty newsgroups dataset. The 'comp.os.ms-windows... | bsd-3-clause |
nrhine1/scikit-learn | sklearn/mixture/tests/test_gmm.py | 200 | 17427 | import unittest
import copy
import sys
from nose.tools import assert_true
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_raises)
from scipy import stats
from sklearn import mixture
from sklearn.datasets.samples_generator import make_spd_ma... | bsd-3-clause |
krez13/scikit-learn | examples/model_selection/plot_learning_curve.py | 17 | 4504 | """
========================
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 |
jseabold/scikit-learn | examples/ensemble/plot_random_forest_embedding.py | 286 | 3531 | """
=========================================================
Hashing feature transformation using Totally Random Trees
=========================================================
RandomTreesEmbedding provides a way to map data to a
very high-dimensional, sparse representation, which might
be beneficial for classificati... | bsd-3-clause |
vighneshbirodkar/scikit-image | doc/examples/transform/plot_matching.py | 21 | 5132 | """
============================
Robust matching using RANSAC
============================
In this simplified example we first generate two synthetic images as if they
were taken from different view points.
In the next step we find interest points in both images and find
correspondences based on a weighted sum of squ... | bsd-3-clause |
lukemetz/MLFun | IMDB/why_u_so_slow_rnn.py | 1 | 1441 | #bunch of plots to get a sense of RNN performance
import matplotlib
from matplotlib import pyplot as plt
#First test, running on a 2 unit hidden layer of rnn, varrying seqlength.
#1 -- 6.7840
#10 8.39
#seqlen 50 -- 14.5 seconds
#seqlen 100 -- 22.56
#150 28.62
#200 -- 34.38
x = [1, 10, 50, 100, 150, 200]
y = [6.784, ... | mit |
mantidproject/mantid | qt/applications/workbench/workbench/plotting/plotscriptgenerator/legend.py | 3 | 6968 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
andrewv587/pycharm-project | test.py | 1 | 4985 | # -*- coding:utf-8 -*-
import fire
def identity(arg=None,other=None):
return arg, type(arg),other,type(other)
# class Widget(object):
#
# def whack(self, n=1):
# """Prints "whack!" n times."""
# return ' '.join('whack!' for _ in xrange(n))
#
# def bang(self, noise='bang'):
# """Makes a loud noise."""... | apache-2.0 |
nicktimko/multiworm | multiworm/analytics/sgolay.py | 1 | 3833 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Savitzky-Golay Filter from the Scipy.org Cookbook:
http://wiki.scipy.org/Cookbook/SavitzkyGolay
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals)
import six
from six.moves import (zip, filter, map, reduce, input, range)
i... | mit |
huobaowangxi/scikit-learn | examples/mixture/plot_gmm_pdf.py | 284 | 1528 | """
=============================================
Density Estimation for a mixture of Gaussians
=============================================
Plot the density estimation of a mixture of two Gaussians. Data is
generated from two Gaussians with different centers and covariance
matrices.
"""
import numpy as np
import ma... | bsd-3-clause |
mickypaganini/IPNN | DL1/train_DL1_generator.py | 1 | 10260 | # -*- coding: utf-8 -*-
'''
Info:
This script can be run directly after
parallel_generate_data_DL1. It takes as inputs the
HDF5 files produced by the first script
and uses them to train a Keras NN à la DL1 but using
a generator.
# It also plots ROC curve comparisons with
# MV2c10 and save... | mit |
hdmetor/scikit-learn | sklearn/ensemble/tests/test_weight_boosting.py | 32 | 15697 | """Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_array_equal, assert_array_less
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_raises, assert_rais... | bsd-3-clause |
DigitalPig/SmartUnderwriter | processing/merged-year.py | 1 | 2531 | #!/usr/bin/env python3
import os
import os.path
import numpy as np
import pandas as pd
start_path = os.getcwd()
source_path = os.path.join(start_path,'processed','merged')
dest_path = os.path.join(start_path, 'processed','total')
##years = list(range(2010, 2015))
years = range(2013,2015)
summaryfile_type = {'Unnam... | gpl-3.0 |
ychfan/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator_test.py | 21 | 53471 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
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 |
bhilburn/gnuradio | gr-analog/examples/fmtest.py | 18 | 7986 | #!/usr/bin/env python
#
# Copyright 2009,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... | gpl-3.0 |
bjornaa/ladim | examples/latlon/plot2_basemap.py | 1 | 1587 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from netCDF4 import Dataset
from postladim import ParticleFile
# ---------------
# User settings
# ---------------
# Files
particle_file = "latlon.nc"
coast_file = "coast.npy" # Made by make_coast.py
# time step to plot
t =... | mit |
Sentient07/scikit-learn | examples/neighbors/plot_nearest_centroid.py | 58 | 1803 | """
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
f... | bsd-3-clause |
negar-rostamzadeh/rna | test_2.py | 1 | 1165 | import theano
import theano.tensor as T
from theano import config
from crop import LocallySoftRectangularCropper
from crop import Gaussian
import numpy as np
from datasets import get_bmnist_streams
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
import matplotlib.pyplot as pl... | mit |
hawkrobe/couzin_replication | analysis/experiment3/process-data.py | 1 | 1410 |
import sys,os
from multiprocessing import Pool
sys.path.append("../")
sys.path.append("./helpers/")
import game_utils
import process_utils
import pandas as pd
import numpy as np
waits = False
all_players = False
in_dir = '../../data/experiment3/out/'
out_dir = '../../processed/'
if waits:
out_dir += '-waits... | mit |
jostep/tensorflow | tensorflow/examples/learn/iris.py | 29 | 2313 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
team-hdnet/hdnet | hdnet/visualization.py | 1 | 19796 | # -*- coding: utf-8 -*-
# This file is part of the hdnet package
# Copyright 2014 the authors, see file AUTHORS.
# Licensed under the GPLv3, see file LICENSE for details
"""
hdnet.visualization
~~~~~~~~~~~~~~~~~~~
Visualization functions for hdnet.
"""
from __future__ import print_function
import os
im... | gpl-3.0 |
GongYiLiao/Python_Daily | 2015/Sep/24/rand_pd_2.py | 1 | 3879 | import pandas as pd
from random import sample, seed
from numpy import nan
from numpy.random import randint
def stack_up(td_df,
today=None,
mfrq='Q'):
'''
stack up
td_df: A pandas.DataFrame object containing timestamps of events.
It is assume that the stage is not c... | mit |
wzhfy/spark | python/pyspark/sql/tests/test_pandas_cogrouped_map.py | 2 | 8824 | #
# 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 |
rebstar6/servo | tests/heartbeats/process_logs.py | 139 | 16143 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
from os import path
... | mpl-2.0 |
chrjxj/zipline | tests/test_history.py | 7 | 39984 | #
# 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 |
schae234/Camoco | camoco/Camoco.py | 1 | 7752 | #!/usr/bin/env python3
import apsw as lite
import os as os
import tempfile
import numpy as np
import pandas as pd
import bcolz as bcz
import time
import time
from .Tools import log
from .Config import cf
from .Exceptions import CamocoExistsError
from apsw import ConstraintError
def busyhandler(num_prev_calls):
if... | mit |
deepesch/scikit-learn | benchmarks/bench_plot_ward.py | 290 | 1260 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
Tong-Chen/scikit-learn | sklearn/datasets/lfw.py | 8 | 16527 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | bsd-3-clause |
pavel-odintsov/shogun | examples/undocumented/python_modular/graphical/regression_gaussian_process_demo.py | 16 | 9323 | ###########################################################################
# Mean prediction from Gaussian Processes based on
# classifier_libsvm_minimal_modular.py
# plotting functions have been adapted from the pyGP library
# https://github.com/jameshensman/pyGP
######################################################... | gpl-3.0 |
allanspadini/ShotCode | shotcode/geosignal.py | 1 | 1329 | from scipy.fftpack import fft,ifft
import numpy as np
import matplotlib.pyplot as plt
from obspy.signal.util import next_pow_2
import scipy
def filterfx(D,header,f,c=0):
'''Apply a band pass filkter for each seismic trace of data matrix D
with phase rotation c'''
dt=header["dt"]
nx=header['tracl']
ns=header['n... | gpl-3.0 |
kjung/scikit-learn | sklearn/linear_model/__init__.py | 270 | 3096 | """
The :mod:`sklearn.linear_model` module implements generalized linear models. It
includes Ridge regression, Bayesian Regression, Lasso and Elastic Net
estimators computed with Least Angle Regression and coordinate descent. It also
implements Stochastic Gradient Descent related algorithms.
"""
# See http://scikit-le... | bsd-3-clause |
rhiever/bokeh | examples/app/stock_applet/stock_app.py | 42 | 7786 | """
This file demonstrates a bokeh applet, which can either be viewed
directly on a bokeh-server, or embedded into a flask application.
See the README.md file in this directory for instructions on running.
"""
import logging
logging.basicConfig(level=logging.DEBUG)
from os import listdir
from os.path import dirname,... | bsd-3-clause |
cjayb/mne-python | examples/decoding/plot_linear_model_patterns.py | 12 | 4327 | # -*- coding: utf-8 -*-
"""
===============================================================
Linear classifier on sensor data with plot patterns and filters
===============================================================
Here decoding, a.k.a MVPA or supervised machine learning, is applied to M/EEG
data in sensor space.... | bsd-3-clause |
datitran/PySpark-App-CF | linear_regression.py | 1 | 1254 | import numpy as np
import pandas as pd
from pyspark.sql import SparkSession
from pyspark.ml.linalg import Vectors
from pyspark.ml.regression import LinearRegression
def generate_data():
np.random.seed(1) # set the seed
x = np.arange(100)
error = np.random.normal(0, size=(100,))
y = 0.5 + 0.3 * x + er... | mit |
Srisai85/scikit-learn | examples/ensemble/plot_voting_decision_regions.py | 230 | 2386 | """
==================================================
Plot the decision boundaries of a VotingClassifier
==================================================
Plot the decision boundaries of a `VotingClassifier` for
two features of the Iris dataset.
Plot the class probabilities of the first sample in a toy dataset
pred... | bsd-3-clause |
awni/tensorflow | tensorflow/contrib/skflow/python/skflow/io/data_feeder.py | 1 | 16006 | """Implementations of different data feeders to provide data for TF trainer."""
# Copyright 2015-present The Scikit Flow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of th... | apache-2.0 |
joshbohde/scikit-learn | examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py | 2 | 3650 | """
==============================================
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 |
snowman2/pangaea | pangaea/xlsm.py | 1 | 18798 | # -*- coding: utf-8 -*-
#
# xlsm.py
# pangaea
#
# Author : Alan D Snow, 2017.
# License: BSD 3-Clause
"""pangea.xlsm
This module is an extension for xarray for land surface models.
(see: http://xarray.pydata.org/en/stable/internals.html#extending-xarray)
"""
from affine import Affine
import numpy as np
from... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/testing/jpl_units/Duration.py | 12 | 6736 | #===========================================================================
#
# Duration
#
#===========================================================================
"""Duration module."""
#===========================================================================
# Place all imports after here.
#
from __future_... | gpl-3.0 |
btabibian/scikit-learn | examples/preprocessing/plot_all_scaling.py | 19 | 12711 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=============================================================
Compare the effect of different scalers on data with outliers
=============================================================
Feature 0 (median income in a block) and feature 5 (number of households) of
the `... | bsd-3-clause |
BigDataRepublic/bdr-analytics-py | bdranalytics/pdlearn/tests/test_preprocessing.py | 1 | 5414 | import numpy as np
import pandas as pd
import unittest
from bdranalytics.pdlearn.preprocessing import DateCyclicalEncoding, \
DateOneHotEncoding
from bdranalytics.pdlearn.preprocessing import date_to_dateparts, \
date_to_cyclical
class TestDatePartitioner(unittest.TestCase):
def test_date_to_dateparts(se... | apache-2.0 |
Crespo911/pyspace | pySPACE/tests/generic_unittest.py | 1 | 24041 | #!/usr/bin/env python
""" Provides a class to implement a generic unittest
The unittests will only instantiate the given class with either
a default input set (see :mod:`~pySPACE.tests.utils.data.test_default_data`)
or will interpret the data given by the user. In the case that there
already is a specialized unittest... | gpl-3.0 |
cybernet14/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 |
lekshmideepu/nest-simulator | pynest/examples/glif_cond_neuron.py | 14 | 9655 | # -*- coding: utf-8 -*-
#
# glif_cond_neuron.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 Licens... | gpl-2.0 |
lancezlin/ml_template_py | lib/python2.7/site-packages/matplotlib/sphinxext/only_directives.py | 4 | 2215 | #
# A pair of directives for inserting content that will only appear in
# either html or latex.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
from docutils.nodes import Body, Element
from docutils.parsers.rst import... | mit |
calispac/digicampipe | digicampipe/scripts/data_quality.py | 1 | 11953 | """
Make a quick data quality check
Usage:
digicam-data-quality [options] [--] <INPUT>...
Options:
--help Show this
<INPUT> List of zfits input files. Typically a single
night observing a single source.
--dark_filename=FILE p... | gpl-3.0 |
litnimax/addons-yelizariev | import_custom/wizard/upload.py | 16 | 1822 | from openerp.osv import osv, fields
from openerp.tools.translate import _
from openerp import tools
import logging
_logger = logging.getLogger(__name__)
import base64
import tempfile
try:
import MySQLdb
import MySQLdb.cursors
from pandas import DataFrame
except ImportError:
pass
from ..import_cust... | lgpl-3.0 |
xguse/scikit-bio | skbio/draw/_distributions.py | 10 | 30987 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | bsd-3-clause |
Sentient07/scikit-learn | examples/linear_model/plot_sgd_weighted_samples.py | 344 | 1458 | """
=====================
SGD: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
# we create 20 points
np.random.seed(0)
X ... | bsd-3-clause |
jesusfcr/airflow | setup.py | 5 | 9813 | # -*- coding: utf-8 -*-
#
# 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, software
... | apache-2.0 |
robbymeals/scikit-learn | sklearn/manifold/tests/test_spectral_embedding.py | 216 | 8091 | from nose.tools import assert_true
from nose.tools import assert_equal
from scipy.sparse import csr_matrix
from scipy.sparse import csc_matrix
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_raises
from nose.plugins.skip import SkipTest
from sk... | bsd-3-clause |
chrisburr/scikit-learn | examples/cluster/plot_segmentation_toy.py | 91 | 3522 | """
===========================================
Spectral clustering for image segmentation
===========================================
In this example, an image with connected circles is generated and
spectral clustering is used to separate the circles.
In these settings, the :ref:`spectral_clustering` approach solve... | bsd-3-clause |
jm-begon/scikit-learn | sklearn/mixture/gmm.py | 128 | 31069 | """
Gaussian Mixture Models.
This implementation corresponds to frequentist (non-Bayesian) formulation
of Gaussian Mixture Models.
"""
# Author: Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Bertrand Thirion <bertrand.thirion@inria.fr>
import warnings
import numpy as... | bsd-3-clause |
wdurhamh/statsmodels | statsmodels/examples/ex_kde_normalreference.py | 34 | 1704 | # -*- coding: utf-8 -*-
"""
Author: Padarn Wilson
Performance of normal reference plug-in estimator vs silverman. Sample is drawn
from a mixture of gaussians. Distribution has been chosen to be reasoanbly close
to normal.
"""
from __future__ import print_function
import numpy as np
from scipy import stats
import matp... | bsd-3-clause |
nhejazi/scikit-learn | examples/plot_digits_pipe.py | 65 | 1652 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Pipelining: chaining a PCA and a logistic regression
=========================================================
The PCA does an unsupervised dimensionality reduction, while the logistic
regression does the predictio... | bsd-3-clause |
bikong2/scikit-learn | examples/neural_networks/plot_rbm_logistic_classification.py | 258 | 4609 | """
==============================================================
Restricted Boltzmann Machine features for digit classification
==============================================================
For greyscale image data where pixel values can be interpreted as degrees of
blackness on a white background, like handwritten... | bsd-3-clause |
ningchi/scikit-learn | benchmarks/bench_plot_neighbors.py | 287 | 6433 | """
Plot the scaling of the nearest neighbors algorithms with k, D, and N
"""
from time import time
import numpy as np
import pylab as pl
from matplotlib import ticker
from sklearn import neighbors, datasets
def get_data(N, D, dataset='dense'):
if dataset == 'dense':
np.random.seed(0)
return np.... | bsd-3-clause |
AntoineRiaud/Tweezer_design | Tweezer_design/IDT_group_toolbox.py | 1 | 15209 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 29 09:38:11 2016
@author: Antoine
"""
import csv
from Tkinter import Tk
import tkFileDialog
import svg_toolbox as SVGT
from geometry1 import IDT2svg
from numpy import deg2rad,array,mean,vstack
#from tkFileDialog import askopenfilename
import scipy.io as sio... | gpl-3.0 |
mihail911/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/mathtext.py | 69 | 101723 | r"""
:mod:`~matplotlib.mathtext` is a module for parsing a subset of the
TeX math syntax and drawing them to a matplotlib backend.
For a tutorial of its usage see :ref:`mathtext-tutorial`. This
document is primarily concerned with implementation details.
The module uses pyparsing_ to parse the TeX expression.
.. _p... | gpl-3.0 |
mariusvniekerk/ibis | ibis/config.py | 16 | 20779 | # This file has been adapted from pandas/core/config.py. pandas 3-clause BSD
# license. See LICENSES/pandas
#
# Further modifications:
#
# Copyright 2014 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 ... | apache-2.0 |
Caoimhinmg/PmagPy | programs/strip_magic.py | 1 | 12354 | #!/usr/bin/env python
from __future__ import print_function
from builtins import input
import sys
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
import pmagpy.pmagplotlib as pmagplotlib
import pmagpy.pmag as pmag
def main():
"""
NAME
strip_magic.py
DESCRIPTIO... | bsd-3-clause |
bdh1011/wau | venv/lib/python2.7/site-packages/pandas/io/tests/test_common.py | 3 | 1376 | """
Tests for the pandas.io.common functionalities
"""
from pandas.compat import StringIO
import os
import pandas.util.testing as tm
from pandas.io import common
class TestCommonIOCapabilities(tm.TestCase):
def test_expand_user(self):
filename = '~/sometest'
expanded_name = common._expand_u... | mit |
hlin117/statsmodels | statsmodels/datasets/template_data.py | 31 | 1680 | #! /usr/bin/env python
"""Name of dataset."""
__docformat__ = 'restructuredtext'
COPYRIGHT = """E.g., This is public domain."""
TITLE = """Title of the dataset"""
SOURCE = """
This section should provide a link to the original dataset if possible and
attribution and correspondance information for the da... | bsd-3-clause |
baspijhor/paparazzi | sw/tools/tcp_aircraft_server/phoenix/__init__.py | 86 | 4470 | #Copyright 2014, Antoine Drouin
"""
Phoenix is a Python library for interacting with Paparazzi
"""
import math
"""
Unit convertions
"""
def rad_of_deg(d): return d/180.*math.pi
def deg_of_rad(r): return r*180./math.pi
def rps_of_rpm(r): return r*2.*math.pi/60.
def rpm_of_rps(r): return r/2./math.pi*60.
def m_of_i... | gpl-2.0 |
smccaffrey/PIRT_ASU | tests/client_builds/PHY132_Fall2017/dueDates_V2.py | 2 | 3544 | import selenium
import getpass
import time
import sys
import logging as log
import pandas as pd
from selenium import webdriver as wbd
from selenium.webdriver.common.by import By
sys.path.append('/Users/smccaffrey/Desktop/BlackboardAssistant/core/')
#from automation import test_options as prelabs
from automation import... | apache-2.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/tests/plotting/test_groupby.py | 7 | 2591 | #!/usr/bin/env python
# coding: utf-8
import nose
from pandas import Series, DataFrame
import pandas.util.testing as tm
import numpy as np
from pandas.tests.plotting.common import TestPlotBase
""" Test cases for GroupBy.plot """
@tm.mplskip
class TestDataFrameGroupByPlots(TestPlotBase):
def test_series_gro... | mit |
sdiazpier/nest-simulator | pynest/nest/tests/test_get_set.py | 10 | 21354 | # -*- coding: utf-8 -*-
#
# test_get_set.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, o... | gpl-2.0 |
Migelo/mpa_garching | 1/accreted_speed.py | 1 | 3562 | import pygad as pg
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.gridspec as gridspec
import numpy as np
import pygad.plotting
import glob
import utils
from scipy import stats
from multiprocessing import Pool
filename = __file__
def plot(args):
halo, definition = args
pr... | mit |
pyinduct/pyinduct | pyinduct/examples/rad_eq_var_coeff.py | 3 | 6329 | import numpy as np
import scipy.integrate as si
import pyinduct as pi
import pyinduct.parabolic as parabolic
def run(show_plots):
# system/simulation parameters
actuation_type = 'robin'
bound_cond_type = 'robin'
l = 1.
T = 1
spatial_domain = pi.Domain(bounds=(0, l), num=15)
temporal_domain... | bsd-3-clause |
awakenting/gif_fitting | fitgif/GIF_subth_adapt_constrained.py | 1 | 24962 | import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import minimize
from .GIF import GIF
from .Filter_Rect_LogSpaced import Filter_Rect_LogSpaced
from . import Tools
from .Tools import reprint
from . import cython_helpers as cyth
class GIF_subadapt_constrained(GIF) :
"""
Generalized Integ... | gpl-3.0 |
roatienza/Deep-Learning-Experiments | Experiments/Tensorflow/Machine_Learning/underfit_regression.py | 1 | 2245 | '''
Underfitting in Linear Regression
Author: Rowel Atienza
Project: https://github.com/roatienza/Deep-Learning-Experiments
'''
# On command line: python3 underfit_regression.py
# Prerequisite: tensorflow 1.0 (see tensorflow.org)
# : matplotlib (http://matplotlib.org/)
from __future__ import print_function... | mit |
fraserphysics/F_UNCLE | F_UNCLE/Experiments/Stick.py | 1 | 10845 | """
Stick: A simplified model of a rate stick
Authors
-------
- Stephen Andrews (SA)
- Andrew M. Fraiser (AMF)
Revisions
---------
0 -> Initial class creation (06-06-2016)
ToDo
----
None
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __futur... | gpl-2.0 |
ndingwall/scikit-learn | sklearn/utils/tests/test_validation.py | 1 | 48495 | """Tests for input validation functions"""
import warnings
import os
from tempfile import NamedTemporaryFile
from itertools import product
from operator import itemgetter
import pytest
from pytest import importorskip
import numpy as np
import scipy.sparse as sp
from sklearn.utils._testing import assert_no_warnings
... | bsd-3-clause |
dbednarski/pyhdust | pyhdust/poltools.py | 1 | 201725 | #-*- coding:utf-8 -*-
"""
PyHdust *poltools* module: polarimetry tools
History:
-grafpol working for *_WP1110....log files!
-grafpol working for log/out files with more than a single star
:co-author: Daniel Bednarski
:license: GNU GPL v3.0 (https://github.com/danmoser/pyhdust/blob/master/LICENSE)
"""
from __future_... | gpl-3.0 |
DerPhysikeR/pywbm | pywbm.py | 1 | 1782 | #!/usr/bin/env python
"""
2017-05-13 21:05:35
@author: Paul Reiter
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import hankel2
from pywbm import Subdomain
def vn(x, y, z, k):
# incident velocity on left side
# return (x == 0).astype(complex)*1j/(k*z)
# incident velocity on le... | gpl-3.0 |
michigraber/scikit-learn | sklearn/linear_model/coordinate_descent.py | 42 | 73973 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD 3 clause
import sys
import warnings
from abc import ABCMeta, abstractmethod
import n... | bsd-3-clause |
mshakya/PyPiReT | piret/dge/edgeR.py | 1 | 3477 | #! /usr/bin/env python
"""Check design."""
import os
import sys
import luigi
import shutil
from luigi import LocalTarget
from luigi.util import inherits, requires
import pandas as pd
DIR = os.path.dirname(os.path.realpath(__file__))
script_dir = os.path.abspath(os.path.join(DIR, "../../scripts"))
os.environ["PATH"] +=... | bsd-3-clause |
wkfwkf/statsmodels | statsmodels/datasets/star98/data.py | 25 | 3880 | """Star98 Educational Testing dataset."""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Used with express permission from the original author,
who retains all rights."""
TITLE = "Star98 Educational Dataset"
SOURCE = """
Jeff Gill's `Generalized Linear Models: A Unified Approach`
http://jgill.wustl.e... | bsd-3-clause |
vibhorag/scikit-learn | sklearn/manifold/tests/test_locally_linear.py | 232 | 4761 | from itertools import product
from nose.tools import assert_true
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from scipy import linalg
from sklearn import neighbors, manifold
from sklearn.manifold.locally_linear import barycenter_kneighbors_graph
from sklearn.utils.testi... | bsd-3-clause |
martinwicke/tensorflow | tensorflow/examples/learn/hdf5_classification.py | 17 | 2201 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
roxyboy/scikit-learn | examples/cluster/plot_dict_face_patches.py | 337 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
xavierwu/scikit-learn | sklearn/neural_network/rbm.py | 206 | 12292 | """Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator
from ..base import TransformerMixi... | bsd-3-clause |
iresium/apprater | DISAM.py | 1 | 10100 | ########################################
########################################
####### Author : Abhinandan Dubey (alivcor)
####### Stony Brook University
# perfect essays : 37, 118, 147,
import csv
import sys
import nltk
import numpy
import sklearn
from sklearn.feature_extraction.text import TfidfVectorizer
from sk... | apache-2.0 |
hrantzsch/signature-verification | eval_embedding.py | 1 | 21650 | """A script to evaluate a model's embeddings.
The script expects embedded data as a .pkl file.
Currently the script prints min, mean, and max distances intra-class and
comparing a class's samples to the respective forgeries.
"""
import pickle
import subprocess
import sys
import numpy as np
from scipy.spatial.distanc... | gpl-3.0 |
jonyroda97/redbot-amigosprovaveis | lib/matplotlib/projections/polar.py | 2 | 51998 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from collections import OrderedDict
import numpy as np
import matplotlib.artist as martist
from matplotlib.axes import Axes
import matplotlib.axis as maxis
from matplotlib import cbook
from matplo... | gpl-3.0 |
lmallin/coverage_test | python_venv/lib/python2.7/site-packages/pandas/tests/io/parser/compression.py | 7 | 5700 | # -*- coding: utf-8 -*-
"""
Tests compressed data parsing functionality for all
of the parsers defined in parsers.py
"""
import pytest
import pandas.util.testing as tm
class CompressionTests(object):
def test_zip(self):
try:
import zipfile
except ImportError:
pytest.ski... | mit |
AdaptiveApplications/carnegie | tarc_bus_locator_client/numpy-1.8.1/build/lib.linux-x86_64-2.7/numpy/lib/polynomial.py | 11 | 37544 | """
Functions to operate on polynomials.
"""
from __future__ import division, absolute_import, print_function
__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',
'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',
'polyfit', 'RankWarning']
import re
import warnings
import numpy.core.... | mit |
TimeWz667/Kamanian | complexism/misc/demography.py | 1 | 20710 | from abc import ABCMeta, abstractmethod
import functools
import numpy.random as rd
import pandas as pd
import epidag.data as dat
__author__ = 'TimeWz667'
__all__ = ['AbsDemography', 'DemographyTotal', 'DemographySex', 'DemographyLeeCarter']
def check_year(fn):
@functools.wraps(fn)
def wrp(this, y... | mit |
nmayorov/scikit-learn | sklearn/semi_supervised/tests/test_label_propagation.py | 307 | 1974 | """ test the label propagation module """
import nose
import numpy as np
from sklearn.semi_supervised import label_propagation
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
ESTIMATORS = [
(label_propagation.LabelPropagation, {'kernel': 'rbf'}),
(label_propa... | bsd-3-clause |
qgoisnard/Exercice-update | frame.py | 1 | 12996 | import matplotlib.pyplot as plt
import numpy as np
import sympy as sp
class LinearFrame():
"""
This class implements a model for a linear model of a planar frame.
It includes tools for assembling the stiffness matrix and load vector, and plotting
"""
def __init__(self, nodes, elements):
""... | mit |
iABC2XYZ/abc | StockPredict/TensorflowGPUPredic2.py | 2 | 15653 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 11 12:17:54 2017
@author: A
"""
import tensorflow as tf # Version 1.0 or 0.12
import numpy as np
import matplotlib.pyplot as plt
import random
import math
import os
plt.close('all')
inSeq=20
outSeq=10
batch_size = 50 # Low value used for live d... | gpl-3.0 |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/sklearn/feature_selection/variance_threshold.py | 238 | 2594 | # Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# License: 3-clause BSD
import numpy as np
from ..base import BaseEstimator
from .base import SelectorMixin
from ..utils import check_array
from ..utils.sparsefuncs import mean_variance_axis
from ..utils.validation import check_is_fitted
class VarianceThreshold(BaseEstim... | mit |
asurve/arvind-sysml2 | src/main/python/systemml/mlcontext.py | 1 | 26974 | #-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under... | apache-2.0 |
asthajn/computer-vision | A-1/hist.py | 1 | 1852 | import os
#os.chdir("/media/astha/Astha/CVPR/Assignments/A-1/")
import cv2
import cv2.cv as cv
import numpy as np
import matplotlib.pyplot as plt
import sys
image1 = cv2.imread("airborne.jpg" , cv2.CV_LOAD_IMAGE_GRAYSCALE) # load the grayscale image
image2 = cv2.imread("haze.jpg" , cv2.CV_LOAD_IMAGE_GRAYSCALE) #... | gpl-2.0 |
jreback/pandas | pandas/tests/frame/test_arithmetic.py | 1 | 59527 | from collections import deque
from datetime import datetime
import operator
import re
import numpy as np
import pytest
import pytz
import pandas as pd
from pandas import DataFrame, MultiIndex, Series
import pandas._testing as tm
import pandas.core.common as com
from pandas.core.computation.expressions import _MIN_ELE... | bsd-3-clause |
memex-explorer/image_space | flann_index/image_match.py | 12 | 4269 | # import the necessary packages
from optparse import OptionParser
from scipy.spatial import distance as dist
import matplotlib.pyplot as plt
import numpy as np
import argparse
import glob
import cv2
import sys
import pickle
###########################
def image_match_histogram( all_files, options ):
histograms = {... | apache-2.0 |
FiniteElementries/OneBus | Database/util.py | 1 | 4876 |
import pandas as pd
import numpy as np
import re
import config
def result_filter_by_distance(stops, targets, bus_stop):
"""
return filtered index of stops, and targets
:param stops: array of stops to reference from
:param targets: array of targets to filter through
:return:
"""
# generat... | mit |
pombredanne/dask | dask/dataframe/tests/test_shuffle.py | 7 | 1642 | import dask.dataframe as dd
import pandas.util.testing as tm
import pandas as pd
from dask.dataframe.shuffle import shuffle
import partd
from dask.async import get_sync
dsk = {('x', 0): pd.DataFrame({'a': [1, 2, 3], 'b': [1, 4, 7]},
index=[0, 1, 3]),
('x', 1): pd.DataFrame({'a': [4... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.