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
harisbal/pandas
pandas/core/frame.py
1
295341
# pylint: disable=E1101 # pylint: disable=W0212,W0703,W0622 """ DataFrame --------- An efficient 2D container for potentially mixed-type time series or other labeled data series. Similar to its R counterpart, data.frame, except providing automatic data alignment and a host of useful data manipulation methods having to...
bsd-3-clause
phobson/statsmodels
statsmodels/iolib/tests/test_foreign.py
4
7304
""" Tests for iolib/foreign.py """ import os import warnings from datetime import datetime from numpy.testing import * import numpy as np from pandas import DataFrame, isnull import pandas.util.testing as ptesting from statsmodels.compat.python import BytesIO, asbytes import statsmodels.api as sm from statsmodels.iol...
bsd-3-clause
harri314/Navigation
diagrams/rust_auxiliary.py
1
3097
# Copyright 2014 Harri Ojanen # # 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. # # This program is distributed in the h...
gpl-3.0
SPJ-AI/lesson
training_python/mlp_text.py
1
3129
# -*- coding: utf-8 -*- #! /usr/bin/python import MeCab # TokenizerとしてMeCabを使用 from sklearn.neural_network import MLPClassifier mecab = MeCab.Tagger("-Ochasen") # MeCabのインスタンス化 f = open('text.tsv') # トレーニングファイルの読み込み lines = f.readlines() words = [] # 単語トークン表層一覧を保持するリスト count = 0 dict = {} # テキスト:カテゴリのペアを保持する辞書 for li...
gpl-3.0
Britefury/scikit-image
skimage/external/tifffile/tifffile_local.py
1
173368
#!/usr/bin/env python # -*- coding: utf-8 -*- # tifffile.py # Copyright (c) 2008-2014, Christoph Gohlke # Copyright (c) 2008-2014, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or wit...
bsd-3-clause
josauder/procedural_city_generation
procedural_city_generation/polygons/construct_polygons.py
2
3651
from __future__ import division import numpy as np import math import matplotlib import matplotlib.pyplot as plt class Wedge(object): def __init__(self, a, b, c, alpha): self.a=a self.b=b self.c=c self.alpha=alpha def __repr__(self): return "W["+str(se...
mpl-2.0
p-lauer/spotpy
spotpy/examples/3dplot.py
3
1623
''' 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
republic-analytics/luigi
examples/pyspark_wc.py
17
3388
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
Agent007/deepchem
examples/clintox/datasets/aacttox_sweetfda_join.py
8
4151
# -*- coding: utf-8 -*- """ Join sweetfda and aacttox data @author Caleb Geniesse """ import pandas as pd ############################################################################## ### save dataset ############################################################################## ### load datasets # load sweetfda swe...
mit
ameliecordier/IIK
master.py
1
11629
from datahandler import expertPatterns from datahandler import miningPatterns from datahandler import analyser as analyser from matplotlib import pyplot as plt from matplotlib.backends.backend_pdf import PdfPages import os import time def plot_two_results(norev, rev, fignum, legend, pp): """ Utilitaire d'affic...
mit
andrewnc/scikit-learn
benchmarks/bench_multilabel_metrics.py
276
7138
#!/usr/bin/env python """ A comparison of multilabel target formats and metrics over them """ from __future__ import division from __future__ import print_function from timeit import timeit from functools import partial import itertools import argparse import sys import matplotlib.pyplot as plt import scipy.sparse as...
bsd-3-clause
ethereum/cpp-ethereum
scripts/plot_sync_perf.py
1
2075
#!/usr/bin/env python3 import json import matplotlib.pyplot as plt import sys if len(sys.argv) < 3: print("USAGE: plot_sync_perf.py.py gas_per_sec|avg_gas_per_sec|avg_gas_per_sec_1000blocks|sync_time LOG_FILE") sys.exit(-1) mode = sys.argv[1] log_file = open(sys.argv[2], "r") print("processing...") perf_rec...
gpl-3.0
vsmolyakov/cv
visual_words/visual_words.py
1
9664
import numpy as np import cv2 import matplotlib.pyplot as plt from sklearn.datasets import fetch_olivetti_faces from sklearn.cluster import MiniBatchKMeans from sklearn.decomposition import LatentDirichletAllocation from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.neighbors i...
mit
NunoEdgarGub1/scikit-learn
sklearn/feature_selection/tests/test_feature_select.py
143
22295
""" Todo: cross-check the F-value with stats model """ from __future__ import division import itertools import warnings import numpy as np from scipy import stats, sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises...
bsd-3-clause
benjaminpope/whisky
geometry/mk_plain.py
2
2914
#!/usr/bin/env python ''' ------------------------------------------------------- This procedure generates a coordinates file for a hex pupil made of an arbitrary number of rings. Additional constraints on the location of spiders make it look like the your favorite telescope primary mirror --------...
gpl-3.0
nkhuyu/SFrame
oss_src/unity/python/sframe/data_structures/sframe.py
1
211694
""" This module defines the SFrame class which provides the ability to create, access and manipulate a remote scalable dataframe object. SFrame acts similarly to pandas.DataFrame, but the data is completely immutable and is stored column wise on the GraphLab Server side. """ ''' Copyright (C) 2015 Dato, Inc. All righ...
bsd-3-clause
MicrosoftGenomics/FaST-LMM
fastlmm/feature_selection/feature_selection_cv.py
1
38663
""" Created on 2013-07-28 @author: Christian Widmer <chris@shogun-toolbox.org> @summary: Module for feature selection strategies using efficient caching where possible """ # std modules from collections import defaultdict import gzip import bz2 import cPickle import time import os import gc import subprocess import ...
apache-2.0
lazywei/scikit-learn
examples/preprocessing/plot_robust_scaling.py
221
2702
#!/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
liweitianux/atoolbox
astro/calc_psd.py
1
14723
#!/usr/bin/env python3 # # Copyright (c) 2015-2017 Aaron LI # MIT License # """ Compute the radial (i.e., azimuthally averaged) power spectral density (a.k.a. power spectrum) of a FITS image. NOTE: The input image must be square. Credit ------ * Radially averaged power spectrum of 2D real-valued matrix Evan Ruzans...
mit
BenjaminBossan/nolearn
docs/conf.py
2
4002
# -*- coding: utf-8 -*- import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.'))...
mit
scottyaz/reactive-vaccination-hotspots
Source/python/megaplot-multipleyears.py
1
11705
import scipy.integrate as spi import numpy as np import pylab as pl import warnings from matplotlib.font_manager import FontProperties as fmp import sys import pdb import vacfunctions as vf import re import os import time pvacs = np.linspace(0.0,499999.0/500000,21) # note this is % of single patch not # full populatio...
gpl-2.0
linsalrob/crAssphage
bin/map_drawing/bivariate.py
1
5778
""" In this example, we only have dots. The Size of the dots are the number of strains at each point and the color of the dots are the number of connnections to that dot. """ import os import sys import argparse import matplotlib.pyplot as plt # set the figure size. This should be in inches? plt.rcParams["figure.figs...
mit
wdurhamh/statsmodels
statsmodels/sandbox/tsa/examples/ex_mle_arma.py
33
4587
# -*- coding: utf-8 -*- """ TODO: broken because of changes to arguments and import paths fixing this needs a closer look Created on Thu Feb 11 23:41:53 2010 Author: josef-pktd copyright: Simplified BSD see license.txt """ from __future__ import print_function import numpy as np from numpy.testing import assert_almost...
bsd-3-clause
e2crawfo/dps
motmetrics/io.py
1
7426
# -- coding: utf-8 -- """py-motmetrics - metrics for multiple object tracker (MOT) benchmarking. Christoph Heindl, 2017 https://github.com/cheind/py-motmetrics """ from enum import Enum import pandas as pd import numpy as np import io class Format(Enum): """Enumerates supported file formats.""" MOT16 = 'mo...
apache-2.0
astropy/astropy
examples/io/plot_fits-image.py
11
1898
# -*- coding: utf-8 -*- """ ======================================= Read and plot an image from a FITS file ======================================= This example opens an image stored in a FITS file and displays it to the screen. This example uses `astropy.utils.data` to download the file, `astropy.io.fits` to open th...
bsd-3-clause
agrimaldi/metaseq
metaseq/results_table.py
3
40294
import copy from textwrap import dedent import numpy as np import pandas from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import matplotlib.patches as patches import matplotlib import plotutils from matplotlib.transforms import blended_transform_factory from matplotlib.collec...
mit
DGrady/pandas
pandas/tests/io/test_sql.py
2
94598
"""SQL io tests The SQL tests are broken down in different classes: - `PandasSQLTest`: base class with common methods for all test classes - Tests for the public API (only tests with sqlite3) - `_TestSQLApi` base class - `TestSQLApi`: test the public API with sqlalchemy engine - `TestSQLiteFallbackApi`: t...
bsd-3-clause
justincassidy/scikit-learn
sklearn/cross_validation.py
8
58526
""" The :mod:`sklearn.cross_validation` module includes utilities for cross- validation and performance evaluation. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause from...
bsd-3-clause
itaiin/arrow
python/benchmarks/convert_pandas.py
9
3913
# 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
wlamond/scikit-learn
examples/mixture/plot_gmm_covariances.py
89
4724
""" =============== GMM covariances =============== Demonstration of several covariances types for Gaussian mixture models. See :ref:`gmm` for more information on the estimator. Although GMM are often used for clustering, we can compare the obtained clusters with the actual classes from the dataset. We initialize th...
bsd-3-clause
cdawei/digbeta
python/digbeta/heuristics.py
2
18020
""" Heuristics used to query the most uncertain candidate out of the unlabelled pool. """ import numpy as np from joblib import Parallel, delayed from numpy.random import permutation from sklearn.preprocessing import LabelBinarizer from sklearn.base import clone def random_h(candidate_mask, n_candidates, **kwargs): ...
gpl-3.0
ratnania/vale
tests/test_biharmonic_2d.py
1
3166
# coding: utf-8 from vale import ValeCodegen from vale import ValeParser from vale import construct_model from sympy import S from sympy.core.sympify import sympify import numpy as np # ... def run(filename): # ... from caid.cad_geometry import square geometry = square() from clapp.spl.mapping impo...
mit
simon-pepin/scikit-learn
examples/applications/face_recognition.py
191
5513
""" =================================================== Faces recognition example using eigenfaces and SVMs =================================================== The dataset used in this example is a preprocessed excerpt of the "Labeled Faces in the Wild", aka LFW_: http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2...
bsd-3-clause
ElDeveloper/scikit-learn
examples/tree/unveil_tree_structure.py
67
4824
""" ========================================= Understanding the decision tree structure ========================================= The decision tree structure can be analysed to gain further insight on the relation between the features and the target to predict. In this example, we show how to retrieve: - the binary t...
bsd-3-clause
ericmjl/flu-sequence-predictor
utils/webplots.py
1
7849
from collections import defaultdict from datetime import datetime import pandas as pd import yaml from bokeh.embed import components from bokeh.layouts import row from bokeh.models import ( ColumnDataSource, CrosshairTool, HoverTool, PanTool, Range1d, ResetTool, SaveTool, ) from bokeh.palet...
bsd-3-clause
zooniverse/aggregation
active_weather/old/extract_digits.py
1
2589
import numpy as np import math import matplotlib.pyplot as plt from scipy import spatial from sklearn.cluster import DBSCAN import Image import cv2 def line_removal(pts,num_col,num_row): global_tree = spatial.KDTree(pts) plt.plot(num_row,num_col,"o",color="red") def extract(image): digits = [] confi...
apache-2.0
ClinicalGraphics/scikit-image
doc/examples/edges/plot_medial_transform.py
11
2257
""" =========================== Medial axis skeletonization =========================== The medial axis of an object is the set of all points having more than one closest point on the object's boundary. It is often called the **topological skeleton**, because it is a 1-pixel wide skeleton of the object, with the same ...
bsd-3-clause
blink1073/qgrid
qgrid/grid.py
1
11436
import pandas as pd import numpy as np import uuid import os import json from numbers import Integral from IPython.display import display_html, display_javascript try: from ipywidgets import widgets except ImportError: from IPython.html import widgets from IPython.display import display, Javascript try: fr...
apache-2.0
aaronprunty/starfish
vezda/plotWiggles.py
1
31532
# Copyright 2017-2018 Aaron C. Prunty # # 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 agree...
apache-2.0
grlee77/scipy
scipy/stats/tests/test_morestats.py
2
103011
# Author: Travis Oliphant, 2002 # # Further enhancements and tests added by numerous SciPy developers. # import warnings import numpy as np from numpy.random import RandomState from numpy.testing import (assert_array_equal, assert_almost_equal, assert_array_less, assert_array_almost_equal, assert_, assert_all...
bsd-3-clause
aetilley/scikit-learn
sklearn/decomposition/tests/test_fastica.py
272
7798
""" Test the fastica algorithm. """ import itertools import warnings import numpy as np from scipy import stats from nose.tools import assert_raises from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from skl...
bsd-3-clause
pslacerda/GromacsWrapper
gromacs/fileformats/xpm.py
1
10370
# GromacsWrapper: xpm.py # Copyright (c) 2012 Oliver Beckstein <orbeckst@gmail.com> # Copyright (c) 2010 Tsjerk Wassenaar <tsjerkw@gmail.com> # Released under the GNU Public License 3 (or higher, your choice) # See the file COPYING for details. """ Gromacs XPM file format ======================= Gromacs stores matrix ...
gpl-3.0
karenlmasters/ComputationalPhysicsUnit
GraphicsVisualisation/double_pendulum_animated.py
1
2314
# Double pendulum formula translated from the C code at # http://www.physics.usyd.edu.au/~wheat/dpend_html/solve_dpend.c from numpy import sin, cos, pi, array import numpy as np import matplotlib.pyplot as plt import scipy.integrate as integrate import matplotlib.animation as animation G = 9.8 # acceleration due to ...
apache-2.0
costypetrisor/scikit-learn
examples/applications/plot_stock_market.py
227
8284
""" ======================================= Visualizing the stock market structure ======================================= This example employs several unsupervised learning techniques to extract the stock market structure from variations in historical quotes. The quantity that we use is the daily variation in quote ...
bsd-3-clause
kevin-intel/scikit-learn
examples/neighbors/plot_regression.py
25
1441
""" ============================ Nearest Neighbors regression ============================ Demonstrate the resolution of a regression problem using a k-Nearest Neighbor and the interpolation of the target using both barycenter and constant weights. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@...
bsd-3-clause
nesterione/scikit-learn
examples/cluster/plot_cluster_comparison.py
246
4684
""" ========================================================= Comparing different clustering algorithms on toy datasets ========================================================= This example aims at showing characteristics of different clustering algorithms on datasets that are "interesting" but still in 2D. The last ...
bsd-3-clause
edx/ease
ease/predictor_extractor.py
1
2830
""" Extracts features for an arbitrary set of textual and numeric inputs """ import numpy import re import nltk import sys from sklearn.feature_extraction.text import CountVectorizer import pickle import os from itertools import chain import copy import operator import logging import math from .feature_extractor impor...
agpl-3.0
cbertinato/pandas
pandas/tests/arrays/interval/test_interval.py
1
2320
import numpy as np import pytest import pandas as pd from pandas import Index, Interval, IntervalIndex, date_range, timedelta_range from pandas.core.arrays import IntervalArray import pandas.util.testing as tm @pytest.fixture(params=[ (Index([0, 2, 4]), Index([1, 3, 5])), (Index([0., 1., 2.]), Index([1., 2.,...
bsd-3-clause
astocko/statsmodels
statsmodels/sandbox/examples/try_multiols.py
33
1243
# -*- coding: utf-8 -*- """ Created on Sun May 26 13:23:40 2013 Author: Josef Perktold, based on Enrico Giampieri's multiOLS """ #import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels.sandbox.multilinear import multiOLS, multigroup data = sm.datasets.longley.load_pandas() df = data.e...
bsd-3-clause
xodus7/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/data_feeder_test.py
25
13554
# 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
rhiever/scipy_2015_sklearn_tutorial
notebooks/figures/plot_digits_datasets.py
19
2750
# Taken from example in scikit-learn examples # Authors: Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Gael Varoquaux # License: BSD 3 clause (C) INRIA 2011 import numpy as np import matplotlib.pyplot as pl...
cc0-1.0
kiith-sa/QGIS
python/plugins/processing/algs/RasterLayerHistogram.py
6
3219
# -*- coding: utf-8 -*- """ *************************************************************************** RasterLayerHistogram.py --------------------- Date : January 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com *****************...
gpl-2.0
ephes/scikit-learn
sklearn/feature_extraction/hashing.py
183
6155
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD 3 clause import numbers import numpy as np import scipy.sparse as sp from . import _hashing from ..base import BaseEstimator, TransformerMixin def _iteritems(d): """Like d.iteritems, but accepts any collections.Mapping.""" return d.iteritems() if...
bsd-3-clause
wazeerzulfikar/scikit-learn
sklearn/feature_extraction/tests/test_dict_vectorizer.py
110
3768
# Authors: Lars Buitinck # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from random import Random import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils.testing import (assert_equal, assert_in, assert_false...
bsd-3-clause
rothnic/bokeh
bokeh/charts/builder/tests/test_line_builder.py
33
2376
""" This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with thi...
bsd-3-clause
rehassachdeva/restaurant_stats
setup.py
1
1041
#!/usr/bin/env python2 from restaurant_stats import __version__ try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages setup ( name = 'restaurant_stats', version = __version__, author = 'Rehas Sachdeva', author_email = 'aquannie@gm...
mit
Averroes/statsmodels
docs/source/conf.py
27
11559
# -*- coding: utf-8 -*- # # statsmodels documentation build configuration file, created by # sphinx-quickstart on Sat Jan 22 11:17:58 2011. # # 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. # #...
bsd-3-clause
SciLifeLab/NouGAT
utils/produce_assembly_report.py
3
21059
import sys, os, yaml, glob import subprocess import argparse import pandas as pd import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt import shutil as sh def main(args): workingDir = os.getcwd() assemblers = sum(args.assemblers, []) if not os.path.exists(args.validation_dir): ...
mit
mtat76/atm-py
atmPy/aerosols/instrument/DMA/smps.py
3
21254
import sys import tkinter as tk from datetime import datetime as dt from datetime import timedelta from math import floor from tkinter import filedialog as fd import matplotlib.pyplot as plt import numpy as np import pandas as pd import statsmodels.api as sm from scipy.interpolate import interp1d from at...
mit
GroestlCoin/electrum-grs
electrum_grs/gui/qt/history_list.py
1
31502
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
gpl-3.0
rickyHong/Tensorflow_modi
tensorflow/python/client/notebook.py
5
3848
"""Notebook front-end to TensorFlow. When you run this binary, you'll see something like below, which indicates the serving URL of the notebook: The IPython Notebook is running at: http://127.0.0.1:8888/ Press "Shift+Enter" to execute a cell Press "Enter" on a cell to go into edit mode. Press "Escape" to go back ...
apache-2.0
AaltoUrbanWater/opendatafmi
get_livi_stations.py
2
4413
#!/usr/bin/env python """Get a list of road weather stations and save as a shapefile. Copyright (C) 2018 Tero Niemi, Aalto University School of Engineering This file is part of FetchFMIOpen. FetchFMIOpen is free software: you can redistribute it and/or modify it under the terms of the GNU General Public ...
gpl-3.0
dsquareindia/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
shusenl/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
mne-tools/mne-python
tutorials/intro/40_sensor_locations.py
2
13698
""" .. _tut-sensor-locations: Working with sensor locations ============================= This tutorial describes how to read and plot sensor locations, and how MNE-Python handles physical locations of sensors. As usual we'll start by importing the modules we need and loading some :ref:`example data <sample-dataset>...
bsd-3-clause
Barmaley-exe/scikit-learn
sklearn/ensemble/partial_dependence.py
36
14909
"""Partial dependence plots for tree ensembles. """ # Authors: Peter Prettenhofer # License: BSD 3 clause from itertools import count import numbers import numpy as np from scipy.stats.mstats import mquantiles from ..utils.extmath import cartesian from ..externals.joblib import Parallel, delayed from ..externals im...
bsd-3-clause
miyyer/qb
qanta/buzz_example.py
2
10938
import math import os import pickle from collections import defaultdict import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd import plotnine as p9 import typer from pedroai.io import read_json, write_json from pedroai.plot import theme_pedroai from rich.console import Console from r...
mit
meissnert/StarCluster
utils/scimage_13_04.py
19
17696
#!/usr/bin/env python """ This script is meant to be run inside of a ubuntu cloud image available at uec-images.ubuntu.com:: $ EC2_UBUNTU_IMG_URL=http://uec-images.ubuntu.com/precise/current $ wget $EC2_UBUNTU_IMG_URL/precise-server-cloudimg-amd64.tar.gz or:: $ wget $EC2_UBUNTU_IMG_URL/precise-server-clo...
gpl-3.0
ioreshnikov/wells
stability_eigenvalue.py
1
2880
#!/usr/bin/env python3 import argparse import scipy import matplotlib.pyplot as plot import wells.publisher as publisher parser = argparse.ArgumentParser() parser.add_argument("-i", "--interactive", help="Interactive mode", action="store_true") parser.add_argument("-e", "--ex...
mit
uvchik/pvlib-python
pvlib/test/test_atmosphere.py
1
5239
import itertools import numpy as np import pandas as pd import pytest from numpy.testing import assert_allclose from pvlib import atmosphere from pvlib import solarposition latitude, longitude, tz, altitude = 32.2, -111, 'US/Arizona', 700 times = pd.date_range(start='20140626', end='20140626', freq='6h', tz=tz) e...
bsd-3-clause
nan86150/ImageFusion
lib/python2.7/site-packages/matplotlib/tri/triplot.py
21
3124
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np from matplotlib.tri.triangulation import Triangulation def triplot(ax, *args, **kwargs): """ Draw a unstructured triangular grid as lines and/or markers. The triang...
mit
Kongsea/tensorflow
tensorflow/contrib/training/python/training/feeding_queue_runner_test.py
76
5052
# Copyright 2015 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
rb-roomba/music
read_MusicXML/read_musicXML.py
1
2750
#! /usr/bin/python # -*- coding: utf-8 -*- from bs4 import BeautifulSoup import matplotlib.pyplot as plt import seaborn import pandas as pd def height(pitch): """ Calculate absolute height of given pitch. """ # pitch example: [u'G', u'5'] cde_list = ["c","d","e","f","g","a","b"] h = int(pitch[1])*7 ...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/tests/indexes/test_datetimelike.py
7
52802
# -*- coding: utf-8 -*- from datetime import datetime, timedelta, time import numpy as np from pandas import (DatetimeIndex, Float64Index, Index, Int64Index, NaT, Period, PeriodIndex, Series, Timedelta, TimedeltaIndex, date_range, period_range, timedelta_ra...
gpl-3.0
ArtsiomCh/tensorflow
tensorflow/examples/learn/iris_custom_decay_dnn.py
37
3774
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
sarahgrogan/scikit-learn
sklearn/feature_extraction/tests/test_text.py
110
34127
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
Islandman93/reinforcepy
examples/ALE/DQN_Async/run_dqnexpreplay.py
1
1901
import sys import json import datetime from reinforcepy.environments import ALEEnvironment from reinforcepy.networks.dqn.tflow.target_dqn import TargetDQN from reinforcepy.learners.dqn.asynchronous.exp_replay_q_thread_learner import ExpQThreadLearner from reinforcepy.learners.dqn.asynchronous.async_thread_host import A...
gpl-3.0
yanlend/scikit-learn
sklearn/datasets/tests/test_samples_generator.py
181
15664
from __future__ import division from collections import defaultdict from functools import partial import numpy as np import scipy.sparse as sp from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing imp...
bsd-3-clause
Nyker510/scikit-learn
examples/datasets/plot_random_multilabel_dataset.py
93
3460
""" ============================================== Plot randomly generated multilabel dataset ============================================== This illustrates the `datasets.make_multilabel_classification` dataset generator. Each sample consists of counts of two features (up to 50 in total), which are differently distri...
bsd-3-clause
jorge2703/scikit-learn
sklearn/decomposition/tests/test_kernel_pca.py
155
8058
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
weleen/mxnet
example/autoencoder/data.py
18
1348
# 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
treverhines/PyGeoNS
demo/demo1/.write_synthetic.py
1
3079
import numpy as np from pygeons.mjd import mjd from pygeons.io.io import text_from_dict from pygeons.basemap import make_basemap import matplotlib.pyplot as plt np.random.seed(1) ## observation points ##################################################################### pos_geo = np.array([[-83.74,42.28,0.0], ...
mit
PredictiveScienceLab/py-orthpol
demos/demo10.py
2
2341
""" Generate the orthogonal polynomials using a scipy.stats random variable. This particular demo generates polynomials orthogonal with respect to a truncated normal distribution. This demo demonstrates how to: + Construct a set of orthogonal univariate polynomials given a scipy.stats random variable. + ...
lgpl-2.1
atamazian/traffic-proc-tools
Schreiber.py
1
3070
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2016 by Araik Tamazian, Viet Duc Nguyen #import pandas as pd import numpy as np import math import scipy.special as sp import cmath as cm def DFA(indata,q,m): scale = np.logspace(np.log10(10**1),np.log10(10**3),10) scale = scale.astype(int) y ...
mit
grehx/spark-tk
regression-tests/sparktkregtests/testcases/dicom/dicom_extract_tag_test.py
1
6765
# 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
nelson-liu/scikit-learn
sklearn/manifold/locally_linear.py
19
25916
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from ..base import B...
bsd-3-clause
rajat1994/scikit-learn
sklearn/feature_selection/rfe.py
137
17066
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause """Recursive feature elimination for feature ranking""" import warnings import numpy as np from ..utils import check_X_y, safe_sqr fro...
bsd-3-clause
eustislab/horton
horton/grid/test/test_poisson.py
1
6118
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2015 The HORTON Development Team # # This file is part of HORTON. # # HORTON 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-3.0
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/numpy/doc/creation.py
118
5507
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from...
gpl-3.0
quheng/scikit-learn
examples/applications/plot_tomography_l1_reconstruction.py
204
5442
""" ====================================================================== Compressive sensing: tomography reconstruction with L1 prior (Lasso) ====================================================================== This example shows the reconstruction of an image from a set of parallel projections, acquired along dif...
bsd-3-clause
sanketloke/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
ruymanengithub/vison
vison/metatests/nl.py
1
29774
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Aug 22 10:33:00 2019 @author: raf """ # IMPORT STUFF from pdb import set_trace as stop import copy import numpy as np from collections import OrderedDict import string as st import os import matplotlib.cm as cm from vison.fpa import fpa as fpamod fro...
gpl-3.0
cpaulik/scipy
doc/source/conf.py
40
10928
# -*- coding: utf-8 -*- import sys, os, re # Check Sphinx version import sphinx if sphinx.__version__ < "1.1": raise RuntimeError("Sphinx 1.1 or newer required") needs_sphinx = '1.1' # ----------------------------------------------------------------------------- # General configuration # -----------------------...
bsd-3-clause
xguse/bokeh
bokeh/charts/builder/tests/test_scatter_builder.py
33
2895
""" This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with thi...
bsd-3-clause
astocko/statsmodels
statsmodels/tsa/tests/test_seasonal.py
27
9216
import numpy as np from numpy.testing import assert_almost_equal, assert_equal, assert_raises from statsmodels.tsa.seasonal import seasonal_decompose from pandas import DataFrame, DatetimeIndex class TestDecompose: @classmethod def setupClass(cls): # even data = [-50, 175, 149, 214, 247, 237, ...
bsd-3-clause
eranr/mlstorlets
test/unit/test_serialize_classifier.py
1
6174
# Copyright (c) 2015-2016 itsonlyme.name # # 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 i...
apache-2.0
cainiaocome/scikit-learn
examples/applications/plot_outlier_detection_housing.py
243
5577
""" ==================================== Outlier detection on a real data set ==================================== This example illustrates the need for robust covariance estimation on a real data set. It is useful both for outlier detection and for a better understanding of the data structure. We selected two sets o...
bsd-3-clause
areeda/gwpy
gwpy/testing/fixtures.py
3
3700
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2018-2020) # # This file is part of GWpy. # # GWpy 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
mendax-grip/cfdemUtilities
couette/averageRadialScalar.py
2
2000
# This program averages a variable for each value of r for each files specified by the user # This program must be launched from the main folder of a case from which you can access ./CFD/ and ./voidfraction/ # A FOLDER ./voidfraction/averaged must exist! # Author : Bruno Blais # Last modified : 15-01-2014 #Python i...
lgpl-3.0
mmottahedi/neuralnilm_prototype
scripts/e398.py
4
23130
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit