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 |
|---|---|---|---|---|---|
alan-unravel/bokeh | bokeh/crossfilter/plotting.py | 42 | 8763 | from __future__ import absolute_import
import numpy as np
import pandas as pd
from bokeh.models import ColumnDataSource, BoxSelectTool
from ..plotting import figure
def cross(start, facets):
"""Creates a unique combination of provided facets.
A cross product of an initial set of starting facets with a new se... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/pandas/tests/frame/test_misc_api.py | 7 | 16059 | # -*- coding: utf-8 -*-
from __future__ import print_function
# pylint: disable-msg=W0612,E1101
from copy import deepcopy
import sys
import nose
from distutils.version import LooseVersion
from pandas.compat import range, lrange
from pandas import compat
from numpy.random import randn
import numpy as np
from pandas ... | gpl-3.0 |
jenshnielsen/HJCFIT | documentation/source/conf.py | 1 | 10215 | # -*- coding: utf-8 -*-
#
# DCProgs documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 31 17:46:57 2013.
#
# 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.
#
# All... | gpl-3.0 |
flightgong/scikit-learn | sklearn/neighbors/base.py | 1 | 23514 | """Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output... | bsd-3-clause |
bijanfallah/OI_CCLM | src/RMSE_SPREAD_MAPS.py | 1 | 15003 | # Program to show the maps of RMSE averaged over time
import matplotlib.pyplot as plt
from sklearn.metrics import mean_squared_error
import os
from netCDF4 import Dataset as NetCDFFile
import numpy as np
from CCLM_OUTS import Plot_CCLM
# option == 1 -> shift 4 with default cclm domain and nboundlines = 3
# option == 2... | mit |
pascalgutjahr/Praktikum-1 | Beugung/einzel.py | 1 | 1926 | import matplotlib as mpl
from scipy.optimize import curve_fit
mpl.use('pgf')
import matplotlib.pyplot as plt
plt.rcParams['lines.linewidth'] = 1
import numpy as np
mpl.rcParams.update({
'font.family': 'serif',
'text.usetex': True,
'pgf.rcfonts': False,
'pgf.texsystem': 'lualatex',
'pgf.preamble': r'\usepackage{unicode... | mit |
anne-urai/serialDDM | simulations/DDM_fits.py | 1 | 8631 | #!/usr/bin/env python
# encoding: utf-8
"""
Created by Jan Willem de Gee on 2011-02-16.
Copyright (c) 2011 __MyCompanyName__. All rights reserved.
"""
import os, sys, pickle, time
import datetime
import collections
import math
import numpy as np
import scipy as sp
import matplotlib
matplotlib.use('Agg')
import matplotl... | mit |
zangsir/sms-tools | lectures/05-Sinusoidal-model/plots-code/sineModelAnal-bendir.py | 24 | 1245 | import numpy as np
import matplotlib.pyplot as plt
import sys, os, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import stft as STFT
import sineModel as SM
import utilFunctions as UF
(fs, x) = UF.wavread(os.path.join(os.path.dirname(os.path.realpath(__fi... | agpl-3.0 |
ruleva1983/udacity-selfdrivingcar | term1/P4_advanced_lane_finding/classes.py | 1 | 13102 | import cv2
import numpy as np
import os
from moviepy.editor import VideoFileClip
from IPython.display import display, HTML
from preprocess import Masker, DistRemover, PersTransformer
from utils import superimpose_images
class Line(object):
"""
A class that holds the a single road line. Usually instantiated
... | gpl-3.0 |
nickp60/open_utils | grabHits/grabHits.py | 1 | 8667 | #!/usr/bin/env python
"""
version 0.1
Minor version changes:
- pep8 can make output directories directly
Given a nucleotide sequence, get pfam stuff with their rest api, return
USAGE:
$ python snagnblast.py accessions.txt_or_accessions.csv /BLAST/directory/ /output/directory/
"""
print("Warning! This script is de... | mit |
ScreamingUdder/mantid | qt/applications/workbench/workbench/plotting/functions.py | 1 | 7142 | # This file is part of the mantid workbench.
#
# Copyright (C) 2017 mantidproject
#
# 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) a... | gpl-3.0 |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/userdemo/connectionstyle_demo.py | 1 | 3917 | """
====================
Connectionstyle Demo
====================
"""
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from mpl_toolkits.axes_grid1.axes_grid import AxesGrid
from matplotlib.offsetbox import AnchoredText
# nodebox section
if __name__ == '__builtin__':
# were in nodebox
i... | mit |
tomsilver/NAB | nab/runner.py | 1 | 9309 | # ----------------------------------------------------------------------
# Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/... | gpl-3.0 |
anhaidgroup/py_entitymatching | py_entitymatching/feature/addfeatures.py | 1 | 17935 | """
This module contains functions to add a feature to feature table.
"""
import logging
import pandas as pd
import six
from py_entitymatching.utils.validation_helper import validate_object_type
logger = logging.getLogger(__name__)
def get_feature_fn(feature_string, tokenizers, similarity_functions):
"""
T... | bsd-3-clause |
std05048/Thesis | src/core/examples/sample-rng-plot.py | 188 | 1246 | # -*- Mode:Python; -*-
# /*
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRA... | gpl-2.0 |
JosmanPS/scikit-learn | examples/mixture/plot_gmm_selection.py | 248 | 3223 | """
=================================
Gaussian Mixture Model Selection
=================================
This example shows that model selection can be performed with
Gaussian Mixture Models using information-theoretic criteria (BIC).
Model selection concerns both the covariance type
and the number of components in th... | bsd-3-clause |
coreymason/LAHacks2017 | web/linear_regression_engine.py | 1 | 2084 | import warnings
warnings.filterwarnings(action="ignore", module="scipy", message="^internal gelsd")
import pandas as pd
import numpy as np
import sklearn.linear_model as skl
import matplotlib.pyplot as plt
reg = skl.LinearRegression()
data = pd.read_csv('sleep_quality_data.csv', index_col=0)
x_train = data.as_matrix(... | mit |
tcm129/trading-with-python | nautilus/nautilus.py | 77 | 5403 | '''
Created on 26 dec. 2011
Copyright: Jev Kuznetsov
License: BSD
'''
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from ib.ext.Contract import Contract
from ib.opt import ibConnection
from ib.ext.Order import Order
import tradingWithPython.lib.logger as logger
from tradingWithPython.lib.eve... | bsd-3-clause |
rdempsey/python-for-sharing | practical-predictive-modeling-in-python/scoring code/bin/tlo_verification_and_matching.py | 1 | 3347 | #!/usr/bin/env python
# encoding: utf-8
"""
tlo_verification_and_matching.py
Created by Robert Dempsey on 05/18/2015
Updated by Robert Dempsey on 07/29/2015
"""
import pickle
def verify_record(record_scores):
"""
Given a pandas dataframe with the scores for a record, a record is either verified (1) or non-v... | mit |
sql-machine-learning/sqlflow | python/runtime/optimize/model_generation_test.py | 1 | 14369 | # Copyright 2020 The SQLFlow 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 applicable law o... | apache-2.0 |
nadvamir/deep-learning | weight-initialization/helper.py | 153 | 3649 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
def hist_dist(title, distribution_tensor, hist_range=(-4, 4)):
"""
Display histogram of a TF distribution
"""
with tf.Session() as sess:
values = sess.run(distribution_tensor)
plt.title(title)
plt.hist(values, ... | mit |
jviada/QuantEcon.py | examples/illustrates_lln.py | 7 | 1802 | """
Filename: illustrates_lln.py
Authors: John Stachurski and Thomas J. Sargent
Visual illustration of the law of large numbers.
"""
import random
import numpy as np
from scipy.stats import t, beta, lognorm, expon, gamma, poisson
import matplotlib.pyplot as plt
n = 100
# == Arbitrary collection of distributions == ... | bsd-3-clause |
sightmachine/SimpleCV | SimpleCV/MachineLearning/ShapeContextClassifier.py | 12 | 6161 | from SimpleCV.base import *
from SimpleCV.Features.Features import Feature, FeatureSet
from SimpleCV.Color import Color
from SimpleCV.ImageClass import Image
from SimpleCV.Features.Detection import ShapeContextDescriptor
import math
import scipy.stats as sps
"""
Classify an object based on shape context
"""
class Sha... | bsd-3-clause |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_find_ecg_artifacts.py | 14 | 1313 | """
==================
Find ECG artifacts
==================
Locate QRS component of ECG.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
print(_... | bsd-3-clause |
chen0510566/MissionPlanner | Lib/site-packages/scipy/signal/waveforms.py | 55 | 11609 | # Author: Travis Oliphant
# 2003
#
# Feb. 2010: Updated by Warren Weckesser:
# Rewrote much of chirp()
# Added sweep_poly()
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
exp, cos, sin, polyval, polyint
def sawtooth(t, width=1):
"""
Return a periodic sawtooth waveform.
... | gpl-3.0 |
ZENGXH/scikit-learn | sklearn/grid_search.py | 103 | 36232 | """
The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters
of an estimator.
"""
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# ... | bsd-3-clause |
sanja7s/SR_Twitter | src_CAPITAL/BI_assortatvitity.py | 1 | 2426 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
analyze assortativity of the graphs in terms of sentiment
'''
from igraph import *
import networkx as nx
import os
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import os
import matplotlib.cm as cm
from collections import defaultdict... | mit |
multivac61/pv | pv.py | 1 | 4658 | import argparse
from sys import float_info
from math import ceil
import numpy as np
from numpy.fft import fft, ifft
from scipy.io import wavfile
import matplotlib.pyplot as plt
def stretch(x, alpha, window, num_channels, synthesis_hop_factor):
"""
Perform time stretch of a factor alpha to signal x
x: inpu... | mit |
blaze/dask | dask/dataframe/io/tests/test_io.py | 3 | 22234 | import numpy as np
import pandas as pd
import pytest
from threading import Lock
from multiprocessing.pool import ThreadPool
import dask.array as da
import dask.dataframe as dd
from dask.dataframe._compat import tm
from dask.dataframe.io.io import _meta_from_array
from dask.delayed import Delayed, delayed
from dask.u... | bsd-3-clause |
hep-cce/ml_classification_studies | cosmoDNN/GAN/GANlens.py | 2 | 10732 | from __future__ import print_function
import keras
from keras.models import Sequential, Model
from keras.layers import Input, Dense, Dropout, merge, Reshape
from keras import backend as K
import numpy as np
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Conv2D, ... | gpl-3.0 |
kiyoto/statsmodels | statsmodels/tsa/tests/test_arima.py | 9 | 89483 | import warnings
from statsmodels.compat.python import lrange, BytesIO
import numpy as np
from nose.tools import nottest
from numpy.testing import (assert_almost_equal, assert_, assert_allclose,
assert_raises, dec, TestCase)
from statsmodels.tools.testing import assert_equal
import statsmodel... | bsd-3-clause |
yanchen036/tensorflow | tensorflow/contrib/timeseries/examples/multivariate.py | 67 | 5155 | # Copyright 2017 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 |
qifeigit/scikit-learn | sklearn/tests/test_learning_curve.py | 225 | 10791 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.learning_curve import learning_curve, validation_curve
from sklearn.u... | bsd-3-clause |
aalmah/pylearn2 | pylearn2/models/tests/test_svm.py | 28 | 1398 | """Tests for DenseMulticlassSVM"""
from __future__ import print_function
from pylearn2.datasets.mnist import MNIST
from pylearn2.testing.skip import skip_if_no_sklearn, skip_if_no_data
import numpy as np
from theano.compat.six.moves import xrange
import unittest
DenseMulticlassSVM = None
class TestSVM(unittest.TestC... | bsd-3-clause |
wlamond/scikit-learn | examples/cluster/plot_adjusted_for_chance_measures.py | 105 | 4300 | """
==========================================================
Adjustment for chance in clustering performance evaluation
==========================================================
The following plots demonstrate the impact of the number of clusters and
number of samples on various clustering performance evaluation me... | bsd-3-clause |
ilayn/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 |
sgenoud/scikit-learn | sklearn/metrics/__init__.py | 1 | 1038 | """
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .metrics import confusion_matrix, roc_curve, auc, precision_score, \
recall_score, fbeta_score, f1_score, zero_one_score, \
precision_recall_fscor... | bsd-3-clause |
jereze/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 |
mattilyra/scikit-learn | sklearn/neighbors/tests/test_kde.py | 80 | 5560 | import numpy as np
from sklearn.utils.testing import (assert_allclose, assert_raises,
assert_equal)
from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors
from sklearn.neighbors.ball_tree import kernel_norm
from sklearn.pipeline import make_pipeline
from sklearn.dataset... | bsd-3-clause |
aabadie/scikit-learn | sklearn/metrics/tests/test_pairwise.py | 13 | 26241 | import numpy as np
from numpy import linalg
from scipy.sparse import dok_matrix, csr_matrix, issparse
from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing impo... | bsd-3-clause |
murali-munna/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 |
mattbellis/hmis | tests/test_general.py | 1 | 2643 | import hmis
import unittest
import datetime as datetime
import pandas as pd
import sys
filename = 'test_data/hmis_test_data.pkl'
master_dictionary = hmis.read_dictionary_file(filename)
def test_calc_age():
ex_birthdate = hmis.get_date_from_string('1995-05-30')
now = hmis.get_date_from_string('2017-08-22'... | mit |
pvlib/pvlib-python | pvlib/iotools/bsrn.py | 3 | 6686 | """Functions to read data from the Baseline Surface Radiation Network (BSRN).
.. codeauthor:: Adam R. Jensen<adam-r-j@hotmail.com>
"""
import pandas as pd
import gzip
COL_SPECS = [(0, 3), (4, 9), (10, 16), (16, 22), (22, 27), (27, 32), (32, 39),
(39, 45), (45, 50), (50, 55), (55, 64), (64, 70), (... | bsd-3-clause |
rlzijdeman/nlgis2 | maps/bin/viewer.py | 4 | 2527 |
# coding: utf-8
# In[1]:
#!/usr/bin/python
import urllib2
import simplejson
import json
import sys
from shapely.geometry import shape, Polygon, MultiPolygon
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from pylab import *
# Example of polygon
co1 = {"type": "Polygon", "coordinates": [
[... | gpl-3.0 |
KellyChan/python-examples | cpp/deeplearning/caffe/examples/web_demo/app.py | 41 | 7793 | import os
import time
import cPickle
import datetime
import logging
import flask
import werkzeug
import optparse
import tornado.wsgi
import tornado.httpserver
import numpy as np
import pandas as pd
from PIL import Image
import cStringIO as StringIO
import urllib
import exifutil
import caffe
REPO_DIRNAME = os.path.abs... | mit |
wateraccounting/wa | General/data_conversions.py | 1 | 16172 | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 18 13:07:32 2016
@author: tih
"""
import gzip
import zipfile
import gdal
import osr
import os
import pandas as pd
import numpy as np
import netCDF4
import time
def Convert_nc_to_tiff(input_nc, output_folder):
"""
This function converts the nc file into tiff files... | apache-2.0 |
BiaDarkia/scikit-learn | sklearn/model_selection/tests/test_split.py | 21 | 57285 | """Test the split module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix, csc_matrix, csr_matrix
from scipy import stats
from itertools import combinations
from itertools import combinations_with_replacement
from sklearn.utils.testing import assert_true
from s... | bsd-3-clause |
raymond91125/TissueEnrichmentAnalysis | tea_paper_docs/src/hgf_benchmark_script.py | 4 | 14884 | # -*- coding: utf-8 -*-
"""
A script to benchmark TEA.
@david angeles
dangeles@caltech.edu
"""
import tissue_enrichment_analysis as tea # the library to be used
import pandas as pd
import os
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import re
import matplotlib as mpl
sns.set_context('... | mit |
ilyes14/scikit-learn | examples/linear_model/plot_logistic_l1_l2_sparsity.py | 384 | 2601 | """
==============================================
L1 Penalty and Sparsity in Logistic Regression
==============================================
Comparison of the sparsity (percentage of zero coefficients) of solutions when
L1 and L2 penalty are used for different values of C. We can see that large
values of C give mo... | bsd-3-clause |
arjoly/scikit-learn | sklearn/utils/tests/test_fixes.py | 281 | 1829 | # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Justin Vincent
# Lars Buitinck
# License: BSD 3 clause
import numpy as np
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_true
from numpy.testing import (assert_almost_equal,
... | bsd-3-clause |
LiaoPan/scikit-learn | sklearn/linear_model/omp.py | 127 | 30417 | """Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
from distutils.version import LooseVersion
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel, _pre_fit
from ..base import RegressorM... | bsd-3-clause |
lancezlin/ml_template_py | lib/python2.7/site-packages/matplotlib/tests/test_coding_standards.py | 7 | 12216 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from fnmatch import fnmatch
import os
from nose.tools import assert_equal
from nose.plugins.skip import SkipTest
from matplotlib.testing.noseclasses import KnownFailureTest
try:
import pep8
except ImportE... | mit |
hvanhovell/spark | python/pyspark/sql/tests/test_arrow.py | 8 | 21337 | #
# 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 |
vortex-exoplanet/VIP | vip_hci/negfc/speckle_noise.py | 2 | 12649 | #! /usr/bin/env python
"""
Module with routines allowing for the estimation of the uncertainty on the
parameters of an imaged companion associated to residual speckle noise.
"""
__author__ = 'O. Wertz, C. A. Gomez Gonzalez, V. Christiaens'
__all__ = ['speckle_noise_uncertainty']
#import itertools as itt
from multip... | mit |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/matplotlib/backends/backend_pdf.py | 2 | 98412 | # -*- coding: utf-8 -*-
"""
A PDF matplotlib backend
Author: Jouni K Seppänen <jks@iki.fi>
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import codecs
import os
import re
import struct
import sys
import time
import warnings
import zlib
imp... | mit |
krafczyk/spack | var/spack/repos/builtin/packages/py-iminuit/package.py | 5 | 1801 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
stineb/sofun | get_sitelist_simsuite.py | 1 | 1708 | import pandas
import os
import os.path
##--------------------------------------------------------------------
## Simulation suite
## - "swissface"
## - "fluxnet"
## - "fluxnet2015"
## - "fluxnet_cnmodel"
## - "gcme"
## - "campi"
## - "campi_cmodel"
## - "fluxnet_fixalloc"
## - "atkin"
## - "atkinfull"
## - "olson"
## ... | lgpl-2.1 |
MohamedAbdultawab/FOC_RiceUniv | algorithmic-thinking-1/module-2-project-and-application/02_application-2-analysis-of-a-computer-network/main.py | 1 | 13373 | #!/usr/bin python3.5
import random
import time
from itertools import chain
import matplotlib.pyplot as plt
from collections import deque
from copy import deepcopy
class Queue(object):
"""
Queue wrapper implementation of deque
"""
def __init__(self, arg=list()):
self._queue = deque(arg)
de... | gpl-3.0 |
grehx/spark-tk | regression-tests/sparktkregtests/testcases/graph/graph_connected_test.py | 1 | 2428 | # 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 |
mblondel/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 |
B0BBB/ProxyVotingSim | Main.py | 1 | 6988 | from collections import defaultdict
from random import sample
from time import time
import csv
import matplotlib.pyplot as plt
import numpy as np
from sympy.printing.pretty.pretty_symbology import pretty_symbol
# Library located at https://pypi.python.org/pypi/Distance/
from Simulations import create_mel_dist, create... | mit |
dandanvidi/in-vivo-enzyme-kinetics | scripts/pFVA.py | 3 | 1834 | import pandas as pd
from cobra.core import Metabolite, Reaction
from cobra.io.sbml import create_cobra_model_from_sbml_file
from cobra.manipulation.modify import convert_to_irreversible, revert_to_reversible
from cobra.flux_analysis.variability import flux_variability_analysis
gc = pd.DataFrame.from_csv('../data/growt... | mit |
lbishal/scikit-learn | sklearn/utils/tests/test_shortest_path.py | 303 | 2841 | from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import (graph_shortest_path,
single_source_shortest_path_length)
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
#set nonzer... | bsd-3-clause |
amozie/amozie | stockzie/strategy/LinearModelStrategy.py | 1 | 1778 | # -*- coding: utf-8 -*-
"""
Created on %(date)s
@author: %(username)s
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import tushare as ts
import stockzie as sz
import talib as tl
from stockzie.strategy import BaseStrategy
import datazie as dz
class LinearModelStra... | apache-2.0 |
ChristianSch/skml | doc/auto_examples/example_br.py | 3 | 1416 | """
=================================
Ensemble Binary Relevance Example
=================================
An example of :class:`skml.problem_transformation.BinaryRelevance`
"""
from __future__ import print_function
from sklearn.metrics import hamming_loss
from sklearn.metrics import accuracy_score
from sklearn.metric... | mit |
marqh/cartopy | lib/cartopy/tests/mpl/test_caching.py | 1 | 6536 | # (C) British Crown Copyright 2011 - 2012, Met Office
#
# This file is part of cartopy.
#
# cartopy 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)... | gpl-3.0 |
tkchafin/mrbait | mrbait/mrbait_corefuncs_parallel.py | 1 | 18041 | #!/usr/bin/python
import sys
import sqlite3
import getopt
import Bio
import os
import time
from Bio import AlignIO
from mrbait import mrbait_menu
from mrbait import substring
from mrbait.substring import SubString
from functools import partial
from mrbait import manage_bait_db as m
from mrbait import alignment_tools as... | gpl-3.0 |
iwelland/hop | doc/examples/hoptraj.py | 1 | 2558 | #!/usr/bin/env python
#---------------- EDIT JOB NAME -------------------
#$ -N hoptraj
#--------------------------------------------------
#$ -S /usr/bin/python
#$ -v PYTHONPATH=/home/oliver/Library/python-lib
#$ -v LD_LIBRARY_PATH=/opt/intel/cmkl/8.0/lib/32:/opt/intel/itc60/slib:/opt/intel/ipp41/ia32_itanium/sharedli... | lgpl-3.0 |
tomsilver/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/contour.py | 69 | 42063 | """
These are classes to support contour plotting and
labelling for the axes class
"""
from __future__ import division
import warnings
import matplotlib as mpl
import numpy as np
from numpy import ma
import matplotlib._cntr as _cntr
import matplotlib.path as path
import matplotlib.ticker as ticker
import matplotlib.cm... | gpl-3.0 |
tku137/JPKay | tests/test_JPKForce.py | 1 | 1936 | # coding=utf-8
import pytest
import numpy.testing as npt
from numpy import array
import pandas.util.testing as pdt
import pandas as pd
from JPKay.core.data_structures import CellHesion
# noinspection PyShadowingNames,PyPep8Naming
@pytest.mark.usefixtures("sample_force_file")
class TestJpkForce:
def test_load_e... | mit |
J535D165/recordlinkage | recordlinkage/config_init.py | 1 | 1304 | import recordlinkage.config as cf
from recordlinkage.config import (get_default_val, is_bool, is_callable,
is_instance_factory, is_int,
is_one_of_factory, is_text
)
pairs_type_doc = """
: str
Specify the format ho... | bsd-3-clause |
mitschabaude/nanopores | scripts/pughpore/diffusivity/diff_bulk.py | 1 | 1313 | import numpy as np
import os
from math import sinh, acosh
import nanopores as nano
import nanopores.geometries.pughpore as pughpore
import nanopores.tools.fields as fields
from matplotlib import pyplot as plt
geop = nano.Params(pughpore.params)
fields.set_dir(os.path.expanduser("~") + "/Dropbox/nanopores/fields")
r =... | mit |
yunque/PyML | RandomWalk.py | 1 | 2464 | #!/usr/bin/env python
"""
RANDOM WALK
Generate a random walk sequence of times and frequencies, which are used to
synthesize sinusoidal sweeps of random durations between random frequencies.
1. generate intervals randomly until they add up to 10.
2. 3*10=30 >> divide
"""
from __future__ import division
import numpy... | gpl-2.0 |
bloyl/mne-python | tutorials/stats-sensor-space/10_background_stats.py | 10 | 29158 | # -*- coding: utf-8 -*-
"""
.. _disc-stats:
=====================
Statistical inference
=====================
Here we will briefly cover multiple concepts of inferential statistics in an
introductory manner, and demonstrate how to use some MNE statistical functions.
"""
# Authors: Eric Larson <larson.eric.d@gmail.co... | bsd-3-clause |
vorwerkc/pymatgen | pymatgen/io/cp2k/outputs.py | 5 | 55516 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module defines the Cp2k output parser along with a few other functions for parsing cp2k-related
outputs.
"""
import glob
import logging
import os
import re
import warnings
import numpy as np
import p... | mit |
jprchlik/aia_mkmovie | aia_select_cutout.py | 1 | 30686 | import matplotlib
#Use TkAgg backend for plotting
matplotlib.use('TkAgg',warn=False,force=True)
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
#implement the deault mpl key bindings
from matplotlib.backend_bases import key_press_handler,MouseEvent
import numpy as np
import s... | mit |
emon10005/scikit-image | skimage/feature/tests/test_util.py | 35 | 2818 | import numpy as np
try:
import matplotlib.pyplot as plt
except ImportError:
plt = None
from numpy.testing import assert_equal, assert_raises
from skimage.feature.util import (FeatureDetector, DescriptorExtractor,
_prepare_grayscale_input_2D,
_mask... | bsd-3-clause |
pianomania/scikit-learn | sklearn/tests/test_common.py | 39 | 6031 | """
General tests for all estimators in sklearn.
"""
# Authors: Andreas Mueller <amueller@ais.uni-bonn.de>
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
from __future__ import print_function
import os
import warnings
import sys
import re
import pkgutil
from sklearn.externals.six imp... | bsd-3-clause |
albertaparicio/tfg-voice-conversion | seq2seq_pytorch_main.py | 1 | 38363 | # -*- coding: utf-8 -*-
# TODO Add argparser
"""
Translation with a Sequence to Sequence Network and Attention
*************************************************************
**Author**: `Sean Robertson <https://github.com/spro/practical-pytorch>`_
In this project we will be teaching a neural network to translate from
F... | gpl-3.0 |
vybstat/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 |
crichardson17/starburst_atlas | Low_resolution_sims/Dusty_LowRes/Geneva_inst_Rot/Geneva_inst_Rot_6/fullgrid/IR.py | 30 | 9364 | import csv
import matplotlib.pyplot as plt
from numpy import *
import scipy.interpolate
import math
from pylab import *
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import matplotlib.patches as patches
from matplotlib.path import Path
import os
# --------------------------------------------------... | gpl-2.0 |
rabernat/xray | xarray/tests/test_computation.py | 1 | 28519 | import functools
import operator
from collections import OrderedDict
from distutils.version import LooseVersion
import numpy as np
from numpy.testing import assert_array_equal
import pandas as pd
import pytest
import xarray as xr
from xarray.core.computation import (
_UFuncSignature, result_name, broadcast_compa... | apache-2.0 |
DmitryYurov/BornAgain | Examples/python/fitting/ex01_BasicExamples/basic_fitting_tutorial.py | 2 | 4021 | """
Fitting example: 4 parameters fit for mixture of cylinders and prisms on top
of substrate.
"""
import bornagain as ba
from bornagain import deg, angstrom, nm
import numpy as np
from matplotlib import pyplot as plt
def get_sample(params):
"""
Returns a sample with uncorrelated cylinders and prisms on a su... | gpl-3.0 |
diegocavalca/Studies | phd-thesis/nilmtk/nilmtk/disaggregate/hart_85.py | 1 | 22673 | from __future__ import print_function, division
import pickle
from collections import OrderedDict, deque
import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error
from nilmtk.feature_detectors.cluster import hart85_means_shift_cluster
from nilmtk.feature_detectors.steady_states import find_s... | cc0-1.0 |
bnaul/scikit-learn | sklearn/conftest.py | 8 | 1292 | import os
import pytest
from threadpoolctl import threadpool_limits
from sklearn.utils._openmp_helpers import _openmp_effective_n_threads
@pytest.fixture(scope='function')
def pyplot():
"""Setup and teardown fixture for matplotlib.
This fixture checks if we can import matplotlib. If not, the tests will be
... | bsd-3-clause |
shenzebang/scikit-learn | examples/svm/plot_separating_hyperplane.py | 294 | 1273 | """
=========================================
SVM: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a Support Vector Machine classifier with
linear kernel.
"""
print(__doc__)
import numpy as np
impor... | bsd-3-clause |
dpshelio/sunpy | sunpy/timeseries/sources/eve.py | 1 | 12232 | import os
import codecs
from os.path import basename
from datetime import datetime
from collections import OrderedDict
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import dates
from pandas import DataFrame
from pandas.io.parsers import read_csv
import astropy.units as u
... | bsd-2-clause |
madcowswe/ODrive | analysis/Simulation/MotorSim.py | 1 | 7267 | # this file is for the simulation of a 3-phase synchronous motor
import numpy as np
import scipy as sp
import scipy.signal as signal
import scipy.integrate
import matplotlib.pyplot as plt
import time
def sign(num):
if num > 0:
return 1
elif num < 0:
return -1
else:
return 0
C = np... | mit |
NelisVerhoef/scikit-learn | sklearn/utils/testing.py | 71 | 26178 | """Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: Pietro Berkes,
# Andreas Muller
# Mathieu Blondel
# Olivier Grisel
# Arnaud Joly
# Denis Engemann
# License: BSD 3 clause
import os
import inspect
import pkgutil
import warnings
import sys
import re
import platf... | bsd-3-clause |
AlexanderFabisch/scikit-learn | examples/classification/plot_digits_classification.py | 289 | 2397 | """
================================
Recognizing hand-written digits
================================
An example showing how the scikit-learn can be used to recognize images of
hand-written digits.
This example is commented in the
:ref:`tutorial section of the user manual <introduction>`.
"""
print(__doc__)
# Autho... | bsd-3-clause |
heli522/scikit-learn | examples/ensemble/plot_gradient_boosting_quantile.py | 392 | 2114 | """
=====================================================
Prediction Intervals for Gradient Boosting Regression
=====================================================
This example shows how quantile regression can be used
to create prediction intervals.
"""
import numpy as np
import matplotlib.pyplot as plt
from skle... | bsd-3-clause |
dungvtdev/upsbayescpm | pgmpy/estimators/BdeuScore.py | 6 | 3421 | #!/usr/bin/env python
from math import lgamma
from pgmpy.estimators import StructureScore
class BdeuScore(StructureScore):
def __init__(self, data, equivalent_sample_size=10, **kwargs):
"""
Class for Bayesian structure scoring for BayesianModels with Dirichlet priors.
The BDeu score is th... | mit |
abhishekkrthakur/scikit-learn | sklearn/cluster/tests/test_birch.py | 5 | 5631 | """
Tests for the birch clustering algorithm.
"""
from scipy import sparse
import numpy as np
from sklearn.cluster.tests.common import generate_clustered_data
from sklearn.cluster.birch import Birch
from sklearn.cluster.hierarchical import AgglomerativeClustering
from sklearn.datasets import make_blobs
from sklearn.l... | bsd-3-clause |
maropu/spark | python/pyspark/pandas/tests/data_type_ops/test_complex_ops.py | 7 | 9065 | #
# 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 |
elahesadatnaghib/FB-Scheduler-v2 | Graphics.py | 1 | 14359 | import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.patches import Circle
import ephem
import sqlite3 as lite
from progressbar import ProgressBar
# Altitude and Azimuth of a single field at t (JD) in rad
def Fields_local_co... | mit |
dhruv13J/scikit-learn | examples/cross_decomposition/plot_compare_cross_decomposition.py | 142 | 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 |
giorgiop/scikit-learn | sklearn/metrics/pairwise.py | 5 | 46491 | # -*- 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 |
hugobowne/scikit-learn | examples/gaussian_process/plot_gpc.py | 103 | 3927 | """
====================================================================
Probabilistic predictions with Gaussian process classification (GPC)
====================================================================
This example illustrates the predicted probability of GPC for an RBF kernel
with different choices of the hy... | bsd-3-clause |
MTgeophysics/mtpy | tests/modeling/ModEM/test_data.py | 1 | 6272 | import difflib
import glob
import os
from os.path import dirname as UP
import sys
from unittest import TestCase
import tarfile
import matplotlib.pyplot as plt
from mtpy.core.edi_collection import EdiCollection
from mtpy.modeling.modem import Data
# patch that changes the matplotlib behaviour
from tests import make_te... | gpl-3.0 |
cgre-aachen/gempy | examples/tutorials/ch1_fundamentals/ch1_5_fault_relations.py | 1 | 3621 | """
1.5: Fault relations
====================
"""
# %%
# Importing gempy
import gempy as gp
# Aux imports
import numpy as np
import pandas as pd
import os
# Importing the function to find the interface
from gempy.utils.input_manipulation import find_interfaces_from_block_bottoms
import matplotlib.pyplot as plt
np.... | lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.