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
marquettecomputationalsocialscience/clusteredcrimemaps
individual_work/justin/app.py
1
3056
import json import csv from datetime import datetime from flask import Flask, render_template, request from sklearn.cluster import KMeans import numpy as np app = Flask(__name__) previous_data = [] prev_bool = False colors = ['#ff7800', '#42a1f4', '#0ad81f', '#d80909', '#c407c4', 'yellow', 'black', 'white', 'brown']...
mit
geekboxzone/lollipop_external_blktrace
btt/btt_plot.py
43
11282
#! /usr/bin/env python # # btt_plot.py: Generate matplotlib plots for BTT generate data files # # (C) Copyright 2009 Hewlett-Packard Development Company, L.P. # # 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 So...
gpl-2.0
IvarsKarpics/mxcube
gui/__init__.py
1
4094
# # Project: MXCuBE # https://github.com/mxcube # # This file is part of MXCuBE software. # # MXCuBE is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
lgpl-3.0
IssamLaradji/scikit-learn
sklearn/datasets/base.py
12
17971
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import shutil from os import environ from os.pa...
bsd-3-clause
DrSleep/tensorflow-deeplab-lfov
train.py
1
6595
"""Training script for the DeepLab-LargeFOV network on the PASCAL VOC dataset for semantic image segmentation. This script trains the model using augmented PASCAL VOC dataset, which contains approximately 10000 images for training and 1500 images for validation. """ from __future__ import print_function import ar...
mit
pprett/scikit-learn
sklearn/mixture/tests/test_gaussian_mixture.py
19
40215
# Author: Wei Xue <xuewei4d@gmail.com> # Thierry Guillemot <thierry.guillemot.work@gmail.com> # License: BSD 3 clauseimport warnings import sys import warnings import numpy as np from scipy import stats, linalg from sklearn.covariance import EmpiricalCovariance from sklearn.datasets.samples_generator import...
bsd-3-clause
idoerg/BOA
src/plot/heatmap.py
1
15741
###./imp.py deletedOrg /home/asmariyaz/Desktop/phylo_order /home/asmariyaz/Desktop/txtnames import numpy as np from matplotlib.colors import LinearSegmentedColormap import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.cbook as cbook from matplotlib._png import read_png from matplotlib.offsetbox im...
gpl-3.0
asurve/incubator-systemml
projects/breast_cancer/breastcancer/preprocessing.py
15
26035
#------------------------------------------------------------- # # 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...
apache-2.0
jaganadhg/kaggle-rest-rev
src/latest.py
1
20154
#!/usr/bin/env python from datetime import datetime, timedelta from datetime import date import numpy as np import pandas as pd from sklearn.ensemble import GradientBoostingRegressor, RandomForestRegressor from sklearn.grid_search import GridSearchCV from sklearn.metrics import r2_score, mean_squared_error from skl...
bsd-3-clause
alephu5/Soundbyte
environment/lib/python3.3/site-packages/pandas/sparse/panel.py
1
18412
""" Data structures for sparse float data. Life is made simpler by dealing only with float64 data """ # pylint: disable=E1101,E1103,W0231 from pandas.compat import range, lrange, zip from pandas import compat import numpy as np from pandas.core.index import Index, MultiIndex, _ensure_index from pandas.core.frame imp...
gpl-3.0
esa/pykep
pykep/pontryagin/_leg.py
2
30828
from pykep.pontryagin._dynamics import _dynamics from pykep.core import MU_SUN, epoch, AU from pykep.sims_flanagan import spacecraft, sc_state from scipy.integrate import ode import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D class leg(object): """I...
gpl-3.0
rax85/tensorflow-stuff
1_cnn/deprecated.gen_data.py
1
2608
#!/usr/bin/python3 ## # A data set generator for the convolutional neural network example. Yes it is probably easier # to use a mnist data set from somewhere but where's the fun in that. Instead, generate a batch # of images using system fonts. ## import constants import math import os import random import string fr...
apache-2.0
anurag313/scikit-learn
sklearn/covariance/graph_lasso_.py
10
25820
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
bsd-3-clause
supriyagarg/pydatalab
google/datalab/contrib/mlworkbench/_local_predict.py
2
13549
# Copyright 2017 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
benschneider/sideprojects1
FFT_filters/digFiltSim.py
1
3506
import numpy as np import matplotlib.pyplot as plt from numpy import pi, sin, cos from scipy.constants import h, e from scipy.constants import Boltzmann as k import Gnuplot as gp def LPfft(sinput, lpfreq, T): Nlp = int(lpfreq*len(sinput)*T) fftlp = np.fft.fft(sinput) # 0,1,2,3,-3,-2,-1 fftlp[Nlp+1:-Nlp] ...
gpl-2.0
jeffdonahue/voc-classification
src/train_cls.py
1
6190
from __future__ import division from __future__ import print_function # Train and evaluate a classification model for VOC2012 import argparse import config import numpy as np parser = argparse.ArgumentParser(description='Train and evaluate a classification model for VOC') # Model parameters parser.add_argument('proto...
bsd-2-clause
gregreen/bayestar
scripts/maptools.py
1
43776
#!/usr/bin/env python # -*- coding: utf-8 -*- # # maptools.py # # Copyright 2013-2014 Greg Green <greg@greg-UX31A> # # 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 2 of ...
gpl-2.0
aminert/scikit-learn
examples/ensemble/plot_ensemble_oob.py
259
3265
""" ============================= OOB Errors for Random Forests ============================= The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where each new tree is fit from a bootstrap sample of the training observations :math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er...
bsd-3-clause
adamrvfisher/TechnicalAnalysisLibrary
NormChaikinOpt1.py
1
4370
# -*- coding: utf-8 -*- """ Created on Tue Apr 4 02:25:29 2017 @author: AmatVictoriaCuramIII """ import numpy as np from pandas_datareader import data import random as rand import pandas as pd empty = [] #reusable list #set up desired number of datasets for different period analysis dataset = pd.DataFra...
apache-2.0
olologin/scikit-learn
examples/linear_model/plot_sgd_weighted_samples.py
344
1458
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
bsd-3-clause
noxer-org/noxer
noxer/rnn.py
1
10485
""" Learning with networks that can process sequential data. """ from sklearn.base import ClassifierMixin, RegressorMixin, BaseEstimator, TransformerMixin from sklearn.preprocessing import LabelEncoder, FunctionTransformer from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split ...
mit
CforED/Machine-Learning
sklearn/decomposition/tests/test_sparse_pca.py
160
6028
# Author: Vlad Niculae # License: BSD 3 clause import sys import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.utils.testing import ass...
bsd-3-clause
PatrickChrist/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
dsm054/pandas
pandas/tests/groupby/test_transform.py
1
28755
""" test with the .transform """ import pytest import numpy as np import pandas as pd from pandas.util import testing as tm from pandas import Series, DataFrame, Timestamp, MultiIndex, concat, date_range from pandas.core.dtypes.common import ( ensure_platform_int, is_timedelta64_dtype) from pandas.compat import S...
bsd-3-clause
bokeh/bokeh
bokeh/sampledata/periodic_table.py
1
1972
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
alexvmarch/atomic
exatomic/widgets/widget_df.py
3
3074
# -*- coding: utf-8 -*- # Copyright (c) 2015-2018, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ A dataframe widget ######################### A generic pandas dataframe widget. """ import pandas as pd from ipywidgets import Box, Dropdown, IntRangeSlider, SelectMultiple, Butt...
apache-2.0
programmdesign/checkmate
checkmate/tests/lib/git/test_repository.py
1
3710
""" This file is part of checkmate, a meta code checker written in Python. Copyright (C) 2015 Andreas Dewes, QuantifiedCode UG This program 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...
agpl-3.0
gnieboer/tensorflow
tensorflow/examples/learn/wide_n_deep_tutorial.py
29
8985
# 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
IssamLaradji/scikit-learn
sklearn/tests/test_random_projection.py
19
14015
from __future__ import division import numpy as np import scipy.sparse as sp from sklearn.metrics import euclidean_distances from sklearn.random_projection import johnson_lindenstrauss_min_dim from sklearn.random_projection import gaussian_random_matrix from sklearn.random_projection import sparse_random_matrix from...
bsd-3-clause
andrewcbennett/iris
docs/iris/example_code/Meteorology/TEC.py
12
1054
""" Ionosphere space weather ======================== This space weather example plots a filled contour of rotated pole point data with a shaded relief image underlay. The plot shows aggregated vertical electron content in the ionosphere. The plot exhibits an interesting outline effect due to excluding data values be...
gpl-3.0
yavuzhan/carPricePrediction-ML
manipulating_sahibinden.py
1
1324
# -*- coding: utf-8 -*- # manipulating the data for features are on a similar scale import pandas as pd data = pd.read_csv('C:\\Users\\Yavuzhan\\Desktop\\DataMining_codes\\sahibinden\\S_sahibinden.csv', index_col = False) # , index_col = False df = pd.DataFrame(data) #manipulating price price_max = df.price.m...
gpl-3.0
ttm/oscEmRede
venv/share/doc/networkx-1.8.1/examples/drawing/giant_component.py
10
2050
#!/usr/bin/env python """ This example illustrates the sudden appearance of a giant connected component in a binomial random graph. Requires pygraphviz and matplotlib to draw. """ # Copyright (C) 2006-2008 # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov...
gpl-3.0
yl565/statsmodels
statsmodels/tsa/statespace/mlemodel.py
1
113093
""" State Space Model Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function from statsmodels.compat.python import long import numpy as np import pandas as pd from scipy.stats import norm from .simulation_smoother import SimulationSmoother from .kalman_smooth...
bsd-3-clause
jklenzing/pysat
pysat/tests/test_custom.py
2
13848
import numpy as np from nose.tools import raises import pandas as pds import pysat class TestBasics(): def setup(self): """Runs before every method to create a clean testing setup.""" self.testInst = pysat.Instrument('pysat', 'testing', tag='10', clean_le...
bsd-3-clause
toastedcornflakes/scikit-learn
sklearn/linear_model/coordinate_descent.py
2
81257
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
bsd-3-clause
ChanderG/scikit-learn
sklearn/gaussian_process/tests/test_gaussian_process.py
267
6813
""" Testing for Gaussian Process module (sklearn.gaussian_process) """ # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # Licence: BSD 3 clause from nose.tools import raises from nose.tools import assert_true import numpy as np from sklearn.gaussian_process import GaussianProcess from sklearn.gaussian_process ...
bsd-3-clause
jakobworldpeace/scikit-learn
sklearn/ensemble/voting_classifier.py
19
9888
""" Soft Voting/Majority Rule classifier. This module contains a Soft Voting/Majority Rule classifier for classification estimators. """ # Authors: Sebastian Raschka <se.raschka@gmail.com>, # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator f...
bsd-3-clause
frank-tancf/scikit-learn
examples/cluster/plot_dbscan.py
346
2479
# -*- coding: utf-8 -*- """ =================================== Demo of DBSCAN clustering algorithm =================================== Finds core samples of high density and expands clusters from them. """ print(__doc__) import numpy as np from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn...
bsd-3-clause
MITHyperloopTeam/software_core
software/simulation/sandbox/python/PodPlant.py
1
14538
#!/usr/bin/python import time, math import numpy as np import matplotlib.pyplot as plt import yaml import scipy.ndimage as ndimage #****************************************************************************** # Tube # Manages simulation of tube environment. #********************************************************...
lgpl-3.0
r9y9/librosa
docs/examples/plot_presets.py
3
3179
# coding: utf-8 """ ======= Presets ======= This notebook demonstrates how to use the `presets` package to change the default parameters for librosa. """ # Code source: Brian McFee # License: ISC ################################################## # We'll need numpy and matplotlib for this example from __future__ imp...
isc
datapythonista/pandas
pandas/tests/frame/methods/test_is_homogeneous_dtype.py
4
1422
import numpy as np import pytest import pandas.util._test_decorators as td from pandas import ( Categorical, DataFrame, ) # _is_homogeneous_type always returns True for ArrayManager pytestmark = td.skip_array_manager_invalid_test @pytest.mark.parametrize( "data, expected", [ # empty ...
bsd-3-clause
ndingwall/scikit-learn
sklearn/discriminant_analysis.py
6
34470
""" Linear Discriminant Analysis and Quadratic Discriminant Analysis """ # Authors: Clemens Brunner # Martin Billinger # Matthieu Perrot # Mathieu Blondel # License: BSD 3-Clause import warnings import numpy as np from scipy import linalg from scipy.special import expit from .base import ...
bsd-3-clause
PmagPy/PmagPy
pmagpy_tests/test_ipmag.py
1
64648
#!/usr/bin/env python import unittest import os import sys import re import matplotlib from matplotlib import pyplot as plt import requests import shutil import random import glob import numpy as np from pmagpy import pmag from pmagpy import ipmag from pmagpy import contribution_builder as cb from pmagpy import conver...
bsd-3-clause
MatthewRalston/ansible-cloudman-image
files/ipython_config.py
15
14156
# Configuration file for ipython. c = get_config() c.InteractiveShell.autoindent = True c.InteractiveShell.colors = 'Linux' c.InteractiveShell.confirm_exit = False c.AliasManager.user_aliases = [ ('ll', 'ls -l'), ('lt', 'ls -ltr'), ] #------------------------------------------------------------------------------ #...
mit
IBT-FMI/SAMRI
samri/utilities.py
1
13239
import multiprocessing as mp import nibabel as nib import nipype.interfaces.io as nio import numpy as np import os import pandas as pd from itertools import product from joblib import Parallel, delayed from os import path # PyBIDS 0.6.5 and 0.10.2 compatibility try: from bids.grabbids import BIDSLayout except ModuleNo...
gpl-3.0
e-q/scipy
scipy/integrate/_ivp/ivp.py
21
27556
import inspect import numpy as np from .bdf import BDF from .radau import Radau from .rk import RK23, RK45, DOP853 from .lsoda import LSODA from scipy.optimize import OptimizeResult from .common import EPS, OdeSolution from .base import OdeSolver METHODS = {'RK23': RK23, 'RK45': RK45, 'DOP853': ...
bsd-3-clause
zfrenchee/pandas
pandas/io/pytables.py
1
162222
""" High level interface to PyTables for reading and writing pandas data structures to disk """ # pylint: disable-msg=E1101,W0613,W0603 from datetime import datetime, date import time import re import copy import itertools import warnings import os from pandas.core.dtypes.common import ( is_list_like, is_cate...
bsd-3-clause
petosegan/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
254
2253
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
Anton04/IoT-kit
InfluxDBInterface.py
1
15982
#!/bin/python from influxdb import InfluxDBClient import json import pandas as pd import numpy class InfluxDBlayer(InfluxDBClient): def ProcessSeriesParameter(self,series): #Handle indexing instead of name if type(series) == int: Series = self.ListSeries() #Series.sort() series =...
mit
frank-tancf/scikit-learn
sklearn/metrics/cluster/tests/test_supervised.py
41
8901
import numpy as np from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics.cluster import homogeneity_score from sklearn.metrics.cluster import completeness_score from sklearn.metrics.cluster import v_measure_score from sklearn.metrics.cluster import homogeneity_completeness_v_measure from sklearn...
bsd-3-clause
billy-inn/scikit-learn
sklearn/ensemble/weight_boosting.py
97
40773
"""Weight Boosting This module contains weight boosting estimators for both classification and regression. The module structure is the following: - The ``BaseWeightBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regression and classification only differ from each ot...
bsd-3-clause
pm2111/Heart-Defibrillation-Project
python plotting 2/series_heatmaps.py
1
1591
import numpy as np import matplotlib.pyplot as plt import os path = "/Users/petermarinov/msci project/plotting python 2/sequence of averaged frames light apd short sim/nu_0.2" filenames = [] for f in os.listdir(path): if not f.startswith('.'): filenames.append(f) horizontal = 100 total_...
mit
zhuango/python
pandasLearning/lrModel_forCom_Q3.py
2
2568
import sklearn from sklearn import linear_model from sklearn import tree from sklearn.datasets import load_iris import pandas as pd import numpy as np from sklearn.metrics import accuracy_score from sklearn import preprocessing from sklearn import neural_network def standard(tasks, attri): scaler = preprocessing.S...
gpl-2.0
shirtsgroup/pygo
analysis/figure_generation/Fig8_plot_dGf_boot.py
1
5649
#!/usr/bin/python2.4 import numpy import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib import cPickle import optparse import plot_dG_solution import pdb def read_boot(file): f = open(file,'rb') temp = cPickle.load(f) X = cPickle.load(f) dX = cPickle.load(f) f.close() re...
gpl-2.0
XuesongYang/end2end_dialog
BaselineModel.py
1
20518
# -*- coding: UTF-8 -*- ''' Baseline system using CRFtagger and SVM to perform NLU and SAP, respectively. Training Process: training two models separately. Test Process: raw text --> CRFtagger with lexical features --> user tag sequence --> reshape into binary vecor --> OneVsRestClassifier(Li...
mit
dilawar/moose-full
moose-examples/traub_2005/py/vclamptest.py
2
4847
# vclamptest.py --- # # Filename: vclamptest.py # Description: # Author: # Maintainer: # Created: Wed Feb 6 16:25:52 2013 (+0530) # Version: # Last-Updated: Tue Jun 11 17:30:34 2013 (+0530) # By: subha # Update #: 148 # URL: # Keywords: # Compatibility: # # # Commentary: # # Set up a voltag...
gpl-2.0
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/sklearn/kernel_approximation.py
258
17973
""" The :mod:`sklearn.kernel_approximation` module implements several approximate kernel feature maps base on Fourier transforms. """ # Author: Andreas Mueller <amueller@ais.uni-bonn.de> # # License: BSD 3 clause import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import svd from .base im...
gpl-2.0
bleepr/bleepr-manage
modules/data_visualiser.py
1
3926
from __future__ import print_function from operator import add import csv import numpy as np import matplotlib as mpl mpl.use('Agg') # Allows it to work without X server import matplotlib.pyplot as plt from scipy.misc import imread class DataVisualiser(object): def __init__(self): return None def get...
mit
azvoleff/chitwanabm
chitwanabm/runmodel.py
1
21421
#!/usr/bin/env python # Copyright 2008-2013 Alex Zvoleff # # This file is part of the chitwanabm agent-based model. # # chitwanabm 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 Licen...
gpl-3.0
jaklinger/nesta_dataflow
collect_data/utils/common/browser.py
1
3506
''' browser ------- ''' import logging import pandas as pd from pyvirtualdisplay import Display from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from utils.common.timer import t...
mit
sdsc/xsede_stats
tacc_stats/analysis/plot/masterplot.py
1
7750
import sys from plots import Plot from tacc_stats.analysis.gen import tspl_utils from matplotlib.figure import Figure import numpy class MasterPlot(Plot): k1={'amd64' : ['amd64_core','amd64_core','amd64_sock','lnet','lnet', 'ib_sw','ib_sw','cpu'], 'intel_pmc3' : ['intel_pmc3', 'intel_pmc3', 'inte...
lgpl-2.1
carlosmccosta/robot_localization_tools
scripts/path_plotter_3d.py
2
8406
#!/usr/bin/env python # coding=UTF-8 import argparse import ntpath import sys import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as tk from mpl_toolkits.mplot3d import axis3d from math import atan2, asin from numpy import rad2deg def str2bool(v): return v.lower() in ("yes", "true", "t", ...
bsd-3-clause
ch3ll0v3k/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
jreback/pandas
pandas/tests/indexes/base_class/test_setops.py
2
8588
from datetime import datetime import numpy as np import pytest import pandas as pd from pandas import Index, Series import pandas._testing as tm from pandas.core.algorithms import safe_sort class TestIndexSetOps: @pytest.mark.parametrize( "method", ["union", "intersection", "difference", "symmetric_diff...
bsd-3-clause
ky822/Data_Bootcamp
Code/Python/imf_weo_all.py
2
1562
""" Messing around with the IMF's WEO dataset. The first section is an exploration of various methods of reading data from a url. Once we've read in the data, we can slice as needed. Note: data file is labeled xls but it's really tab-delimited text. Prepared for the NYU Course "Data Bootcamp." More at https...
mit
ambikeshwar1991/gnuradio-3.7.4
gr-filter/examples/synth_filter.py
58
2552
#!/usr/bin/env python # # Copyright 2010,2012,2013 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
AndersenLab/cegwas-web
base/views/tools/indel_primer.py
2
11500
import io import re import json import tabix import arrow import requests import numpy as np import pandas as pd from cyvcf2 import VCF from flask import (Blueprint, jsonify, render_template, request, abort, Response) from fl...
mit
sdrogers/ms2ldaviz
ms2ldaviz/compute_pca.py
1
1576
import os import pickle import numpy as np import sys os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ms2ldaviz.settings") import django django.setup() from sklearn.decomposition import PCA import jsonpickle from basicviz.models import MultiFileExperiment,MultiLink,Experiment,Document,Feature,FeatureInstance,Mass2...
mit
thirdwing/mxnet
example/autoencoder/data.py
27
1272
# 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
AlwaysLearningDeeper/Project
src/dqn/DQN_unstructuredMemory.py
2
11776
import gym,time,copy,re import numpy as np import tensorflow as tf from matplotlib import pyplot as plt import cv2 import matplotlib from Replay_Memory import Replay_Memory tf.logging.set_verbosity(tf.logging.INFO) MEMORY_LENGTH = 4 ACTIONS = 4 LEARNING_RATE_SGD = 0.0001 LEARNING_RATE_RMSPROP = .0001 FINAL_EXPLORAT...
mit
almarklein/bokeh
examples/charts/bar.py
1
1383
from collections import OrderedDict import numpy as np import pandas as pd from bokeh.charts import Bar from bokeh.plotting import output_file, show, VBox from bokeh.sampledata.olympics2014 import data as original_data data = {d['abbr']: d['medals'] for d in original_data['data'] if d['medals']['total'] > 0} countr...
bsd-3-clause
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/Applications/ParaView/Testing/Python/TestPythonViewMatplotlibScript.py
1
1798
# Set up a basic scene for rendering. from paraview.simple import * import os import sys script = """ import paraview.numpy_support # Utility to get next color def getNextColor(): colors = 'bgrcmykw' for c in colors: yield c # This function must be defined. It is where specific data arrays are requested. def...
gpl-3.0
QudevETH/PycQED_py3
pycqed/analysis/multiplexed_RO_analysis.py
1
11620
# Based on Niels analysis from os.path import join from pycqed.analysis import measurement_analysis as ma import numpy as np import pylab # %matplotlib inline from matplotlib import pyplot as plt from numpy.linalg import inv def two_qubit_ssro_fidelity(label, fig_format='png', qubit_labels...
mit
eliben/deep-learning-samples
linear-regression/multiple_linear_regression.py
1
9333
# Example of solving multivariate linear regression in Python. # # Uses only Numpy, with Matplotlib for plotting. # # Eli Bendersky (http://eli.thegreenplace.net) # This code is in the public domain from __future__ import print_function import csv import matplotlib.pyplot as plt import numpy as np from timer import Ti...
unlicense
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/numpy/lib/npyio.py
6
63502
__all__ = ['savetxt', 'loadtxt', 'genfromtxt', 'ndfromtxt', 'mafromtxt', 'recfromtxt', 'recfromcsv', 'load', 'loads', 'save', 'savez', 'savez_compressed', 'packbits', 'unpackbits', 'fromregex', 'DataSource'] import numpy as np import format import sys import os import sys import itertools import ...
agpl-3.0
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/pandas/io/tests/test_stata.py
9
46598
# -*- coding: utf-8 -*- # pylint: disable=E1101 from datetime import datetime import datetime as dt import os import warnings import nose import struct import sys from distutils.version import LooseVersion import numpy as np import pandas as pd from pandas.compat import iterkeys from pandas.core.frame import DataFra...
artistic-2.0
bobflagg/sentiment-analysis
fsa/etl/etl.py
1
3683
# -*- coding: utf-8 -*- """ Created on Tue Dec 13 17:08:34 2016 @author: birksworks """ import os import pandas as pd import pyprind SOURCE_DIRECTORY = '/home/code/nlp/sentiment-analysis-text-classification/text_convnet/data' TARGET_DIRECTORY = '/home/code/nlp/sentiment-analysis-text-classification/sentiment-analysi...
gpl-3.0
bzero/statsmodels
statsmodels/graphics/tests/test_mosaicplot.py
17
18878
from __future__ import division from statsmodels.compat.python import iterkeys, zip, lrange, iteritems, range from numpy.testing import assert_, assert_raises, dec from numpy.testing import run_module_suite # utilities for the tests from statsmodels.compat.collections import OrderedDict from statsmodels.api import d...
bsd-3-clause
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py
10
21106
""" An agg http://antigrain.com/ backend Features that are implemented * capstyles and join styles * dashes * linewidth * lines, rectangles, ellipses * clipping to a rectangle * output to RGBA and PNG, optionally JPEG and TIFF * alpha blending * DPI scaling properly - everything scales properly (dashes, linew...
mit
MohammedWasim/scikit-learn
examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py
218
3893
""" ============================================== Feature agglomeration vs. univariate selection ============================================== This example compares 2 dimensionality reduction strategies: - univariate feature selection with Anova - feature agglomeration with Ward hierarchical clustering Both metho...
bsd-3-clause
2039/skule
Project 1 - Problem 1 d.py
1
3654
import numpy as np import math as m import matplotlib.pyplot as plt #N signifies the number of candidates interviewed. N = range(16,45+1) #The optimal cutoff point is 11 because the expected value of N is 30, given N is uniformly distributed. #K = range(1,15+1) #The computed optimal value for k was 10. K = range(10,...
mit
jswanljung/iris
lib/iris/symbols.py
16
7823
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
rbrecheisen/pyminer
pyminer/network/selectors.py
1
3162
__author__ = 'Ralph' import pandas as pd from base import Node from base import InputPort from base import OutputPort class Selector(Node): def __init__(self, name): super(Selector, self).__init__(name) self.add_input_port( InputPort(name='input', data_type=pd.DataFrame)) s...
apache-2.0
bundgus/python-playground
matplotlib-playground/examples/pylab_examples/centered_ticklabels.py
2
1674
# sometimes it is nice to have ticklabels centered. mpl currently # associates a label with a tick, and the label can be aligned # 'center', 'left', or 'right' using the horizontal alignment property: # # # for label in ax.xaxis.get_xticklabels(): # label.set_horizontalalignment('right') # # # but this doesn't...
mit
YzPaul3/h2o-3
py2/testdir_single_jvm/test_GLM_hastie_shuffle.py
20
5925
import unittest, time, sys, random, copy sys.path.extend(['.','..','../..','py']) import h2o2 as h2o import h2o_cmd, h2o_import as h2i, h2o_jobs, h2o_glm, h2o_util from h2o_test import verboseprint, dump_json, OutputObj # Dataset created from this: # Elements of Statistical Learning 2nd Ed.; Hastie, Tibshirani, Friedm...
apache-2.0
OGGM/oggm
oggm/core/centerlines.py
2
80871
""" Compute the centerlines according to Kienholz et al (2014) - with modifications. The output is a list of Centerline objects, stored as a list in a pickle. The order of the list is important since the lines are sorted per order (hydrological flow level), from the lower orders (upstream) to the higher orders (downst...
bsd-3-clause
shoyer/xarray
xarray/tests/__init__.py
1
5117
import importlib import platform import re import warnings from contextlib import contextmanager from distutils import version from unittest import mock # noqa: F401 import numpy as np import pytest from numpy.testing import assert_array_equal # noqa: F401 from pandas.testing import assert_frame_equal # noqa: F401 ...
apache-2.0
kesre/slask
plugins/gif.py
2
2392
"""!gif <search term> return a random result from the google gif search result for <search term>""" from urllib import quote import re import requests from random import randint, choice, shuffle def gif(searchterm_raw): # There's a chance of pandas today eggs = ['panda', 'nick cage'] if randint(0, 100) ...
mit
mgahsan/QuantEcon.py
examples/optgrowth_v0.py
7
2024
""" Filename: optgrowth_v0.py Authors: John Stachurski and Thomas Sargent A first pass at solving the optimal growth problem via value function iteration. A more general version is provided in optgrowth.py. """ from __future__ import division # Omit for Python 3.x import matplotlib.pyplot as plt import numpy as np ...
bsd-3-clause
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/Contact/Interface_Mesh_Types/Interface_1/HardContact_NonLinHardShear/Interface_Test_Normal_Plot.py
30
2779
#!/usr/bin/python import h5py import matplotlib.pylab as plt import matplotlib as mpl import sys import numpy as np; import matplotlib; import math; from matplotlib.ticker import MaxNLocator plt.rcParams.update({'font.size': 28}) # set tick width mpl.rcParams['xtick.major.size'] = 10 mpl.rcParams['xtick.major.width']...
cc0-1.0
alephu5/Soundbyte
environment/lib/python3.3/site-packages/pandas/stats/interface.py
2
4506
from pandas.core.api import Series, DataFrame, Panel, MultiIndex from pandas.stats.ols import OLS, MovingOLS from pandas.stats.plm import PanelOLS, MovingPanelOLS, NonPooledPanelOLS import pandas.stats.common as common def ols(**kwargs): """Returns the appropriate OLS object depending on whether you need simp...
gpl-3.0
nelango/ViralityAnalysis
model/lib/sklearn/neighbors/graph.py
208
7031
"""Nearest Neighbors graph functions""" # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # # License: BSD 3 clause (C) INRIA, University of Amsterdam import warnings from .base import KNeighborsMixin, RadiusNeighborsMixin from .unsupervised import NearestNeighbors def _check_params(X, metric, p, metric_...
mit
kjs73/pele
playground/hs_wca_cell_lists/hs_wca_cell_lists.py
5
21971
from __future__ import division import numpy as np from pele.potentials import HS_WCA from pele.optimize import ModifiedFireCPP, LBFGS_CPP import time import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages import matplotlib from matplotlib.patches import Circle import pylab from scipy.o...
gpl-3.0
xzh86/scikit-learn
examples/ensemble/plot_adaboost_hastie_10_2.py
355
3576
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
bsd-3-clause
joergdietrich/astropy
astropy/visualization/wcsaxes/formatter_locator.py
2
15163
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import print_function, division, absolute_import # This file defines the AngleFormatterLocator class which is a class that # provides both a method for a formatter and one for a locator, for a given # label spacing. The advantage of keepi...
bsd-3-clause
Achuth17/scikit-learn
sklearn/linear_model/tests/test_omp.py
272
7752
# Author: Vlad Niculae # Licence: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equa...
bsd-3-clause
Eric89GXL/mne-python
mne/utils/_testing.py
4
18309
# -*- coding: utf-8 -*- """Testing functions.""" # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) from contextlib import contextmanager from distutils.version import LooseVersion from functools import partial, wraps import os import inspect from io import StringIO from shutil imp...
bsd-3-clause
anna-effeindzourou/trunk
examples/FluidCouplingPFV/drainage-2PFV-Yuan_and_Chareyre_2017.py
2
5480
# encoding: utf-8 # This script demonstrates a simple case of drainage simulation using the "2PFV" two-phase model implemented in UnsaturatedEngine. # The script was used to generate the result and supplementary material (video) of [1]. The only difference is the problem size (40k particles in the paper vs. 1k (default...
gpl-2.0
ilri/azizi.ilri.org
freezerweb/cgi-bin/freezer_plot.py
1
1511
#!/usr/bin/env python #import matplotlib functions and set it to output files instead of printing to an X window import matplotlib matplotlib.use('Agg') from pylab import figure, show, xlabel, ylabel, title from matplotlib.dates import HourLocator, MinuteLocator, DateFormatter import sys import cgi #import our databa...
gpl-3.0
nwilming/ocupy
doc/conf.py
1
7299
# -*- coding: utf-8 -*- # # res.analysis documentation build configuration file, created by # sphinx-quickstart on Wed Dec 22 16:29:57 2010. # # 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. # ...
gpl-2.0