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 |
|---|---|---|---|---|---|
Newman101/scipy | scipy/signal/windows.py | 20 | 54134 | """The suite of window functions."""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy import fftpack, linalg, special
from scipy._lib.six import string_types
__all__ = ['boxcar', 'triang', 'parzen', 'bohman', 'blackman', 'nuttall',
'blackmanhar... | bsd-3-clause |
ephes/scikit-learn | sklearn/decomposition/tests/test_factor_analysis.py | 222 | 3055 | # Author: Christian Osendorfer <osendorf@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Licence: BSD3
import numpy as np
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing im... | bsd-3-clause |
stharrold/demo | demo/app_predict/predict.py | 1 | 119605 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""Prediction application.
"""
# Import standard packages.
import bs4
import collections
import inspect
import itertools
import logging
import os
import pickle
import requests
import shelve
import sys
import textwrap
import time
import warnings
# Im... | mit |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/matplotlib/blocking_input.py | 8 | 11792 | """
This provides several classes used for blocking interaction with figure
windows:
:class:`BlockingInput`
creates a callable object to retrieve events in a blocking way for
interactive sessions
:class:`BlockingKeyMouseInput`
creates a callable object to retrieve key or mouse clicks in a blocking
way... | apache-2.0 |
NYU-CS6313-Projects/Charts-for-CompStat | data/crash_cleaner.py | 1 | 3650 | #!/user/bin/python
# this python script cleans raw crash data and subsets the last n days of observations
# if n=-1 all rows of the raw dataset are kept
# WEEK and YEAR attributes are derived
import pandas as pd
import numpy as np
import datetime as dt
import re
import os
import logging
dpath = './'
def date_parser... | mit |
hyperspy/hyperspy | hyperspy/drawing/_widgets/rectangles.py | 2 | 19757 | # -*- coding: utf-8 -*-
# Copyright 2007-2021 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
anjalisood/spark-tk | regression-tests/sparktkregtests/testcases/dicom/dicom_covariance_matrix_test.py | 11 | 2402 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
davidgbe/scikit-learn | sklearn/datasets/tests/test_svmlight_format.py | 228 | 11221 | from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... | bsd-3-clause |
dmigo/incubator-superset | tests/core_tests.py | 1 | 26075 | # -*- coding: utf-8 -*-
"""Unit tests for Superset"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import csv
import datetime
import doctest
import io
import json
import logging
import os
import random
import re
imp... | apache-2.0 |
WillArmentrout/galSims | simulate/Simulate_Draft_ModifyDensityAlongArm_7.20.18.py | 1 | 23177 | #!/usr/bin/python
from scipy.stats import cauchy
import random
import math
import csv
import numpy as np
#import netCDF4 as nc
import argparse
#import matplotlib.pyplot as plt
#from mpl_toolkits.mplot3d import Axes3D
#import plotly.plotly as py
#import plotly.graph_objs as go
########################################... | gpl-2.0 |
xavierwu/scikit-learn | examples/svm/plot_rbf_parameters.py | 132 | 8096 | '''
==================
RBF SVM parameters
==================
This example illustrates the effect of the parameters ``gamma`` and ``C`` of
the Radial Basis Function (RBF) kernel SVM.
Intuitively, the ``gamma`` parameter defines how far the influence of a single
training example reaches, with low values meaning 'far' a... | bsd-3-clause |
pratapvardhan/scikit-learn | examples/classification/plot_classification_probability.py | 138 | 2871 | """
===============================
Plot classification probability
===============================
Plot the classification probability for different classifiers. We use a 3
class dataset, and we classify it with a Support Vector classifier, L1
and L2 penalized logistic regression with either a One-Vs-Rest or multinom... | bsd-3-clause |
tmthydvnprt/compfipy | compfipy/util.py | 1 | 4568 | """
util.py
General constants and functions that will be used throughout the package.
"""
import numpy as np
import pandas as pd
# Constants
# ------------------------------------------------------------------------------------------------------------------------------
# Display constants
COL_DASH_WIDTH = 128
# Tim... | mit |
Vimos/scikit-learn | examples/linear_model/plot_sgd_penalties.py | 124 | 1877 | """
==============
SGD: Penalties
==============
Plot the contours of the three penalties.
All of the above are supported by
:class:`sklearn.linear_model.stochastic_gradient`.
"""
from __future__ import division
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def l1(xs):
return np.array([np.... | bsd-3-clause |
epam/DLab | infrastructure-provisioning/src/general/lib/aws/actions_lib.py | 1 | 82712 | # *****************************************************************************
#
# Copyright (c) 2016, EPAM SYSTEMS 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.apac... | apache-2.0 |
Fireblend/scikit-learn | benchmarks/bench_plot_fastkmeans.py | 294 | 4676 | from __future__ import print_function
from collections import defaultdict
from time import time
import numpy as np
from numpy import random as nr
from sklearn.cluster.k_means_ import KMeans, MiniBatchKMeans
def compute_bench(samples_range, features_range):
it = 0
results = defaultdict(lambda: [])
chun... | bsd-3-clause |
ml-lab/neuralnilm | neuralnilm/rectangles.py | 4 | 2236 | from neuralnilm.utils import get_colors
def plot_rectangles(ax, single_example, plot_seq_width=1, offset=0, how='bar',
**plot_kwargs):
"""
Parameters
----------
ax : matplotlib axes
single_example : numpy.ndarray
A single example from within the batch.
i.e. sing... | apache-2.0 |
gregstarr/anomaly-detection | test.py | 1 | 1597 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 30 16:42:25 2017
@author: greg
"""
import numpy as np
from ranksvm_k import ranksvm_k
import matplotlib.pyplot as plt
from scipy.sparse import csr_matrix
from gregAD import knn_score
from scipy.io import loadmat
dic = np.load('arrays.npz')
l = len... | gpl-3.0 |
ndingwall/scikit-learn | examples/covariance/plot_mahalanobis_distances.py | 17 | 8149 | r"""
================================================================
Robust covariance estimation and Mahalanobis distances relevance
================================================================
This example shows covariance estimation with Mahalanobis
distances on Gaussian distributed data.
For Gaussian distrib... | bsd-3-clause |
mgarbanzo/radarphysics | capons.py | 1 | 1423 | #!/usr/bin/python
import numpy as np
from scipy import fftpack, pi
import matplotlib.pyplot as plt
from lags import *
N=64
m=16
Ts=1
freqs = -0.2, 0.2, -0.3, 0.3, 0.09
sgn = GenerateSignal(Ts, N, freqs)
#add some noise:
sgn = sgn + 1*np.random.rand(len(sgn))+ 1j*np.random.rand(len(sgn))
sgn = sgn-np.mean(sgn)
ary =... | gpl-3.0 |
NaturalHistoryMuseum/insect_analysis | vision/measurements/subspace_shape.py | 2 | 5525 | import numpy as np
from sklearn.neighbors import NearestNeighbors
from skimage.transform import SimilarityTransform, estimate_transform, matrix_transform
import matplotlib.pyplot as plt
import scipy
from skimage.filters import gaussian
def plot_closest_points(image_points, edge_points, closest_edge_points):
plt.p... | gpl-2.0 |
mengxn/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/io_test.py | 137 | 5063 | # 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 |
gwpy/gwsumm | gwsumm/tests/test_config.py | 1 | 8768 | # -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2013)
#
# This file is part of GWSumm.
#
# GWSumm 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) ... | gpl-3.0 |
kmike/scikit-learn | examples/applications/topics_extraction_with_nmf.py | 4 | 2690 | """
========================================================
Topics extraction with Non-Negative Matrix Factorization
========================================================
This is a proof of concept application of Non Negative Matrix
Factorization of the term frequency matrix of a corpus of documents so
as to extra... | bsd-3-clause |
gitporst/spotpy | spotpy/examples/3dplot.py | 1 | 1625 | '''
Copyright 2015 by Tobias Houska
This file is part of Statistical Parameter Estimation Tool (SPOTPY).
:author: Tobias Houska
This file shows how to make 3d surface plots.
'''
import spotpy
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection, Line3DCollection
from matplo... | mit |
aabadie/scikit-learn | examples/manifold/plot_mds.py | 88 | 2731 | """
=========================
Multi-dimensional scaling
=========================
An illustration of the metric and non-metric MDS on generated noisy data.
The reconstructed points using the metric MDS and non metric MDS are slightly
shifted to avoid overlapping.
"""
# Author: Nelle Varoquaux <nelle.varoquaux@gmail.... | bsd-3-clause |
rhyolight/nupic.research | projects/neural_correlations/EXP5-Bar/NeuCorr_Exp5.py | 10 | 8590 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# 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 ... | gpl-3.0 |
BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pandas/tests/test_categorical.py | 1 | 177721 | # -*- coding: utf-8 -*-
# pylint: disable=E1101,E1103,W0232
import os
import sys
from datetime import datetime
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
import pandas.compat as compat
import pandas.core.common as com
import pandas.util.testing as tm
from pandas import (Categor... | mit |
dblalock/dig | tests/datasets.py | 1 | 17068 | #!/bin/env python
# import functools
import os
import numpy as np
from sklearn.datasets.samples_generator import make_blobs
from joblib import Memory
_memory = Memory('.', verbose=1)
DATA_DIR = os.path.expanduser('~/Desktop/datasets/nn-search')
join = os.path.join
class Random:
UNIFORM = 'uniform'
GAUSS = ... | mit |
jseabold/scikit-learn | examples/cross_decomposition/plot_compare_cross_decomposition.py | 128 | 4761 | """
===================================
Compare cross decomposition methods
===================================
Simple usage of various cross decomposition algorithms:
- PLSCanonical
- PLSRegression, with multivariate response, a.k.a. PLS2
- PLSRegression, with univariate response, a.k.a. PLS1
- CCA
Given 2 multivari... | bsd-3-clause |
samuel1208/scikit-learn | sklearn/feature_extraction/tests/test_text.py | 75 | 34122 | from __future__ import unicode_literals
import warnings
from sklearn.feature_extraction.text import strip_tags
from sklearn.feature_extraction.text import strip_accents_unicode
from sklearn.feature_extraction.text import strip_accents_ascii
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.fe... | bsd-3-clause |
eickenberg/scikit-learn | examples/svm/plot_custom_kernel.py | 115 | 1546 | """
======================
SVM with custom kernel
======================
Simple usage of Support Vector Machines to classify a sample. It will
plot the decision surface and the support vectors.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
# import some data... | bsd-3-clause |
stainbank/simulocloud | simulocloud/visualise.py | 1 | 5885 | """ visualise.py
See, plot and visually explore pointclouds
"""
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import itertools
import simulocloud.exceptions
# Mapping of dimension to index in bounds
_IDIM = {'x': 0, 'y': 1, 'z': 2}
def scatter(pcs, dims, bounds=None, highlight=None,... | mit |
tejasapatil/spark | python/pyspark/sql/utils.py | 6 | 6334 | #
# 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 |
THEdavehogue/punxsutawney_phil_predictor | neural_net.py | 1 | 3350 | import theano
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD, RMSprop, Adagrad, Adam
import pandas as pd
import numpy as np
import cPickle as pickle
from sklearn.cross_validation import train_test_split
from ... | gpl-3.0 |
LLNL/spack | var/spack/repos/builtin/packages/py-pandas/package.py | 1 | 4929 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPandas(PythonPackage):
"""pandas is a fast, powerful, flexible and easy to use open sour... | lgpl-2.1 |
wagdav/talk-python-in-fusion-2015 | demo_working_environment.py | 1 | 1799 | """
1. Present working environment
* matplotlib axes are good primitives to pass around (not figures)
* separate content and apperance
- see more Grammar of Graphics, ggplot http://ggplot.yhathq.com/
* re-use 'plots' on other figures
2. Implement highlight_y and make_bw_friendly functions
"""
imp... | mit |
rhyolight/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_wxagg.py | 70 | 9051 | from __future__ import division
"""
backend_wxagg.py
A wxPython backend for Agg. This uses the GUI widgets written by
Jeremy O'Donoghue (jeremy@o-donoghue.com) and the Agg backend by John
Hunter (jdhunter@ace.bsd.uchicago.edu)
Copyright (C) 2003-5 Jeremy O'Donoghue, John Hunter, Illinois Institute of
Technolo... | agpl-3.0 |
drodarie/nest-simulator | pynest/examples/hh_phaseplane.py | 9 | 4973 | # -*- coding: utf-8 -*-
#
# hh_phaseplane.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 |
probml/pyprobml | scripts/prior_post_pred_binom_pymc3.py | 1 | 1898 | # prior and posterior predctiive for beta binomial
# fig 1.6 of 'Bayeysian Modeling and Computation'
import arviz as az
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pymc3 as pm
from scipy import stats
from scipy.stats import entropy
from scipy.optimize import minimize
import pyprobml_... | mit |
mehdidc/scikit-learn | sklearn/datasets/tests/test_svmlight_format.py | 28 | 10792 | from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... | bsd-3-clause |
JeanKossaifi/scikit-learn | examples/model_selection/plot_validation_curve.py | 229 | 1823 | """
==========================
Plotting Validation Curves
==========================
In this plot you can see the training scores and validation scores of an SVM
for different values of the kernel parameter gamma. For very low values of
gamma, you can see that both the training score and the validation score are
low. ... | bsd-3-clause |
lmallin/coverage_test | python_venv/lib/python2.7/site-packages/pandas/tests/io/formats/test_style.py | 3 | 36182 | import copy
import textwrap
import pytest
import numpy as np
import pandas as pd
from pandas import DataFrame
import pandas.util.testing as tm
jinja2 = pytest.importorskip('jinja2')
from pandas.io.formats.style import Styler, _get_level_lengths # noqa
class TestStyler(object):
def setup_method(self, method):
... | mit |
vermouthmjl/scikit-learn | examples/applications/topics_extraction_with_nmf_lda.py | 38 | 3869 | """
=======================================================================================
Topic extraction with Non-negative Matrix Factorization and Latent Dirichlet Allocation
=======================================================================================
This is an example of applying Non-negative Matrix ... | bsd-3-clause |
kfogel/batman | batman/plots.py | 1 | 2325 | # The batman package: fast computation of exoplanet transit light curves
# Copyright (C) 2015 Laura Kreidberg
#
# 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... | gpl-3.0 |
bsautermeister/tensorflow-handwriting-demo | tensorflow/training.py | 1 | 10237 | """ Trains a model on handwriting data. """
from __future__ import absolute_import, division, print_function
import os
import sys
import time
import math
import argparse
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.core.protobuf import saver_pb2
import utils.ui
import utils.tensor
import u... | mit |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/lib/mpl_examples/units/evans_test.py | 9 | 2325 | """
A mockup "Foo" units class which supports
conversion and different tick formatting depending on the "unit".
Here the "unit" is just a scalar conversion factor, but this example shows mpl is
entirely agnostic to what kind of units client packages use
"""
from matplotlib.cbook import iterable
import matplotlib.units ... | mit |
ekansa/open-context-py | opencontext_py/apps/imports/kobotoolbox/utilities.py | 1 | 9698 | from time import sleep
import uuid as GenUUID
import os, sys, shutil
import numpy as np
import pandas as pd
import xlrd
from django.conf import settings
from opencontext_py.apps.ocitems.manifest.models import Manifest
LABEL_ALTERNATIVE_PARTS = {
# Keyed by project_uuid
'DF043419-F23B-41DA-7E4D-EE52AF22F92F': {... | gpl-3.0 |
tgsmith61591/pyramid | pmdarima/utils/tests/test_array.py | 1 | 6931 |
from pmdarima.utils.array import diff, diff_inv, c, is_iterable, as_series, \
check_exog
from pmdarima.utils import get_callable
from numpy.testing import assert_array_equal, assert_array_almost_equal
import pytest
import pandas as pd
import numpy as np
x = np.arange(5)
m = np.array([10, 5, 12, 23, 18, 3, 2, 0, ... | mit |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/mpl_toolkits/axisartist/axislines.py | 7 | 26173 | """
Axislines includes modified implementation of the Axes class. The
biggest difference is that the artists responsible to draw axis line,
ticks, ticklabel and axis labels are separated out from the mpl's Axis
class, which are much more than artists in the original
mpl. Originally, this change was motivated to support... | mit |
chuckchen/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 |
ghislainp/iris | docs/iris/example_code/Meteorology/TEC.py | 12 | 1054 | """
Ionosphere space weather
========================
This space weather example plots a filled contour of rotated pole point
data with a shaded relief image underlay. The plot shows aggregated
vertical electron content in the ionosphere.
The plot exhibits an interesting outline effect due to excluding data
values be... | gpl-3.0 |
ycaihua/scikit-learn | examples/exercises/plot_iris_exercise.py | 323 | 1602 | """
================================
SVM Exercise
================================
A tutorial exercise for using different SVM kernels.
This exercise is used in the :ref:`using_kernels_tut` part of the
:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`.
"""
print(__doc__)
import numpy as np
i... | bsd-3-clause |
minxuancao/shogun | examples/undocumented/python_modular/graphical/interactive_gp_demo.py | 10 | 14176 | #
# 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 (C) 2012 Heiko Strathmann, based on interactive_svm_demo by ... | gpl-3.0 |
pluskid/mxnet | example/bayesian-methods/bdk_demo.py | 15 | 15051 | from __future__ import print_function
import mxnet as mx
import mxnet.ndarray as nd
import numpy
import logging
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
import argparse
from algos import *
from data_loader import *
from utils import *
class CrossEntropySoftmax(mx.operator.NumpyOp):
def... | apache-2.0 |
srowen/spark | python/pyspark/pandas/tests/test_utils.py | 15 | 3850 | #
# 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 |
dkazanc/TomoPhantom | Demos/Python/3D/Object3D.py | 1 | 2274 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Note that the TomoPhantom package is released under Apache License, Version 2.0
Script to generate 3D analytical objects and their projection data
Recursively adding objects one can build a required model with the corresponding projection data
@author: Daniil Kazants... | apache-2.0 |
nicolas998/wmf | wmf/plots.py | 2 | 6066 | #!plots.py: conjunto de herramientas para hacer plots de resultados de simulacion
#!Copyright (C) <2018> <Nicolas Velasquez Giron>
#!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 versio... | gpl-3.0 |
deanmalmgren/scrubadub | tests/test_detector_address.py | 1 | 1830 | import pandas as pd
import zipfile
import pathlib
import requests
import unittest
import warnings
import scrubadub
class AddressTestCase(unittest.TestCase):
def setUp(self) -> None:
import scrubadub.detectors.address
def tearDown(self) -> None:
if scrubadub.detectors.AddressDetector.name in ... | mit |
dwillmer/numpy | numpy/core/fromnumeric.py | 9 | 98023 | """Module containing non-deprecated functions borrowed from Numeric.
"""
from __future__ import division, absolute_import, print_function
import types
import warnings
import numpy as np
from .. import VisibleDeprecationWarning
from . import multiarray as mu
from . import umath as um
from . import numerictypes as nt
... | bsd-3-clause |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/tools/test_numeric.py | 2 | 17980 | import decimal
import numpy as np
from numpy import iinfo
import pytest
import pandas as pd
from pandas import DataFrame, Index, Series, to_numeric
from pandas.util import testing as tm
@pytest.fixture(params=[None, "ignore", "raise", "coerce"])
def errors(request):
return request.param
@pytest.fixture(params... | apache-2.0 |
mjabri/holoviews | holoviews/plotting/mpl/plot.py | 1 | 43893 | from __future__ import division
from collections import defaultdict
import numpy as np
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D # pyflakes:ignore (For 3D plots)
from matplotlib import pyplot as plt
from matplotlib import gridspec, animation
import param
from ...core import OrderedDict, HoloM... | bsd-3-clause |
larsoner/mne-python | mne/externals/tqdm/_tqdm/gui.py | 14 | 11601 | """
GUI progressbar decorator for iterators.
Includes a default (x)range iterator printing to stderr.
Usage:
>>> from tqdm.gui import trange[, tqdm]
>>> for i in trange(10): #same as: for i in tqdm(xrange(10))
... ...
"""
# future division is important to divide integers and get as
# a result precise floatin... | bsd-3-clause |
theoryno3/scikit-learn | examples/cluster/plot_cluster_iris.py | 350 | 2593 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
K-means Clustering
=========================================================
The plots display firstly what a K-means algorithm would yield
using three clusters. It is then shown what the effect of a bad
initializa... | bsd-3-clause |
ldirer/scikit-learn | examples/cluster/plot_face_segmentation.py | 26 | 2561 | """
===================================================
Segmenting the picture of a raccoon face in regions
===================================================
This example uses :ref:`spectral_clustering` on a graph created from
voxel-to-voxel difference on an image to break this image into multiple
partly-homogeneous... | bsd-3-clause |
algui91/GraphicNetworkMonitoring | src/test.py | 1 | 1286 | #!/usr/bin/env python3.2
"""
Graphic Network Monitoring tool
"""
__author__ = """Alejandro Alcalde (algui91@gmail.com)"""
try:
import matplotlib.pyplot as plt
except:
raise
import json
import networkx as nx
from networkx.algorithms import bipartite
import gnm
def pretty(d, indent=0):
lTam ... | gpl-3.0 |
annoviko/pyclustering | pyclustering/nnet/tests/unit/ut_sync.py | 1 | 8703 | """!
@brief Unit-tests for Oscillatory Neural Network based on Kuramoto model.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
import unittest;
# Generate images without having a window appear.
import matplotlib;
matplotlib.use('Agg');
from pyclustering... | gpl-3.0 |
c11/yatsm | yatsm/regression/pickles/serialize.py | 3 | 1859 | """ Setup script to pickle various statistical estimators for distribution
Available pickles to build:
* glmnet_Lasso20.pkl
* sklearn_Lasso20.pkl
"""
from __future__ import print_function
import json
import logging
import os
import traceback
# Don't alias to ``np``: https://github.com/numba/numba/issues/155... | mit |
github4ry/pathomx | pathomx/figures.py | 2 | 21263 | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from collections import OrderedDict
from . import utils
# from matplotlib.figure import Figure
from matplotlib.path import Path
from matplotlib.patches import BoxStyle, Ellipse, Rectangle
from matplotlib.transforms import Affine2D, Bbox, BboxBase
import ... | gpl-3.0 |
ondrolexa/pypsbuilder | setup.py | 1 | 1751 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
CURRENT_PATH = path.abspath(path.dirname(__file__))
with open(path.join(CURRENT_PATH, 'README.md')) as readme_file:
readme = readme_file.read()
with open(path.join(CURRENT_PATH, 'CHANGELOG.md')) as chang... | gpl-3.0 |
soccermetrics/marcotti-events | marcottievents/etl/base/workflows.py | 1 | 2927 | from datetime import date
import pandas as pd
from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
from marcottievents.models.common.suppliers import Suppliers
class ETL(object):
"""
Top-level ETL workflow.
Receive extracted data from XML and/or CSV sources, transform/validate it, and loa... | mit |
fredhusser/scikit-learn | sklearn/utils/fixes.py | 133 | 12882 | """Compatibility fixes for older version of python, numpy and scipy
If you add content to this file, please give the version of the package
at which the fixe is no longer needed.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# ... | bsd-3-clause |
understar/imgcls4wmts | utils/train.py | 1 | 1060 | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 04 20:34:11 2014
@author: Administrator
"""
import logging
import numpy as np
from sklearn.multiclass import OneVsRestClassifier
from sklearn.svm import LinearSVC
from sklearn.metrics import confusion_matrix
logging.getLogger().setLevel(logging.INFO)
logging.info('Load... | bsd-2-clause |
neerajhirani/BDA_py_demos | demos_ch11/demo11_1.py | 19 | 14478 | """Bayesian data analysis
Chapter 11, demo 1
Gibbs sampling demonstration
"""
from __future__ import division
import threading
import numpy as np
import scipy.io # For importing a matlab file
from scipy import linalg, stats
import matplotlib as mpl
import matplotlib.pyplot as plt
# edit default plot settings (colou... | gpl-3.0 |
MonsieurV/py-findpeaks | tests/libs/findpeaks.py | 1 | 1767 | """ Searches for peaks in data
History:
-nov 2015: Janko Slavic, update
-mar 2013: janko.slavic@fs.uni-lj.si
"""
import numpy as np
def findpeaks(data, spacing=1, limit=None):
"""Finds peaks in `data` which are of `spacing` width and >=`limit`.
:param data: values
:param spacing: mi... | mit |
Ernestyj/PyStudy | finance/DaysTest/TestingFusion.py | 1 | 11643 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import talib
from pyalgotrade import strategy, plotter
from pyalgotrade.broker.backtesting import TradePercentage, Broker
from pyalgotrade.broker import Order
from pyalgotrade.barfeed import yahoofeed
... | apache-2.0 |
Lawrence-Liu/scikit-learn | examples/ensemble/plot_adaboost_hastie_10_2.py | 355 | 3576 | """
=============================
Discrete versus Real AdaBoost
=============================
This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates
the difference in performance between the discrete SAMME [2] boosting
algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate... | bsd-3-clause |
lmr/autotest | frontend/tko/graphing_utils.py | 2 | 32598 | import base64
import tempfile
import pickle
import datetime
import django
import os.path
import getpass
from math import sqrt
# When you import matplotlib, it tries to write some temp files for better
# performance, and it does that to the directory in MPLCONFIGDIR, or, if that
# doesn't exist, the home directory. Pro... | gpl-2.0 |
UMN-Hydro/GSFLOW_pre-processor | python_scripts/GSFLOW_print_controlfile_Shullcas.py | 1 | 22307 | """
Created on Sun Sep 10 22:06:46 2017
Converting from GSFLOW_print_controlfile4_gcng_melt30yr.m
Creates inputs files to run GSFLOW, based on the "Sagehen" example but
modified for Chimborazo's Gavilan Machay watershed. Crystal's AGU2016
poster.
GSFLOW Input files:
- control file (generate with GSFLOW_print_... | gpl-3.0 |
inonchiu/ComEst | comest/py2dmatch.py | 1 | 18934 | #############
#
# Match two sets of data in the 2d plane.
# I.e., find nearest neighbor of one that's in the other.
# This routine is modified from some scripts I found online, forgot whom I looked for...
# Please let me know if you are the author.
#
# I copy the astropy.stats.sigma_clipping in this module for sigma cl... | mit |
nyirock/mg_blast_wrapper | mg_blast_wrapper_v1.10.py | 1 | 19368 | #!/usr/bin/python
import getopt
import sys
from Bio import SeqIO
import time
import os
import shutil
import pandas
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
__author__ = "Andriy Sheremet"
#Helper functions definitions
def genome_shredder(input_dct, shear_val):
shredded = {}
for key, v... | mit |
mne-tools/mne-tools.github.io | 0.21/_downloads/d5061624de1ba2be808df117f8a2ada0/plot_decoding_xdawn_eeg.py | 4 | 4591 | """
============================
XDAWN Decoding From EEG data
============================
ERP decoding with Xdawn ([1]_, [2]_). For each event type, a set of
spatial Xdawn filters are trained and applied on the signal. Channels are
concatenated and rescaled to create features vectors that will be fed into
a logistic ... | bsd-3-clause |
alexlee-gk/visual_dynamics | scripts/plot_concise_results.py | 1 | 6691 | import argparse
import csv
import os
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--experiment_name', choices=['fqi', 'all'], default='fqi')
parser.add_argument('--results_dir', type=str, default='results')
... | mit |
manics/openmicroscopy | components/tools/OmeroPy/src/omero/install/jvmcfg.py | 1 | 16238 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
# 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
# th... | gpl-2.0 |
juanka1331/VAN-applied-to-Nifti-images | lib/data_loader/PET_stack_NORAD.py | 1 | 1951 | import scipy.io as sio
import settings
import numpy as np
import nibabel as nib
from matplotlib import pyplot as plt
def get_parameters():
"""
function creates to avoid loading in memory the full stack
:return: Dict['imgsize|total_size|voxel_index]
"""
f = sio.loadmat(settings.PET_stack_path)
... | gpl-2.0 |
adrinjalali/Network-Classifier | parse_results.py | 1 | 19468 | import matplotlib as mpl
#mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pickle
import sys
import os
import re
import glob
from joblib import Parallel, delayed, logger
from itertools import chain
from scipy.stats import gaussian_kde
from plot_ratboost import generate_graph_plots
from plot_ra... | gpl-3.0 |
mjasher/gac | GAC/flopy/utils/datafile.py | 1 | 16152 | """
Module to read MODFLOW output files. The module contains shared
abstract classes that should not be directly accessed.
"""
from __future__ import print_function
import numpy as np
import flopy.utils
class Header():
"""
The header class is an abstract base class to create headers for MODFLOW fi... | gpl-2.0 |
rrohan/scikit-learn | examples/tree/plot_tree_regression_multioutput.py | 206 | 1800 | """
===================================================================
Multi-output Decision Tree Regression
===================================================================
An example to illustrate multi-output regression with decision tree.
The :ref:`decision trees <tree>`
is used to predict simultaneously the ... | bsd-3-clause |
ankurankan/scikit-learn | sklearn/metrics/pairwise.py | 1 | 41106 | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Robert Layton <robertlayton@gmail.com>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Philippe Gervais <philippe.gervais@inria.fr>
# Lars Buitinck ... | bsd-3-clause |
nelango/ViralityAnalysis | model/lib/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... | mit |
mugizico/scikit-learn | sklearn/datasets/tests/test_mldata.py | 384 | 5221 | """Test functionality of mldata fetching utilities."""
import os
import shutil
import tempfile
import scipy as sp
from sklearn import datasets
from sklearn.datasets import mldata_filename, fetch_mldata
from sklearn.utils.testing import assert_in
from sklearn.utils.testing import assert_not_in
from sklearn.utils.test... | bsd-3-clause |
dsibournemouth/autoweka | scripts/plot_signal.py | 2 | 2699 | import argparse
import numpy as np
import os
import traceback
import matplotlib.pyplot as plt
from config import *
def plot_target_vs_prediction(targets, predictions, limit, title):
plt.close()
plt.plot(targets)
plt.plot(predictions)
plt.axvline(limit, color='r', linestyle='--')
plt.title(tit... | gpl-3.0 |
markYoungH/chromium.src | ppapi/native_client/tests/breakpad_crash_test/crash_dump_tester.py | 154 | 8545 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
import tempfile
import time
script_dir = os.path.dirname(__file__)
sys.path.append(os.path.join... | bsd-3-clause |
bbusemeyer/busempyer | busempyer/process_record.py | 2 | 31828 | import numpy as np
import json
import data_processing as dp
import pandas as pd
from pymatgen.io.cif import CifParser
# TODO generalize!
VARTOL = 1e-2
NFE = 8
NORBFE = 10
NORBCH = 4
SMALLSPIN = 1.0 # Spins less than this are considered zero.
def fluctdat_array(jsondat,key='value'):
''' Turn the dictionary of fluct... | gpl-2.0 |
imito/odin | examples/nist_sre/analyze.py | 1 | 6119 | from __future__ import print_function, division, absolute_import
import os
os.environ['ODIN'] = 'gpu,float32'
import shutil
from collections import defaultdict
import numpy as np
import tensorflow as tf
from odin import fuel as F
from odin import nnet as N, backend as K
from odin.utils import (ctext, mpi, Progbar, c... | mit |
GuessWhoSamFoo/pandas | pandas/core/indexes/interval.py | 2 | 45940 | """ define the IntervalIndex """
import textwrap
import warnings
import numpy as np
from pandas._libs import Timedelta, Timestamp
from pandas._libs.interval import Interval, IntervalMixin, IntervalTree
from pandas.compat import add_metaclass
from pandas.util._decorators import Appender, cache_readonly
from pandas.uti... | bsd-3-clause |
abramhindle/marsyas-fork | scripts/Python/icme2011_plot_dtw.py | 7 | 1697 | #!/usr/bin/python
#
# Run DTW on all .txt files in this directory, and generate a
# matrix from this
#
import sys
import os
import datetime
import commands
import re
import numpy as np
import matplotlib.pyplot as plt
import mlpy
if len(sys.argv) != 3:
print "Usage: icme2001_dtw_matrix.py path output_file"
ex... | gpl-2.0 |
LukasMosser/Jupetro | notebooks/casing_plot.py | 1 | 2894 | import matplotlib.pyplot as plt
def plot_casing_setting_depths(ax, fracture_pressure, pore_pressure, TVD_frac, TVD_pore,
fracture_pressure_safety=None, pore_pressure_safety=None,
casing_seats_ppg=None, casing_seats_tvd=None):
"""
This is a simp... | gpl-3.0 |
SusanJL/iris | lib/iris/tests/unit/quickplot/test_pcolormesh.py | 11 | 2344 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
DmitryOdinoky/sms-tools | lectures/07-Sinusoidal-plus-residual-model/plots-code/stochasticSynthesisFrame.py | 24 | 2966 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, hanning, triang, blackmanharris, resample
import math
import sys, os, time
from scipy.fftpack import fft, ifft
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import utilFunction... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.