repo_name
stringlengths
6
112
path
stringlengths
4
204
copies
stringclasses
257 values
size
stringlengths
4
7
content
stringlengths
552
1.04M
license
stringclasses
15 values
mne-tools/mne-tools.github.io
0.20/_downloads/76822bb92a8465181ec2a7ee96ca8cf4/plot_decoding_csp_timefreq.py
1
6457
""" ============================================================================ Decoding in time-frequency space data using the Common Spatial Pattern (CSP) ============================================================================ The time-frequency decomposition is estimated by iterating over raw data that has be...
bsd-3-clause
bijanfallah/OI_CCLM
src/RMSE_MAPS_INGO.py
1
2007
# 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
hsu/chrono
src/demos/trackVehicle/validationPlots_test_M113.py
5
4229
# -*- coding: utf-8 -*- """ Created on Wed May 06 11:00:53 2015 @author: newJustin """ import ChronoTrack_pandas as CT import pylab as py if __name__ == '__main__': # logger import logging as lg lg.basicConfig(fileName = 'logFile.log', level=lg.WARN, format='%(message)s') # default fo...
bsd-3-clause
wavelets/zipline
zipline/examples/dual_ema_talib.py
2
3230
#!/usr/bin/env python # # Copyright 2013 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 ...
apache-2.0
ChanChiChoi/scikit-learn
examples/model_selection/plot_roc.py
146
3697
""" ======================================= Receiver Operating Characteristic (ROC) ======================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality. ROC curves typically feature true positive rate on the Y axis, and false positive rate on the X a...
bsd-3-clause
rcolasanti/CompaniesHouseScraper
DVLACompanyNmeMatchCoHoAPIFindMissing.py
1
5174
import requests import json import numpy as np import pandas as pd import CoHouseToken from difflib import SequenceMatcher # In[3]: def exactMatch(line1, line2): line1=line1.upper().rstrip() line2=line2.upper().rstrip() #print("|"+line1+"|"+line2+"|",line1==line2) return line1==line2 def ...
gpl-3.0
mclaughlin6464/pasta
pasta/ising.py
1
5474
''' This is a dummy file for me to get started making an Ising model. I'll get this 2-D Ising running, then generalize. ''' import argparse from itertools import izip import numpy as np from matplotlib import pyplot as plt import seaborn as sns sns.set() def run_ising(N, d, K, J,h, n_steps, plot = False): ''' ...
mit
nicholaschris/landsatpy
stuff.py
1
1864
import cloud_detection_new as cloud_detection from matplotlib import pyplot as plt import views from skimage import exposure nir = cloud_detection.get_nir()[0:600,2000:2600] red = cloud_detection.get_red()[0:600,2000:2600] green = cloud_detection.get_green()[0:600,2000:2600] blue = cloud_detection.get_blue()[0:600,200...
mit
Monika319/EWEF-1
Cw2Rezonans/Karolina/Oscyloskop/OscyloskopZ5W2.py
1
1312
# -*- coding: utf-8 -*- """ Plot oscilloscope files from MultiSim """ import numpy as np import matplotlib.pyplot as plt import sys import os from matplotlib import rc rc('font',family="Consolas") files=["real_zad5_05f_p2.txt"] for NazwaPliku in files: print NazwaPliku Plik=open(NazwaPliku) #print DeltaT ...
gpl-2.0
nddsg/TreeDecomps
xplodnTree/tdec/b2CliqueTreeRules.py
1
3569
#!/usr/bin/env python __author__ = 'saguinag' + '@' + 'nd.edu' __version__ = "0.1.0" ## ## fname "b2CliqueTreeRules.py" ## ## TODO: some todo list ## VersionLog: import net_metrics as metrics import pandas as pd import argparse, traceback import os, sys import networkx as nx import re from collections import deque,...
mit
apache/spark
python/pyspark/sql/functions.py
14
161861
# # 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
Charence/stk-code
tools/batch.py
16
3189
from matplotlib import pyplot from os import listdir def is_numeric(x): try: float(x) except ValueError: return False return True avg_lap_time = {} avg_pos = {} avg_speed = {} avg_top = {} total_rescued = {} tests = len(listdir('../../batch'))-1 for file in listdir('...
gpl-3.0
tosolveit/scikit-learn
sklearn/ensemble/tests/test_partial_dependence.py
365
6996
""" Testing for the partial dependence module. """ import numpy as np from numpy.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import if_matplotlib from sklearn.ensemble.partial_dependence import partial_dependence from sklearn.ensemble.partial_dependence...
bsd-3-clause
caseyclements/bokeh
bokeh/compat/mplexporter/exporter.py
32
12403
""" Matplotlib Exporter =================== This submodule contains tools for crawling a matplotlib figure and exporting relevant pieces to a renderer. """ import warnings import io from . import utils import matplotlib from matplotlib import transforms from matplotlib.backends.backend_agg import FigureCanvasAgg clas...
bsd-3-clause
harlowja/networkx
examples/drawing/knuth_miles.py
50
2994
#!/usr/bin/env python """ An example using networkx.Graph(). miles_graph() returns an undirected graph over the 128 US cities from the datafile miles_dat.txt. The cities each have location and population data. The edges are labeled with the distance betwen the two cities. This example is described in Section 1.1 in ...
bsd-3-clause
abonil91/ncanda-data-integration
scripts/redcap/scoring/ctq/__init__.py
1
3092
#!/usr/bin/env python ## ## Copyright 2016 SRI International ## See COPYING file distributed along with the package for the copyright and license terms. ## import pandas import Rwrapper # # Variables from surveys needed for CTQ # # LimeSurvey field names lime_fields = [ "ctq_set1 [ctq1]", "ctq_set1 [ctq2]", "ct...
bsd-3-clause
jreback/pandas
pandas/io/formats/html.py
2
23192
""" Module for formatting output data in HTML. """ from textwrap import dedent from typing import Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union, cast from pandas._config import get_option from pandas._libs import lib from pandas import MultiIndex, option_context from pandas.io.common import is_url fro...
bsd-3-clause
modelkayak/python_signal_examples
energy_fft.py
1
2685
import numpy as np import scipy from matplotlib import pyplot as plt from numpy import pi as pi # Plotting logic switches time_plot = True freq_plot = True # Oversample to make things look purty oversample = 100 # Frequencies to simulate f_min = 5 #[Hz] f_max = 10 #[Hz] f_list = np.arange(f_min,f_max) # Note: arange...
mit
FrankTsui/robust_rescaled_svm
common.py
1
1636
import numpy as np import matplotlib.pyplot as plt def plot_decision_function(classifier, fea, gnd, title): ''' plot the decision function in 2-d plane classifiers: the svm models fea: array like, shape = (smp_num, fea_num) gnd: array like, shape = (smp_num,) title: title ...
apache-2.0
srinathv/vispy
vispy/visuals/isocurve.py
18
7809
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from __future__ import division import numpy as np from .line import LineVisual from ..color import ColorArray from ..color.colormap import _normalize, get_colormap from ..g...
bsd-3-clause
eljost/pysisyphus
deprecated/tests/test_dynamics/test_dynamics.py
1
2531
from matplotlib.patches import Circle import matplotlib.pyplot as plt import numpy as np import pytest from pysisyphus.calculators.AnaPot import AnaPot from pysisyphus.dynamics.velocity_verlet import md def test_velocity_verlet(): geom = AnaPot.get_geom((0.52, 1.80, 0)) x0 = geom.coords.copy() v0 = .1 * ...
gpl-3.0
adit-chandra/tensorflow
tensorflow/python/keras/applications/imagenet_utils.py
5
1439
# 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
AtsushiSakai/PythonRobotics
PathPlanning/Eta3SplinePath/eta3_spline_path.py
1
13649
""" eta^3 polynomials planner author: Joe Dinius, Ph.D (https://jwdinius.github.io) Atsushi Sakai (@Atsushi_twi) Ref: - [eta^3-Splines for the Smooth Path Generation of Wheeled Mobile Robots] (https://ieeexplore.ieee.org/document/4339545/) """ import numpy as np import matplotlib.pyplot as plt from scipy.i...
mit
kaczla/PJN
src/Przecinki/scikit.py
1
1048
#!/usr/bin/python2 # -*- coding: utf-8 -*- import sys import matplotlib.pyplot as plt import numpy as np from sklearn import datasets from sklearn.cross_validation import cross_val_predict from sklearn import linear_model from sklearn import datasets X = [] Y = [] for line in sys.stdin: line = line.rstrip() X...
gpl-2.0
danforthcenter/plantcv
plantcv/plantcv/photosynthesis/analyze_fvfm.py
2
5529
# Fluorescence Analysis import os import cv2 import numpy as np import pandas as pd from plotnine import ggplot, geom_label, aes, geom_line from plantcv.plantcv import print_image from plantcv.plantcv import plot_image from plantcv.plantcv import fatal_error from plantcv.plantcv import params from plantcv.plantcv impo...
mit
linearregression/mpld3
mpld3/__init__.py
20
1109
""" Interactive D3 rendering of matplotlib images ============================================= Functions: General Use ---------------------- :func:`fig_to_html` convert a figure to an html string :func:`fig_to_dict` convert a figure to a dictionary representation :func:`show` launch a web server to view...
bsd-3-clause
Vimos/scikit-learn
sklearn/ensemble/tests/test_partial_dependence.py
365
6996
""" Testing for the partial dependence module. """ import numpy as np from numpy.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import if_matplotlib from sklearn.ensemble.partial_dependence import partial_dependence from sklearn.ensemble.partial_dependence...
bsd-3-clause
pico12/trading-with-python
sandbox/spreadCalculations.py
78
1496
''' Created on 28 okt 2011 @author: jev ''' from tradingWithPython import estimateBeta, Spread, returns, Portfolio, readBiggerScreener from tradingWithPython.lib import yahooFinance from pandas import DataFrame, Series import numpy as np import matplotlib.pyplot as plt import os symbols = ['SPY','...
bsd-3-clause
XiaoxiaoLiu/morphology_analysis
bigneuron/reestimate_radius.py
1
1506
__author__ = 'xiaoxiaol' __author__ = 'xiaoxiaol' # run standardize swc to make sure swc files have one single root, and sorted, and has the valide type id ( 1~4) import matplotlib.pyplot as plt import seaborn as sb import os import os.path as path import numpy as np import pandas as pd import platform import sys imp...
gpl-3.0
Sumith1896/sympy
sympy/utilities/runtests.py
4
78928
""" This is our testing framework. Goals: * it should be compatible with py.test and operate very similarly (or identically) * doesn't require any external dependencies * preferably all the functionality should be in this file only * no magic, just import the test file and execute the test functions, that's it * po...
bsd-3-clause
gauravmm/Remote-Temperature-Monitor
utilities/colormap/colormaps.py
28
50518
# New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt, # and (in the case of viridis) Eric Firing. # # This file and the colormaps in it are released under the CC0 license / # public domain dedication. We would appreciate credit if you use or # redistribute these colormaps, but do not impose any legal r...
mit
meduz/scikit-learn
examples/linear_model/plot_lasso_lars.py
363
1080
#!/usr/bin/env python """ ===================== Lasso path using LARS ===================== Computes Lasso Path along the regularization parameter using the LARS algorithm on the diabetes dataset. Each color represents a different feature of the coefficient vector, and this is displayed as a function of the regulariza...
bsd-3-clause
timkpaine/lantern
tests/plot/test_plot.py
1
1272
from mock import patch import matplotlib matplotlib.use('Agg') class TestConfig: def setup(self): pass # setup() before each test method def teardown(self): pass # teardown() after each test method @classmethod def setup_class(cls): pass # setup_class...
apache-2.0
PrashntS/scikit-learn
examples/decomposition/plot_faces_decomposition.py
103
4394
""" ============================ Faces dataset decompositions ============================ This example applies to :ref:`olivetti_faces` different unsupervised matrix decomposition (dimension reduction) methods from the module :py:mod:`sklearn.decomposition` (see the documentation chapter :ref:`decompositions`) . """...
bsd-3-clause
cbmoore/statsmodels
docs/source/plots/graphics_gofplots_qqplot.py
38
1911
# -*- coding: utf-8 -*- """ Created on Sun May 06 05:32:15 2012 Author: Josef Perktold editted by: Paul Hobson (2012-08-19) """ from scipy import stats from matplotlib import pyplot as plt import statsmodels.api as sm #example from docstring data = sm.datasets.longley.load() data.exog = sm.add_constant(data.exog, pre...
bsd-3-clause
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/event_handling/zoom_window.py
1
2014
""" =========== Zoom Window =========== This example shows how to connect events in one window, for example, a mouse press, to another figure window. If you click on a point in the first window, the z and y limits of the second will be adjusted so that the center of the zoom in the second window will be the x,y coord...
mit
cwu2011/seaborn
seaborn/timeseries.py
6
13239
"""Timeseries plotting functions.""" from __future__ import division import numpy as np import pandas as pd from scipy import stats, interpolate import matplotlib as mpl import matplotlib.pyplot as plt from .external.six import string_types from . import utils from . import algorithms as algo from .palettes import c...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow/source/tensorflow/python/keras/wrappers/scikit_learn/__init__.py
73
1062
# 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
zak-k/cis
cis/test/plot_tests/idiff.py
3
2350
#!/usr/bin/env python # (C) British Crown Copyright 2010 - 2014, Met Office # # This file was heavily influenced by a similar file in the iris package. """ Provides "diff-like" comparison of images. Currently relies on matplotlib for image processing so limited to PNG format. """ from __future__ import (absolute_imp...
gpl-3.0
dyoung418/tensorflow
tensorflow/python/keras/_impl/keras/applications/xception_test.py
35
2109
# 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
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/examples/decomposition/plot_sparse_coding.py
1
4054
""" =========================================== Sparse coding with a precomputed dictionary =========================================== Transform a signal as a sparse combination of Ricker wavelets. This example visually compares different sparse coding methods using the :class:`sklearn.decomposition.SparseCoder` esti...
mit
ryfeus/lambda-packs
Tensorflow_OpenCV_Nightly/source/tensorflow/contrib/keras/python/keras/applications/vgg16.py
30
9077
# 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...
mit
Scaravex/clue-hackathon
clustering/time_profile_cluster.py
2
1438
# -*- coding: utf-8 -*- """ Created on Sun Mar 19 11:21:47 2017 @author: mskara """ import pandas as pd import matplotlib.pyplot as plt from src.pre_process import load_binary def create_profile_for_symptoms(df, date_range=15): profiles = {} for symptom in symptoms: temp = df[df['symptom'...
apache-2.0
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/pandas/compat/numpy/__init__.py
3
2213
""" support numpy compatiblitiy across versions """ import re import numpy as np from distutils.version import LooseVersion from pandas.compat import string_types, string_and_binary_types # numpy versioning _np_version = np.__version__ _nlv = LooseVersion(_np_version) _np_version_under1p8 = _nlv < '1.8' _np_version_...
agpl-3.0
dpinney/omf
omf/solvers/VB.py
1
29740
import pandas as pd import pulp import numpy as np from numpy import * class VirtualBattery(object): """ Base class for abstraction. """ def __init__(self, ambient_temp, capacitance, resistance, rated_power, COP, deadband, setpoint, tcl_number): # C :thermal capacitance # R : thermal resistance...
gpl-2.0
percyfal/snakemakelib-core
snakemakelib/plot/bokeh/color.py
1
1126
# Copyright (C) 2015 by Per Unneberg import math import pandas.core.common as com from bokeh.palettes import brewer as bokeh_brewer from .palettes import brewer as snakemakelib_brewer import logging logger = logging.getLogger(__name__) MINSIZE = 3 MAXSIZE = 9 # FIXME: some palettes have 9 as max, some 11 brewer = b...
mit
eegroopm/pyLATTICE
gui/pyLATTICE.py
1
74321
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ pyLATTICE is... """ from __future__ import division #necessary for python2 from __future__ import unicode_literals # define authorship information __authors__ = ['Evan Groopman', 'Thomas Bernatowicz'] __author__ = ','.join(__authors__) __credits__...
gpl-2.0
najmacherrad/master_thesis
Waltz/plotcomparaisons_waltz.py
1
7577
# Waltz # Compare results between wild type and mutant # coding=utf-8 import numpy as np import matplotlib.pyplot as plt import pandas as pd import csv from scipy import stats from pylab import plot, show, savefig, xlim, figure, \ hold, ylim, legend, boxplot, setp, axes import pylab from numpy import *...
mit
satishgoda/bokeh
examples/plotting/file/unemployment.py
46
1846
from collections import OrderedDict import numpy as np from bokeh.plotting import ColumnDataSource, figure, show, output_file from bokeh.models import HoverTool from bokeh.sampledata.unemployment1948 import data # Read in the data with pandas. Convert the year column to string data['Year'] = [str(x) for x in data['Y...
bsd-3-clause
tyler-abbot/psid_py
setup.py
1
2486
"""A setup module for psidPy Based on the pypa sample project. A tool to download data and build psid panels based on psidR by Florian Oswald. See: https://github.com/floswald/psidR https://github.com/tyler-abbot/psidPy """ from setuptools import setup, find_packages from codecs import open from os import path her...
mit
gfyoung/pandas
pandas/tests/indexes/common.py
2
28221
import gc from typing import Type import numpy as np import pytest from pandas._libs import iNaT from pandas.errors import InvalidIndexError from pandas.core.dtypes.common import is_datetime64tz_dtype from pandas.core.dtypes.dtypes import CategoricalDtype import pandas as pd from pandas import ( CategoricalInde...
bsd-3-clause
pp-mo/iris
lib/iris/quickplot.py
2
9074
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ High-level plotting extensions to :mod:`iris.plot`. These routines work much like their :mod:`iris.plot` counterparts, but...
lgpl-3.0
igabriel85/dmon-adp
misc/keras_test.py
1
1530
import numpy import pandas as pd from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scikit_learn import KerasClassifier from keras.utils import np_utils from sklearn.model_selection import cross_val_score from sklearn.model_selection import KFold from sklearn.preprocessing import Lab...
apache-2.0
MalkIPP/ipp_work
ipp_work/simulations/ir_marg_rate.py
1
8481
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify...
agpl-3.0
ResByte/graph_slam
scripts/robot.py
1
1487
#!/usr/bin/env python import roslib import rospy import sys from geometry_msgs.msg import Twist import numpy as np from nav_msgs.msg import Odometry from tf.transformations import euler_from_quaternion import matplotlib.pyplot as plt from sensor_msgs.msg import PointCloud2 import sensor_msgs.point_cloud2 as pc2 imp...
gpl-2.0
ywcui1990/nupic.research
projects/vehicle-control/agent/run_sm.py
6
7819
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
zmlabe/IceVarFigs
Scripts/SeaSurfaceTemperatures/plot_ersst5.py
1
5197
""" Plot selected years of monthly ERSSTv5 global data Website : https://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v5/netcdf/ Author : Zachary M. Labe Date : 22 July 2017 """ from netCDF4 import Dataset import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap, addcyclic, shiftgrid import numpy a...
mit
RachitKansal/scikit-learn
examples/feature_selection/plot_rfe_with_cross_validation.py
226
1384
""" =================================================== Recursive feature elimination with cross-validation =================================================== A recursive feature elimination example with automatic tuning of the number of features selected with cross-validation. """ print(__doc__) import matplotlib.p...
bsd-3-clause
rahiel/shellstats
shellstats.py
1
3629
# -*- coding: utf-8 -*- from __future__ import division from os import getenv from os.path import isfile from sys import exit import click @click.command() @click.option("--n", default=10, help="How many commands to show.") @click.option("--plot", is_flag=True, help="Plot command usage in pie chart.") @click.option(...
mit
gautam1858/tensorflow
tensorflow/python/keras/applications/nasnet.py
17
1814
# Copyright 2018 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
cbertinato/pandas
pandas/tests/frame/test_axis_select_reindex.py
1
44030
from datetime import datetime import numpy as np import pytest from pandas.errors import PerformanceWarning import pandas as pd from pandas import ( Categorical, DataFrame, Index, MultiIndex, Series, date_range, isna) from pandas.tests.frame.common import TestData import pandas.util.testing as tm from pandas.uti...
bsd-3-clause
mick-d/nipype
tools/make_examples.py
10
3014
#!/usr/bin/env python """Run the py->rst conversion and run all examples. This also creates the index.rst file appropriately, makes figures, etc. """ from __future__ import print_function, division, unicode_literals, absolute_import from builtins import open from past.builtins import execfile # -----------------------...
bsd-3-clause
angelmtenor/IDSFC
L1_intro/H_olympics_medal_points.py
1
1606
import numpy as np from pandas import DataFrame def numpy_dot(): """ Imagine a point system in which each country is awarded 4 points for each gold medal, 2 points for each silver medal, and one point for each bronze medal. Using the numpy.dot function, create a new dataframe called 'oly...
mit
oiertwo/vampyr
pdftoexcel.py
1
8194
__author__ = 'oier' import os import numpy as np from data.parameters import true_params from data.parameters import false_params import distance as dist import numpy as np def pdftotext(path): os.system("pdftotext {data}".format(data=path)) return(path.replace(".pdf",".txt")) import pandas as pd def parse(p...
mit
wrightni/OSSP
segment.py
1
6298
# title: Watershed Transform # author: Nick Wright # adapted from: Justin Chen, Arnold Song import numpy as np import gc import warnings from skimage import filters, morphology, feature, img_as_ubyte from scipy import ndimage from ctypes import * from lib import utils # For Testing: from skimage import segmentation i...
mit
saketkc/statsmodels
tools/backport_pr.py
30
5263
#!/usr/bin/env python """ Backport pull requests to a particular branch. Usage: backport_pr.py branch [PR] e.g.: python tools/backport_pr.py 0.13.1 123 to backport PR #123 onto branch 0.13.1 or python tools/backport_pr.py 1.x to see what PRs are marked for backport that have yet to be applied. Copied fr...
bsd-3-clause
RachitKansal/scikit-learn
examples/mixture/plot_gmm_classifier.py
250
3918
""" ================== GMM classification ================== Demonstration of Gaussian mixture models for classification. See :ref:`gmm` for more information on the estimator. Plots predicted labels on both training and held out test data using a variety of GMM classifiers on the iris dataset. Compares GMMs with sp...
bsd-3-clause
duolinwang/MusiteDeep
MusiteDeep/train_general.py
1
4521
import sys import os import pandas as pd import numpy as np import argparse def main(): parser=argparse.ArgumentParser(description='MusiteDeep custom training tool for general PTM prediction.') parser.add_argument('-input', dest='inputfile', type=str, help='training data in fasta format. Sites f...
gpl-2.0
rmhyman/DataScience
Lesson1/IntroToPandas.py
1
1976
import pandas as pd ''' The following code is to help you play with the concept of Series in Pandas. You can think of Series as an one-dimensional object that is similar to an array, list, or column in a database. By default, it will assign an index label to each item in the Series ranging from 0 to N, where N...
mit
davidzchen/tensorflow
tensorflow/python/keras/distribute/model_collection_base.py
11
1687
# Copyright 2019 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
neale/CS-program
434-MachineLearning/final_project/linearClassifier/sklearn/__init__.py
27
3086
""" Machine learning module for Python ================================== sklearn is a Python module integrating classical machine learning algorithms in the tightly-knit world of scientific Python packages (numpy, scipy, matplotlib). It aims to provide simple and efficient solutions to learning problems that are acc...
unlicense
WarrenWeckesser/scipy
scipy/interpolate/fitpack.py
16
26807
__all__ = ['splrep', 'splprep', 'splev', 'splint', 'sproot', 'spalde', 'bisplrep', 'bisplev', 'insert', 'splder', 'splantider'] import warnings import numpy as np # These are in the API for fitpack even if not used in fitpack.py itself. from ._fitpack_impl import bisplrep, bisplev, dblint from . import _f...
bsd-3-clause
jeffninghan/tracker
OCR_test/ocr_test.py
1
1285
import numpy as np import cv2 from matplotlib import pyplot as plt # test algorithm to recognize digits using kNN # source: http://docs.opencv.org/trunk/doc/py_tutorials/py_ml/py_knn/py_knn_opencv/py_knn_opencv.html img = cv2.imread('../data/digits.png') gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) # Now we split the...
mit
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.py
1
28321
""" A directive for including a matplotlib plot in a Sphinx document. By default, in HTML output, `plot` will include a .png file with a link to a high-res .png and .pdf. In LaTeX output, it will include a .pdf. The source code for the plot may be included in one of three ways: 1. **A path to a source file** as t...
mit
iemejia/beam
sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py
5
4390
# # 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
hfp/tensorflow-xsmm
tensorflow/contrib/eager/python/examples/l2hmc/l2hmc.py
29
12269
# Copyright 2018 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
hlin117/statsmodels
examples/python/regression_plots.py
33
9585
## Regression Plots from __future__ import print_function from statsmodels.compat import lzip import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.formula.api import ols ### Duncan's Prestige Dataset #### Load the Data # We can use a utility function...
bsd-3-clause
karthiks1995/dejavu
dejavu/fingerprint.py
15
5828
import numpy as np import matplotlib.mlab as mlab import matplotlib.pyplot as plt from scipy.ndimage.filters import maximum_filter from scipy.ndimage.morphology import (generate_binary_structure, iterate_structure, binary_erosion) import hashlib from operator import itemgetter IDX...
mit
timcera/mettoolbox
mettoolbox/pet.py
1
10467
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import warnings from typing import Optional, Union import numpy as np import pandas as pd import typic from solarpy import declination from tstoolbox import tsutils from . import meteolib, utils warnings.filterwarnings("ignore...
bsd-3-clause
olologin/scikit-learn
examples/linear_model/plot_sgd_iris.py
286
2202
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print(__doc__) ...
bsd-3-clause
achabotl/pambox
setup.py
1
3387
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from setuptools import setup from setuptools.command.test import test as TestCommand import codecs import os import re here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): # intentionally *not* adding an encoding ...
bsd-3-clause
hmendozap/auto-sklearn
autosklearn/metalearning/metafeatures/plot_metafeatures.py
1
20297
from __future__ import print_function import argparse import cPickle import itertools import os import StringIO import sys import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.decomposition import PCA try: from sklearn.manifold import TSNE from sklearn.metrics.pairwise import P...
bsd-3-clause
rupak0577/ginga
ginga/web/pgw/Plot.py
3
4306
# # Plot.py -- Plotting widget canvas wrapper. # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from io import BytesIO from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from ...
bsd-3-clause
AlexanderFabisch/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py
46
2798
"""Build a sentiment analysis / polarity model Sentiment analysis can be casted as a binary text classification problem, that is fitting a linear classifier on features extracted from the text of the user messages so as to guess wether the opinion of the author is positive or negative. In this examples we will use a ...
bsd-3-clause
paladin74/neural-network-animation
matplotlib/tests/test_dviread.py
15
1788
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from nose.tools import assert_equal import matplotlib.dviread as dr import os.path original_find_tex_file = dr.find_tex_file def setup(): dr.find_tex_file = lambda x: x def teardown(): dr...
mit
phobson/statsmodels
statsmodels/sandbox/tsa/movstat.py
34
14871
'''using scipy signal and numpy correlate to calculate some time series statistics original developer notes see also scikits.timeseries (movstat is partially inspired by it) added 2009-08-29 timeseries moving stats are in c, autocorrelation similar to here I thought I saw moving stats somewhere in python, maybe not)...
bsd-3-clause
intermezzo-fr/hillary-clinton-emails
scripts/outputCsvs.py
5
3577
import numpy as np import pandas as pd def normalize_address(raw_address): for c in ["'", ",", "°", "•", "`", '"', "‘", "-"]: raw_address = raw_address.replace(c, "") raw_address = raw_address.lower() if "<" in raw_address: prefix = raw_address[:raw_address.index("<")].strip() if ...
mit
nan86150/ImageFusion
lib/python2.7/site-packages/matplotlib/tests/__init__.py
17
2578
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import difflib import os from matplotlib import rcParams, rcdefaults, use _multiprocess_can_split_ = True # Check that the test directories exist if not os.path.exists(os.path.join( os....
mit
andreugrimalt/Theano-Tutorials
5_convolutional_net.py
1
3899
import theano from theano import tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import numpy as np from load import mnist from theano.tensor.nnet.conv import conv2d from theano.tensor.signal.downsample import max_pool_2d import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 imp...
mit
leesavide/pythonista-docs
Documentation/matplotlib/mpl_examples/pylab_examples/contourf_log.py
9
1350
''' Demonstrate use of a log color scale in contourf ''' from matplotlib import pyplot as P import numpy as np from numpy import ma from matplotlib import colors, ticker, cm from matplotlib.mlab import bivariate_normal N = 100 x = np.linspace(-3.0, 3.0, N) y = np.linspace(-2.0, 2.0, N) X, Y = np.meshgrid(x, y) # A ...
apache-2.0
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/matplotlib/tests/test_patheffects.py
10
5445
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np from matplotlib.testing.decorators import image_comparison, cleanup import matplotlib.pyplot as plt import matplotlib.patheffects as path_effects try: # mock in python 3.3+ ...
mit
parrt/lolviz
prince_dtree.py
1
12296
import IPython, graphviz, re from io import StringIO from IPython.display import Image import numpy as np import pandas as pd import math from sklearn import tree from sklearn.datasets import load_boston, load_iris from collections import defaultdict import string import re YELLOW = "#fefecd" # "#fbfbd0" # "#FBFEB0" B...
bsd-3-clause
priseborough/InertialNav
code/plot_states.py
6
2287
#!/bin/python import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.cbook as cbook import numpy as np import math # State vector: # 0-3: quaternions (q0, q1, q2, q3) # 4-6: Velocity - m/sec (North, East, Down) # 7-9: Position - m (North, East, Down) # 10-12: Delta Angle bias - rad (X,Y,Z) #...
bsd-3-clause
ThomasMiconi/nupic.research
projects/l2_pooling/multi_column_convergence.py
2
22360
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it under the ...
agpl-3.0
airware/jsbsim
tests/TestScriptOutput.py
2
3376
# TestScriptInputOutput.py # # Check that <output> tags specified in a script are properly handled # # Copyright (c) 2015 Bertrand Coconnier # # 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; eit...
lgpl-2.1
cbertinato/pandas
pandas/tests/frame/test_combine_concat.py
1
34741
from datetime import datetime import numpy as np import pytest import pandas as pd from pandas import DataFrame, Index, Series, Timestamp, date_range import pandas.util.testing as tm from pandas.util.testing import assert_frame_equal, assert_series_equal class TestDataFrameConcatCommon: def test_concat_multipl...
bsd-3-clause
jungla/ICOM-fluidity-toolbox
2D/RST/plot_T_spec_res.py
1
8498
import os, sys import myfun import numpy as np import matplotlib as mpl mpl.use('ps') import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from scipy import interpolate import lagrangian_stats import scipy.fftpack ## READ archive (too many points... somehow) # args: name, dayi, dayf, days label = ...
gpl-2.0
dankolbman/BCIM
src/post.py
1
7125
import glob import os import sys import re import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import numpy as np import python.DataIO as DataIO import python.graphics as graphics import python.clusters as clusters import python.counts as counts # Format settings from matplotlib i...
mit
sugartom/tensorflow-alien
tensorflow/examples/learn/text_classification.py
39
5106
# 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
capturePointer/vigra
vigranumpy/examples/grid_graph_shortestpath.py
8
3978
import vigra import vigra.graphs as vigraph import pylab import numpy np=numpy import sys import matplotlib import pylab as plt import math from matplotlib.widgets import Slider, Button, RadioButtons def makeWeights(gamma): global hessian,gradmag,gridGraph print "hessian",hessian.min(),hessian.max() print ...
mit