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
chrissly31415/amimanera
convnet_utils/rotate_offline.py
1
4162
#!/usr/bin/python # coding: utf-8 import os,glob,sys from datetime import datetime from random import random,randint,choice import matplotlib.pyplot as plt import numpy as np import PIL from PIL import Image,ImageFilter,ImageChops #Usage: python ./rotate_offline.py /home/xxx/data/train #rotation_angles = [180] d...
lgpl-3.0
aswolf/xmeos
examples/test-RTpress-MgSiO3/fit-RTpress-mdsim-Spera2011.py
1
148710
import numpy as np import matplotlib as mpl # mpl.use('WXAgg',warn=False, force=True) # mpl.use('GTKAgg',warn=False, force=True) # Gtk* backend requires pygtk to be installed. # mpl.use('Qt4Agg',warn=False, force=True) # PyQt4 # mpl.use('GTK3Agg',warn=False, force=True) # PyQt4 # mpl.use('TKAgg',warn=False, force=True...
mit
RPGOne/Skynet
scikit-learn-0.18.1/benchmarks/bench_plot_svd.py
325
2899
"""Benchmarks of Singular Value Decomposition (Exact and Approximate) The data is mostly low rank but is a fat infinite tail. """ import gc from time import time import numpy as np from collections import defaultdict from scipy.linalg import svd from sklearn.utils.extmath import randomized_svd from sklearn.datasets.s...
bsd-3-clause
lukeshingles/artistools
artistools/nltepops/plotnltepops.py
1
24895
#!/usr/bin/env python3 """Artistools - NLTE population related functions.""" import argparse import math import multiprocessing import os # import re # import sys # from functools import lru_cache # from functools import partial from pathlib import Path # from itertools import chain import matplotlib.pyplot as plt imp...
mit
MatthieuBizien/scikit-learn
examples/gaussian_process/plot_gpr_noisy_targets.py
64
3706
""" ========================================================= Gaussian Processes regression: basic introductory example ========================================================= A simple one-dimensional regression example computed in two different ways: 1. A noise-free case 2. A noisy case with known noise-level per ...
bsd-3-clause
michigraber/scikit-learn
sklearn/utils/tests/test_class_weight.py
140
11909
import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.datasets import make_blobs from sklearn.utils.class_weight import compute_class_weight from sklearn.utils.class_weight import compute_sample_weight from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testin...
bsd-3-clause
PatrickOReilly/scikit-learn
examples/svm/plot_rbf_parameters.py
3
8010
''' ================== 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
lekshmideepu/nest-simulator
pynest/nest/tests/test_synapsecollection.py
13
15095
# -*- coding: utf-8 -*- # # test_synapsecollection.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 ...
gpl-2.0
pydata/xarray
xarray/core/dataset.py
1
288325
import copy import datetime import inspect import sys import warnings from collections import defaultdict from html import escape from numbers import Number from operator import methodcaller from pathlib import Path from typing import ( TYPE_CHECKING, Any, Callable, Collection, DefaultDict, Dict...
apache-2.0
3manuek/scikit-learn
benchmarks/bench_20newsgroups.py
377
3555
from __future__ import print_function, division from time import time import argparse import numpy as np from sklearn.dummy import DummyClassifier from sklearn.datasets import fetch_20newsgroups_vectorized from sklearn.metrics import accuracy_score from sklearn.utils.validation import check_array from sklearn.ensemb...
bsd-3-clause
CivicKnowledge/rowgenerators
rowgenerators/appurl/file/shapefile.py
1
2514
# -*- coding: utf-8 -*- # Copyright (c) 2016 Civic Knowledge. This file is licensed under the terms of the # MIT License, included in this distribution as LICENSE.txt """ """ from .file import FileUrl from rowgenerators.appurl.web import WebUrl from rowgenerators.appurl.archive.zip import ZipUrl class ShapefileUrl...
mit
nguyentu1602/statsmodels
statsmodels/datasets/statecrime/data.py
25
3128
#! /usr/bin/env python """Statewide Crime Data""" __docformat__ = 'restructuredtext' COPYRIGHT = """Public domain.""" TITLE = """Statewide Crime Data 2009""" SOURCE = """ All data is for 2009 and was obtained from the American Statistical Abstracts except as indicated below. """ DESCRSHORT = """State ...
bsd-3-clause
togawa28/mousestyles
mousestyles/ultradian/tests/test_ultradian.py
3
9797
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import pandas as pd import statsmodels import mousestyles.ultradian as ultradian import pytest # aggregate_interval test def test_aggregate_interval(): with pytest.raises(ValueError) as...
bsd-2-clause
CoolProp/CoolProp
dev/scripts/fit_avoid_ECS.py
2
4679
from CoolProp import CoolProp as CP from PDSim.misc.datatypes import Collector import numpy as np import matplotlib.pyplot as plt from scipy.odr import * import textwrap # #fluid = 'Propane' #Rfluid = 'REFPROP-propane' #e_k = 263.88 #sigma = 0.49748 # fluid = 'DimethylEther' Rfluid = 'REFPROP-DME' e_k = 329.72 sigma =...
mit
karvenka/sp17-i524
project/S17-IR-P012/code/binarize.py
21
1096
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Apr 4 15:56:31 2017 I524 Project: OCR Preprocessing Binarization @author: saber """ import numpy as np import cv2 import matplotlib.pyplot as plt image_path = 'sample1.png' image_arr = cv2.imread(image_path, 0) plt.figure(1) plt.subplot(311) # Plot hi...
apache-2.0
vortex-ape/scikit-learn
sklearn/preprocessing/tests/test_base.py
18
3566
import numpy as np import pytest from scipy import sparse from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raise_message from sklearn.preprocessing._encoders import _transform_selected from sklearn.preprocessing.data import Binarizer def toarray(a): if hasattr(a, "toa...
bsd-3-clause
barney-NG/pyCAMTracker
src/filterpy/kalman/tests/test_fm.py
2
2152
# -*- coding: utf-8 -*- """Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the readme.MD file for mor...
mit
johannah/iceview
iceview/build_mosaic.py
1
8615
#!/usr/bin/env python from shutil import copyfile import subprocess from subprocess import Popen, PIPE from multiprocessing import Pool, freeze_support, cpu_count import matplotlib.pyplot as plt import itertools import os from glob import glob import numpy as np import argparse import sys import logging from copy imp...
bsd-3-clause
dipanjanS/text-analytics-with-python
Old-First-Edition/Ch07_Semantic_and_Sentiment_Analysis/wordnet_demo.py
1
5420
# -*- coding: utf-8 -*- """ Created on Thu Sep 22 23:00:59 2016 @author: DIP """ from nltk.corpus import wordnet as wn import pandas as pd term = 'fruit' synsets = wn.synsets(term) print 'Total Synsets:', len(synsets) # synsets for fruit for synset in synsets: print 'Synset:', synset print 'Part of speech...
apache-2.0
lail3344/sms-tools
lectures/06-Harmonic-model/plots-code/spectral-peaks.py
22
1161
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF (fs, x) = UF...
agpl-3.0
jmetzen/scikit-learn
sklearn/datasets/__init__.py
72
3807
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_diabetes from .base import load_digits from .base import load_files from .base import load_iris from ....
bsd-3-clause
jpautom/scikit-learn
examples/manifold/plot_mds.py
45
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
altairpearl/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
Kate-Willett/HadISDH_Marine_Build
EUSTACE_SST_MAT/PlotMetaData_APR2016.py
1
47963
#!/usr/local/sci/bin/python # PYTHON2.7 # # Author: Kate Willett # Created: 1 April 2016 # Last update: 1 April 2016 # Location: /data/local/hadkw/HADCRUH2/MARINE/EUSTACEMDS/EUSTACE_SST_MAT/ # GitHub: https://github.com/Kate-Willett/HadISDH_Marine_Build/ # ----------------------- # CODE PURPOSE AND OUTPUT # -----...
cc0-1.0
cainiaocome/scikit-learn
sklearn/utils/tests/test_estimator_checks.py
202
3757
import scipy.sparse as sp import numpy as np import sys from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils.testing import assert_raises_regex, assert_true from sklearn.utils.estimator_checks import check_estimator from sklearn.utils....
bsd-3-clause
rbalda/neural_ocr
env/lib/python2.7/site-packages/matplotlib/_cm.py
15
94005
""" Nothing here but dictionaries for generating LinearSegmentedColormaps, and a dictionary of these dictionaries. Documentation for each is in pyplot.colormaps() """ from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np _binary_data = { ...
mit
gdikos/trade-smart
analyzer.py
1
2760
import datetime as dt import math import numpy as np import pandas as pd # QSTK Imports import QSTK.qstkutil.DataAccess as da import QSTK.qstkutil.tsutil as tsu def get_values_list(s_file_path): df_values_list = pd.read_csv(s_file_path, sep=',', header=None) df_values_list.columns = ["year", "month", "day", "...
mit
bhillmann/gingivere
gingivere/process.py
2
2014
from classifiers import make_simple_lr import numpy as np from sklearn.cross_validation import StratifiedKFold from sklearn.metrics import roc_auc_score from sklearn.metrics import classification_report from gingivere.utilities.shelve import insert_shelve, load_shelve def process_data(target, X, y, paths, submission=...
mit
mikaem/spectralDNS
demo/OrrSommerfeld.py
4
8935
"""Orr-Sommerfeld""" import warnings from numpy import real, pi, exp, zeros, imag, sqrt, log10, sum from spectralDNS import config, get_solver, solve from spectralDNS.utilities import dx #from spectralDNS.utilities import reset_profile from OrrSommerfeld_shen import OrrSommerfeld try: import matplotlib.pyplot as p...
gpl-3.0
JosmanPS/scikit-learn
examples/feature_stacker.py
246
1906
""" ================================================= Concatenating multiple feature extraction methods ================================================= In many real-world examples, there are many ways to extract features from a dataset. Often it is beneficial to combine several methods to obtain good performance. Th...
bsd-3-clause
stwunsch/gnuradio
gr-utils/python/utils/plot_fft_base.py
23
10512
#!/usr/bin/env python # # Copyright 2007,2008,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your ...
gpl-3.0
amirhmoin/recodev
RecoDev-Prototype/extend_data/extend.py
1
1108
''' import sys sys.path.append('..') ''' from master_utils import * import numpy as np import os import MySQLdb from lda import LDA from sklearn.decomposition import LatentDirichletAllocation import datetime import lda_t1 class BugEvent: def __init__(self, start, end, topic, id, final): self.star...
bsd-3-clause
crichardson17/starburst_atlas
Low_resolution_sims/DustFree_LowRes/Padova_inst/padova_inst_2/UV2.py
33
7365
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
PhenixI/machine-learning
1_supervised_classification/15-SVM/svm/svm.py
1
1315
#for more info and material (source codes )about lr please visit: https:https://github.com/PhenixI/machine-learning/tree/master/15-SVM #load dataset from sklearn import datasets import numpy as np iris = datasets.load_iris() X= iris.data[:,[2,3]] y = iris.target #split the dataset into separate training and test da...
gpl-2.0
Lokke/eden
modules/tests/smoke/broken_links.py
16
26739
""" Sahana Eden Test Framework @copyright: 2011-2015 (c) Sahana Software Foundation @license: MIT 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, incl...
mit
heistermann/wradlib
wradlib/tests/test_vis.py
1
6099
#!/usr/bin/env python # Copyright (c) 2011-2018, wradlib developers. # Distributed under the MIT License. See LICENSE.txt for more info. import sys import unittest import wradlib.vis as vis import wradlib.georef as georef import numpy as np import matplotlib.pyplot as pl pl.interactive(True) # noqa from tempfile imp...
mit
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/mpl_toolkits/exceltools.py
8
3830
""" Some io tools for excel -- requires xlwt Example usage: import matplotlib.mlab as mlab import mpl_toolkits.exceltools as exceltools r = mlab.csv2rec('somefile.csv', checkrows=0) formatd = dict( weight = mlab.FormatFloat(2), change = mlab.FormatPercent(2), cost = mlab.Fo...
gpl-2.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/sklearn/manifold/isomap.py
2
7813
"""Isomap for manifold learning""" # Author: Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD, (C) 2011 import numpy as np import warnings from ..base import BaseEstimator, TransformerMixin from ..neighbors import NearestNeighbors, kneighbors_graph from ..utils import check_arrays from ..utils.gra...
agpl-3.0
RMKD/networkx
examples/graph/unix_email.py
62
2683
#!/usr/bin/env python """ Create a directed graph, allowing multiple edges and self loops, from a unix mailbox. The nodes are email addresses with links that point from the sender to the recievers. The edge data is a Python email.Message object which contains all of the email message data. This example shows the po...
bsd-3-clause
kinverarity1/geotransect
autowrap.py
2
3875
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Defines various data containers for plotting a transect. From http://stackoverflow.com/questions/4018860 :author: Joe Kington :copyright: 2010 Joe Kington :license: CC-BY-SA """ def on_draw(event, axis=None): """ Auto-wraps all text objects in a figure at dr...
apache-2.0
ZeromusSoftware/RPi3500
big_data/pi_performance/pi_performance.py
1
2243
import numpy as np import time import matplotlib.pyplot as plt from scipy.stats import pearsonr #we are going to calculate pi with an integration of #arctan(x)' between 0 and 1 (that calculates pi/4) def darctan(x) : # we introduce the arctan(x)'function result = 1/(1+x**2) return result def pi(n) : # n will be ...
gpl-2.0
untom/scikit-learn
benchmarks/bench_sample_without_replacement.py
397
8008
""" Benchmarks for sampling without replacement of integer. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import operator import matplotlib.pyplot as plt import numpy as np import random from sklearn.externals.six.moves i...
bsd-3-clause
mmilutinovic1313/zipline-with-algorithms
zipline/history/history_container.py
18
33931
# # 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
dimroc/tensorflow-mnist-tutorial
lib/python3.6/site-packages/tensorflow/contrib/learn/__init__.py
8
2286
# 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
Delosari/dazer
quality_checks/compare_reddening_laws.py
1
3890
import pyneb as pn import matplotlib.pyplot as plt from numpy import linspace, array from bin.dazer_methods import Dazer rc = pn.RedCorr() red_curve, Rv = 'G03', 2.5 rc.R_V = Rv rc.law = 'G03 LMC' dz = Dazer() f, ax = plt.subplots(figsize = (10,10)) rc.plot(laws='G03 LMC', ax=ax) wave = linspace(3000, 70...
mit
robcarver17/pysystemtrade
sysobjects/fills.py
1
3211
from collections import namedtuple import pandas as pd from syscore.objects import missing_order from sysexecution.orders.list_of_orders import listOfOrders from sysexecution.orders.base_orders import Order Fill = namedtuple("Fill", ["date", "qty", "price"]) class listOfFills(list): def __init__(self, list_of_...
gpl-3.0
hrjn/scikit-learn
sklearn/feature_extraction/tests/test_image.py
38
11165
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import numpy as np import scipy as sp from scipy import ndimage from numpy.testing import assert_raises from sklearn.feature_extraction.image import ( img_to_gra...
bsd-3-clause
pfnet/chainercv
chainercv/visualizations/vis_point.py
3
2009
from __future__ import division import numpy as np import six from chainercv.visualizations.vis_image import vis_image def vis_point(img, point, visible=None, ax=None): """Visualize points in an image. Example: >>> import chainercv >>> import matplotlib.pyplot as plt >>> dataset = ...
mit
rusucosmin/courses
ml/ex03/template/plots.py
3
1381
# -*- coding: utf-8 -*- """a function of ploting figures.""" import numpy as np from build_polynomial import * import matplotlib.pyplot as plt def plot_fitted_curve(y, x, weights, degree, ax): """plot the fitted curve.""" ax.scatter(x, y, color='b', s=12, facecolors='none', edgecolors='r') xvals = np.aran...
mit
sci-wms/sci-wms
wms/data_handler.py
1
2886
# -*- coding: utf-8 -*- import io import numpy as np from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg from django.http.response import HttpResponse def lat_lon_subset_idx(lon, lat, lonmin, latmin, lonmax, latmax, padding=0.18): """ A function to return the ind...
gpl-3.0
zerothi/sisl
sisl/viz/plotly/input_fields/queries.py
1
17709
# 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 https://mozilla.org/MPL/2.0/. from collections import defaultdict import itertools import numpy as np from .._input_field import InputField from .dro...
lgpl-3.0
YihaoLu/statsmodels
statsmodels/tsa/statespace/tests/test_structural.py
4
9003
""" Tests for structural time series models Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np import pandas as pd import os import warnings from statsmodels.datasets import macrodata from statsmodels.tsa.statespace import structural fr...
bsd-3-clause
ClimbsRocks/scikit-learn
sklearn/metrics/tests/test_common.py
2
42544
from __future__ import division, print_function from functools import partial from itertools import product import numpy as np import scipy.sparse as sp from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import LabelBinarizer from sklearn.utils.multiclass import type_of_target fro...
bsd-3-clause
pprett/scikit-learn
examples/preprocessing/plot_robust_scaling.py
85
2698
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Robust Scaling on Toy Data ========================================================= Making sure that each Feature has approximately the same scale can be a crucial preprocessing step. However, when data contains o...
bsd-3-clause
meduz/scikit-learn
examples/neural_networks/plot_mlp_training_curves.py
58
3692
""" ======================================================== Compare Stochastic learning strategies for MLPClassifier ======================================================== This example visualizes some training loss curves for different stochastic learning strategies, including SGD and Adam. Because of time-constrai...
bsd-3-clause
fperez/sympy
examples/intermediate/mplot3d.py
6
1197
#!/usr/bin/env python """Matplotlib 3D plotting example Demonstrates plotting with matplotlib. """ from sympy import Basic, sin, Symbol from sample import sample def mplot3d(f, var1, var2, show=True): """ Plot a 3d function using matplotlib/Tk. """ import warnings warnings.filterwarnings("ignore...
bsd-3-clause
pazeshun/jsk_apc
demos/instance_occlsegm/instance_occlsegm_lib/datasets/apc/apc2016/mit.py
2
4747
import itertools import os import os.path as osp import chainer import numpy as np import skimage.io try: from sklearn.model_selection import train_test_split except ImportError: from sklearn.cross_validation import train_test_split from .base import class_names_apc2016 import instance_occlsegm_lib.data impor...
bsd-3-clause
poidl/yassy
doc/python/frei_appendix_B2.py
1
4132
#!/bin/python # pylint: disable=C0103 """Python translation of Frei Appendix B1 and B2.""" # Frei, B.: Digital sound generation. Institute for Computer Music and # Sound Technology (ICST) Zurich University of the Arts. import numpy as np import scipy.signal as sig import matplotlib matplotlib.use('Agg') import matpl...
gpl-2.0
rl-institut/reegis-hp
reegis_hp/berlin_hp/plot.py
3
2926
import logging from oemof import outputlib from matplotlib import pyplot as plt import oemof.solph as solph import pandas as pd def test_plots(berlin_e_system): logging.info('Plot the results') cdict = {'wind': '#5b5bae', 'pv': '#ffde32', 'storage': '#42c77a', 'pp_gas':...
gpl-3.0
boltunoff/turo
turo_api_search/turo_api_search.py
1
2216
# Found at: https://stackoverflow.com/questions/54593816/scraping-through-python-selenium-or-beautifulsoup # https://turo.com/search?airportCode=EWR&customDelivery=true&defaultZoomLevel=11&endDate=04%2F05%2F2019&endTime=11%3A00&international=true&isMapSearch=false&itemsPerPage=200&location=EWR&locationType=Airport&ma...
gpl-3.0
pandegroup/osprey
osprey/search_space.py
2
10503
from __future__ import print_function, absolute_import, division """searchspace.py This module contains code for specifying the hyperparameter search space. The search space is specified as a product of bounded intervals. Each dimension can be either an integer, floating-point or enumeration. The base measure on the ...
apache-2.0
sinhrks/scikit-learn
examples/covariance/plot_covariance_estimation.py
99
5074
""" ======================================================================= Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood ======================================================================= When working with covariance estimation, the usual approach is to use a maximum likelihood estimator,...
bsd-3-clause
NixaSoftware/CVis
venv/lib/python2.7/site-packages/pandas/tests/series/test_missing.py
2
46754
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import pytz import pytest from datetime import timedelta, datetime from distutils.version import LooseVersion from numpy import nan import numpy as np import pandas as pd from pandas import (Series, DataFrame, isna, date_range, MultiIndex, Index, ...
apache-2.0
ahye/FYS2140-Resources
src/ForwardEuler/ForwardEulerPotentialWell.py
1
4827
#!/usr/bin/env python """ Created on Tir 29 Oct 2013. Script uses the forward euler method to solve the Schrodinger equation for a potential well. Animation is done using the matplotlib.pyplot library. Usage: python ForwardEulerPotentialWell.py or equivalent: ./ForwardEulerPotentialWell.py No commandline arg...
mit
dalejung/ibis
ibis/expr/tests/test_timestamp.py
13
3761
# 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 a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
apache-2.0
drix00/pysemeels
pysemeels/analysis/zero_loss_peak.py
1
6069
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. py:currentmodule:: pysemeels.analysis.zero_loss_peak .. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca> Analyze the zero loss peak from an EELS spectrum. """ ############################################################################### # Copyright...
apache-2.0
LiaoPan/scikit-learn
sklearn/linear_model/ransac.py
191
14261
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement from ..utils.valid...
bsd-3-clause
KhanSuleyman/scikit-neuralnetwork
docs/conf.py
5
1814
# -*- coding: utf-8 -*- # # scikit-neuralnetwork documentation build configuration file, created by # sphinx-quickstart on Tue Mar 31 20:28:10 2015. import sys import os project = u'scikit-neuralnetwork' copyright = u'2015, scikit-neuralnetwork developers (BSD License)' # -- Configuration of documentation --------...
bsd-3-clause
maxiee/MyCodes
KalmanAndBesianFiltersInPython/Chapter1_g_h_filters/utils/stat.py
3
11807
""" Author: Roger Labbe Copyright: 2014 This code performs various basic statistics functions for the Kalman and Bayesian Filters in Python book. Much of this code is non-optimal; production code should call the equivalent scipy.stats functions. I wrote the code in this form to make explicit how the computations are d...
gpl-3.0
jgoodacre71/trading-with-python
lib/vixFutures.py
79
4157
# -*- coding: utf-8 -*- """ set of tools for working with VIX futures @author: Jev Kuznetsov Licence: GPL v2 """ import datetime as dt from pandas import * import os import urllib2 #from csvDatabase import HistDataCsv m_codes = dict(zip(range(1,13),['F','G','H','J','K','M','N','Q','U','V','X','Z'])) #m...
bsd-3-clause
dataewan/deep-learning
image-classification/helper.py
155
5631
import pickle import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import LabelBinarizer def _load_label_names(): """ Load the label names from file """ return ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'] def load_cfar10_batch(ci...
mit
formath/mxnet
example/bayesian-methods/bdk_demo.py
45
15837
# 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 u...
apache-2.0
aiguofer/bokeh
tests/compat/polycollection.py
13
1311
from matplotlib.collections import PolyCollection import matplotlib.pyplot as plt import numpy as np from bokeh import mpl from bokeh.plotting import output_file, show # Generate data. In this case, we'll make a bunch of center-points and generate # verticies by subtracting random offsets from those center-points num...
bsd-3-clause
ryfeus/lambda-packs
Keras_tensorflow/source/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py
88
31139
# 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...
mit
gfyoung/pandas
pandas/tests/arrays/test_datetimes.py
1
23268
""" Tests for DatetimeArray """ import operator import numpy as np import pytest from pandas.core.dtypes.dtypes import DatetimeTZDtype import pandas as pd from pandas import NaT import pandas._testing as tm from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import sequence_to_dt64ns cla...
bsd-3-clause
appapantula/scikit-learn
sklearn/datasets/__init__.py
176
3671
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_diabetes from .base import load_digits from .base import load_files from .base import load_iris from ....
bsd-3-clause
ryfeus/lambda-packs
Sklearn_scipy_numpy/source/sklearn/ensemble/tests/test_weight_boosting.py
83
17276
"""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, assert_true from sklearn.utils.testing import assert_raises...
mit
gem/oq-engine
openquake/hazardlib/tests/site_amplification_test.py
1
11181
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2020, GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, ...
agpl-3.0
beni55/hyperopt
hyperopt/tests/test_criteria.py
7
1917
import numpy as np import hyperopt.criteria as crit def test_ei(): rng = np.random.RandomState(123) for mean, var in [(0, 1), (-4, 9)]: thresholds = np.arange(-5, 5, .25) * np.sqrt(var) + mean v_n = [crit.EI_gaussian_empirical(mean, var, thresh, rng, 10000) for thresh in thresh...
bsd-3-clause
zihua/scikit-learn
examples/semi_supervised/plot_label_propagation_digits_active_learning.py
28
3417
""" ======================================== Label Propagation digits active learning ======================================== Demonstrates an active learning technique to learn handwritten digits using label propagation. We start by training a label propagation model with only 10 labeled points, then we select the t...
bsd-3-clause
huzq/scikit-learn
sklearn/linear_model/tests/test_perceptron.py
5
1793
import numpy as np import scipy.sparse as sp from sklearn.utils._testing import assert_array_almost_equal from sklearn.utils._testing import assert_raises from sklearn.utils import check_random_state from sklearn.datasets import load_iris from sklearn.linear_model import Perceptron iris = load_iris() random_state = ...
bsd-3-clause
thirdwing/mxnet
example/ssd/dataset/pycocotools/coco.py
29
19564
# 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 u...
apache-2.0
hainm/statsmodels
statsmodels/sandbox/stats/stats_mstats_short.py
34
14910
'''get versions of mstats percentile functions that also work with non-masked arrays uses dispatch to mstats version for difficult cases: - data is masked array - data requires nan handling (masknan=True) - data should be trimmed (limit is non-empty) handle simple cases directly, which doesn't require apply_alon...
bsd-3-clause
mountaindust/Parasitoids
Bayes_Plot.py
1
16702
#! /usr/bin/env python3 ''' This module is for plotting the posterior distributions from Bayes_Run.py Author: Christopher Strickland Email: wcstrick@live.unc.edu ''' import sys, os import warnings from collections import OrderedDict import numpy as np import pymc as pm import matplotlib.pyplot as plt import matplotl...
gpl-3.0
0x0all/scikit-learn
sklearn/utils/tests/test_random.py
38
7410
from __future__ import division import numpy as np import scipy.sparse as sp from scipy.misc import comb as combinations from numpy.testing import assert_array_almost_equal from sklearn.utils.random import sample_without_replacement from sklearn.utils.random import random_choice_csc from sklearn.utils.testing import ...
bsd-3-clause
MohammedWasim/scikit-learn
sklearn/externals/joblib/parallel.py
79
35628
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause from __future__ import division import os import sys import gc import warnings from math import sqrt import functools import time import thr...
bsd-3-clause
JPFrancoia/scikit-learn
sklearn/decomposition/tests/test_kernel_pca.py
74
8472
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import (assert_array_almost_equal, assert_less, assert_equal, assert_not_equal, assert_raises) from sklearn.decomposition import PCA, KernelPCA from sklearn.datasets import mak...
bsd-3-clause
prheenan/IgorUtil
PythonAdapter/PxpLoader.py
1
9527
# force floating point division. Can still use integer with // from __future__ import division # This file is used for importing the common utilities classes. import numpy as np import matplotlib.pyplot as plt import sys from IgorUtil.PythonAdapter import ProcessSingleWave,TimeSepForceObj from GeneralUtil.python.LibUti...
gpl-3.0
oemof/reegis-hp
reegis_hp/de21/ew.py
3
2788
# http://www.geodatenzentrum.de/auftrag1/archiv/vektor/vg250_ebenen/2015/vg250-ew_2015-12-31.geo84.shape.ebenen.zip import os import pandas as pd import geopandas as gpd from oemof.tools import logger from shapely.wkt import loads as wkt_loads from reegis_hp.de21 import tools as t import configuration as config import...
gpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/tests/series/test_dtypes.py
7
5707
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import sys from datetime import datetime import string from numpy import nan import numpy as np from pandas import Series from pandas.tseries.index import Timestamp from pandas.tseries.tdi import Timedelta from pandas.compat import lrange, range, u from pandas import...
gpl-3.0
myselfHimanshu/Udacity-DataML
Intro to Machine Learning/text_learning/vectorize_text.py
2
2636
#!/usr/bin/python import os import pickle import re import sys sys.path.append( "../tools/" ) from parse_out_email_text import parseOutText """ starter code to process the emails from Sara and Chris to extract the features and get the documents ready for classification the list of all the emails from Sa...
gpl-2.0
yanlend/scikit-learn
sklearn/metrics/cluster/tests/test_bicluster.py
394
1770
"""Testing for bicluster metrics module""" import numpy as np from sklearn.utils.testing import assert_equal, assert_almost_equal from sklearn.metrics.cluster.bicluster import _jaccard from sklearn.metrics import consensus_score def test_jaccard(): a1 = np.array([True, True, False, False]) a2 = np.array([T...
bsd-3-clause
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/pandas/tests/sparse/test_series.py
7
51517
# pylint: disable-msg=E1101,W0612 import operator import pytest from numpy import nan import numpy as np import pandas as pd from pandas import Series, DataFrame, bdate_range from pandas.core.common import isnull from pandas.tseries.offsets import BDay import pandas.util.testing as tm from pandas.compat import range...
mit
pprett/scikit-learn
examples/applications/plot_out_of_core_classification.py
51
13651
""" ====================================================== Out-of-core classification of text documents ====================================================== This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into main memory. ...
bsd-3-clause
AlexanderFabisch/scikit-learn
examples/svm/plot_svm_kernels.py
329
1971
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM-Kernels ========================================================= Three different types of SVM-Kernels are displayed below. The polynomial and RBF are especially useful when the data-points are not linearly sep...
bsd-3-clause
wkfwkf/statsmodels
examples/python/ols.py
30
5601
## Ordinary Least Squares from __future__ import print_function import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std np.random.seed(9876789) # ## OLS estimation # # Artificial data: nsample = 100 x = np.linspace(0, 1...
bsd-3-clause
mortonjt/scipy
scipy/stats/tests/test_morestats.py
10
39208
# Author: Travis Oliphant, 2002 # # Further enhancements and tests added by numerous SciPy developers. # from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy.random import RandomState from numpy.testing import (TestCase, run_module_suite, assert_array_equal, ...
bsd-3-clause
yohanesgultom/id-openie
scripts/reverb_utils.py
1
1283
import csv import argparse import json from pandas import read_csv, merge parser = argparse.ArgumentParser() parser.add_argument('sentences_file', help='Sentences file') parser.add_argument('labels_file', help='Labels file') parser.add_argument('-o', '--output', help='Output file', default='out.json') args = parser.pa...
mit
basnijholt/holoviews
holoviews/plotting/plotly/element.py
2
18826
from __future__ import absolute_import, division, unicode_literals import numpy as np import param from ...core import util from ...core.element import Element from ...core.spaces import DynamicMap from ...util.transform import dim from ..plot import GenericElementPlot, GenericOverlayPlot from ..util import dim_range...
bsd-3-clause
aewhatley/scikit-learn
examples/decomposition/plot_ica_blind_source_separation.py
349
2228
""" ===================================== Blind source separation using FastICA ===================================== An example of estimating sources from noisy data. :ref:`ICA` is used to estimate sources given noisy measurements. Imagine 3 instruments playing simultaneously and 3 microphones recording the mixed si...
bsd-3-clause