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
amadeuspzs/travelTime
detect_peaks.py
4
6618
"""Detect peaks in data based on their amplitude and other features.""" from __future__ import division, print_function import numpy as np __author__ = "Marcos Duarte, https://github.com/demotu/BMC" __version__ = "1.0.4" __license__ = "MIT" def detect_peaks(x, mph=None, mpd=1, threshold=0, edge='rising', ...
mit
Nodoka/Bioquality
graphing/horigrid_endglob_scatters.py
1
2876
#!/usr/bin/env ipython """ A scatter graph of grid count vs grid area. """ import numpy as np import matplotlib.pyplot as plt # extract data from csv # CAUTION! column locations differ from filtered. # file_name = "../data/Hori_area_weight.csv" # uncomment when using filtered data file_name = "../data/Hori_area_weigh...
mit
edhuckle/statsmodels
statsmodels/tsa/base/datetools.py
27
10629
from statsmodels.compat.python import (lrange, lzip, lmap, string_types, callable, asstr, reduce, zip, map) import re import datetime from pandas import Period from pandas.tseries.frequencies import to_offset from pandas import datetools as pandas_datetools import numpy as np #NOTE: All...
bsd-3-clause
peterbraden/tensorflow
tensorflow/examples/skflow/text_classification_builtin_rnn_model.py
3
2786
# Copyright 2015-present The Scikit Flow 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 require...
apache-2.0
merenlab/anvio
anvio/pfam.py
1
25958
#!/usr/bin/env python # -*- coding: utf-8 """This file contains PfamSetup and Pfam classes.""" import anvio import anvio.dbops as dbops import anvio.utils as utils import anvio.terminal as terminal import anvio.filesnpaths as filesnpaths from anvio.drivers.hmmer import HMMer from anvio.parsers import parser_modules f...
gpl-3.0
murali-munna/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
openastro/d2d
python/plot_transfer.py
4
7667
''' Copyright (c) 2014-2016 Kartik Kumar, Dinamica Srl (me@kartikkumar.com) Distributed under the MIT License. See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT ''' # Set up modules and packages # Plotting import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from matpl...
mit
jamesHuffman/pyciss
pyciss/solitons.py
1
1702
from datetime import datetime as dt import pandas as pd import pkg_resources as pr from astropy import units as u from numpy import poly1d def get_year_since_resonance(ringcube): "Calculate the fraction of the year since moon swap." t0 = dt(2006, 1, 21) td = ringcube.imagetime - t0 return td.days / 3...
isc
ltiao/scikit-learn
examples/preprocessing/plot_function_transformer.py
161
1949
""" ========================================================= Using FunctionTransformer to select columns ========================================================= Shows how to use a function transformer in a pipeline. If you know your dataset's first principle component is irrelevant for a classification task, you ca...
bsd-3-clause
moutai/scikit-learn
examples/covariance/plot_lw_vs_oas.py
159
2951
""" ============================= Ledoit-Wolf vs OAS estimation ============================= The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and Wolf proposed a close formula to compute the asymptotically optimal shrinkage parameter (minimizing a MSE criterion), yielding th...
bsd-3-clause
murali-munna/scikit-learn
sklearn/metrics/tests/test_regression.py
272
6066
from __future__ import division, print_function import numpy as np from itertools import product from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils....
bsd-3-clause
kevin-intel/scikit-learn
examples/decomposition/plot_ica_vs_pca.py
14
3339
""" ========================== FastICA on 2D point clouds ========================== This example illustrates visually in the feature space a comparison by results using two different component analysis techniques. :ref:`ICA` vs :ref:`PCA`. Representing ICA in the feature space gives the view of 'geometric ICA': ICA...
bsd-3-clause
daniaki/Enrich2
enrich2/tests/utilities.py
1
9258
# Copyright 2016-2017 Alan F Rubin, Daniel C Esposito # # This file is part of Enrich2. # # Enrich2 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
projectchrono/chrono
src/chrono_gpu/utils/GpuNFNet.py
4
4058
# Import pandas and math libraries import pandas as pd import math import numpy as np import sys numOfFiles = int(sys.argv[1]); path = str(sys.argv[2]); # This path should be a folder path = path + '/' for i in range(numOfFiles): # csv1-Particle contact data (normal force magnitude, friction force vector) ...
bsd-3-clause
sirusb/pastis
doc/sphinxext/gen_rst.py
3
30132
""" Example generation for the scikit learn Generate the rst files for the examples by iterating over the python example files. Files that generate images should start with 'plot' """ from time import time import os import shutil import traceback import glob import sys from StringIO import StringIO import cPickle im...
bsd-3-clause
Obus/scikit-learn
examples/covariance/plot_robust_vs_empirical_covariance.py
248
6359
r""" ======================================= Robust vs Empirical covariance estimate ======================================= The usual covariance maximum likelihood estimate is very sensitive to the presence of outliers in the data set. In such a case, it would be better to use a robust estimator of covariance to guar...
bsd-3-clause
ueshin/apache-spark
python/pyspark/pandas/frame.py
8
433210
# # 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
gdementen/xlwings
xlwings/tests/test_shape.py
1
8532
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import unittest import xlwings as xw from xlwings.tests.common import TestBase, this_dir try: import matplotlib as mpl import matplotlib.pyplot as plt except ImportError: mpl = None try: import PIL except ImportError: PIL =...
bsd-3-clause
balazssimon/ml-playground
udemy/lazyprogrammer/logistic-regression-python/bad_xor.py
1
1565
# logisitc regression classifier for the XOR problem. # # the notes for this class can be found at: # https://deeplearningcourses.com/c/data-science-logistic-regression-in-python # https://www.udemy.com/data-science-logistic-regression-in-python from __future__ import print_function, division from builtins import ran...
apache-2.0
gotomypc/scikit-learn
sklearn/__check_build/__init__.py
345
1671
""" Module to give helpful messages to the user that did not compile the scikit properly. """ import os INPLACE_MSG = """ It appears that you are importing a local scikit-learn source tree. For this, you need to have an inplace install. Maybe you are in the source directory and you need to try from another location.""...
bsd-3-clause
yuchengdong/project-beta-1
code/dataprep_script.py
4
1758
""" The following script will apply a 3mm Gaussian filter on all the data spatially and will save each smoothed run into the data folder as 'smoothed_run_i', where 0 <= i <= 7 is the index of the run. """ #Import libraries import numpy as np import scipy import scipy.ndimage from scipy.ndimage.filters import gauss...
bsd-3-clause
arabenjamin/pybrain
pybrain/auxiliary/gaussprocess.py
25
9240
from __future__ import print_function __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de; Christian Osendorfer, osendorf@in.tum.de' from scipy import r_, exp, zeros, eye, array, asarray, random, ravel, diag, sqrt, sin, cos, sort, mgrid, dot, floor from scipy import c_ #@UnusedImport from scipy.linalg import solve,...
bsd-3-clause
google/trimmed_match
trimmed_match/post_analysis/tests/trimmed_match_post_analysis_test.py
1
15924
# Copyright 2020 Google LLC. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
RedhawkSDR/integration-gnuhawk
gnuradio/gr-filter/examples/reconstruction.py
12
4824
#!/usr/bin/env python # # Copyright 2010,2012 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 optio...
gpl-3.0
abhishekgahlot/scikit-learn
benchmarks/bench_plot_neighbors.py
287
6433
""" Plot the scaling of the nearest neighbors algorithms with k, D, and N """ from time import time import numpy as np import pylab as pl from matplotlib import ticker from sklearn import neighbors, datasets def get_data(N, D, dataset='dense'): if dataset == 'dense': np.random.seed(0) return np....
bsd-3-clause
wztzjhn/quantum_basis
examples/trans_absent/latt_chain/plot_sqw.py
1
4278
#!/usr/bin/python import sys import numpy as np import matplotlib #matplotlib.use("Agg") import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap num_argv = len(sys.argv) if ( num_argv<6 ): sys.exit("Usage: plot_sqw filename step eta omega_max max_intensity ...") elif ( sys.argv[1]=='...
gpl-3.0
sytays/openanalysis
doc/conf.py
1
6136
# -*- coding: utf-8 -*- # # OpenAnalysis documentation build configuration file, created by # sphinx-quickstart on Wed Jul 19 12:44:16 2017. # # 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-3.0
jmargeta/scikit-learn
examples/linear_model/lasso_dense_vs_sparse_data.py
13
1862
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ print(__doc__) from time import time from scipy import sparse from scipy ...
bsd-3-clause
yipenggao/moose
gui/utils/Plotter.py
8
6217
#!usr/bin/python import sys, os, random try: from PyQt4 import QtCore, QtGui QtCore.Signal = QtCore.pyqtSignal QtCore.Slot = QtCore.pyqtSlot except ImportError: try: from PySide import QtCore, QtGui QtCore.QString = str except ImportError: raise ImportError("Cannot load eit...
lgpl-2.1
jrderuiter/im-fusion
src/imfusion/expression/test.py
2
27237
# -*- coding: utf-8 -*- """Contains functions that test for differential expression.""" # pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import from __future__ import absolute_import, division, print_function from builtins import * # pylint: enable=wildcard-import,redefined-builtin,unused-wildcard-i...
mit
fabianvaccaro/pygums
pythonLibs/mahotas-1.1.0/build/lib.linux-armv6l-2.7/mahotas/features/surf.py
2
9884
# Copyright (C) 2010-2013, Luis Pedro Coelho <luis@luispedro.org> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # License: MIT (see COPYING file) from __future__ import division import numpy as np from . import _surf from ..internal import _verify_is_integer_type __all__ = ['integral', 'surf'] def integral(f, ...
gpl-2.0
snnn/tensorflow
tensorflow/contrib/losses/python/metric_learning/metric_loss_ops_test.py
24
20551
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Winand/pandas
pandas/tests/test_window.py
1
154033
from itertools import product import pytest import sys import warnings from warnings import catch_warnings from datetime import datetime, timedelta from numpy.random import randn import numpy as np from distutils.version import LooseVersion import pandas as pd from pandas import (Series, DataFrame, bdate_range, isna,...
bsd-3-clause
yunfeilu/scikit-learn
examples/neighbors/plot_regression.py
349
1402
""" ============================ 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
theodoregoetz/clas12-dc-wiremap
clas12_wiremap/ui/mpl_canvas.py
1
1082
from __future__ import print_function, division, unicode_literals import sys import os import numpy as np from numpy import random as rand from matplotlib import pyplot, gridspec from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from clas12_wiremap...
gpl-3.0
ashhher3/scikit-learn
sklearn/neighbors/nearest_centroid.py
25
7219
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..ext...
bsd-3-clause
jeremyfix/pylearn2
pylearn2/scripts/datasets/step_through_small_norb.py
49
3123
#! /usr/bin/env python """ A script for sequentially stepping through SmallNORB, viewing each image and its label. Intended as a demonstration of how to iterate through NORB images, and as a way of testing SmallNORB's StereoViewConverter. If you just want an image viewer, consider pylearn2/scripts/show_binocular_gra...
bsd-3-clause
dhruv13J/scikit-learn
examples/svm/plot_svm_anova.py
250
2000
""" ================================================= SVM-Anova: SVM with univariate feature selection ================================================= This example shows how to perform univariate feature before running a SVC (support vector classifier) to improve the classification scores. """ print(__doc__) import...
bsd-3-clause
Eric89GXL/scikit-learn
examples/applications/face_recognition.py
12
5368
""" =================================================== 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
joyeshmishra/spark-tk
regression-tests/sparktkregtests/testcases/scoretests/svm_model_test.py
10
3519
# 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
clemsos/mitras
tests/test_geo.py
1
4990
#!/usr/bin/env python # -*- coding: utf-8 -*- from test_helpers import TestHelpers helpers=TestHelpers() helpers.add_relative_path() from lib.mongo import MongoDB from lib.geo import geocode import ner import json import numpy as np from datetime import datetime import matplotlib.pyplot as plt import matplotlib.cm a...
mit
paulrbrenner/GOS
examples/migration/visualization/basemapviz.py
2
1344
import matplotlib.pyplot as plt import matplotlib.cm import numpy as np import pandas as pd from mpl_toolkits.basemap import Basemap from matplotlib.patches import Polygon from matplotlib.collections import PatchCollection from matplotlib.colors import Normalize def map(dataframe, title = "Map", colorbarName = None): ...
apache-2.0
matthewalbani/scipy
scipy/signal/fir_filter_design.py
23
28336
# -*- coding: utf-8 -*- """Functions for FIR filter design.""" from __future__ import division, print_function, absolute_import from math import ceil, log import numpy as np from numpy.fft import irfft from scipy.special import sinc from scipy.linalg import toeplitz, hankel, pinv from . import sigtools __all__ = ['ka...
bsd-3-clause
Scapogo/zipline
tests/pipeline/test_blaze.py
3
70826
""" Tests for the blaze interface to the pipeline api. """ from __future__ import division from collections import OrderedDict from datetime import timedelta, time from itertools import product, chain import warnings import blaze as bz from datashape import dshape, var, Record from nose_parameterized import parameter...
apache-2.0
vermouthmjl/scikit-learn
sklearn/utils/fixes.py
7
13511
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # ...
bsd-3-clause
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/subplots_axes_and_figures/axes_zoom_effect.py
1
4158
""" ================ Axes Zoom Effect ================ """ from matplotlib.transforms import Bbox, TransformedBbox, \ blended_transform_factory from mpl_toolkits.axes_grid1.inset_locator import BboxPatch, BboxConnector,\ BboxConnectorPatch def connect_bbox(bbox1, bbox2, loc1a, loc2a, loc1b,...
mit
smartscheduling/scikit-learn-categorical-tree
sklearn/linear_model/bayes.py
18
15122
""" Various bayesian regression """ from __future__ import print_function # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from .base import LinearModel from ..base import RegressorMixin from ..utils.extmath import fast_logdet, p...
bsd-3-clause
irisliu0616/Short-text-Classification
Model/20News/20news_LSTM-SVM.py
1
8621
# coding: utf-8 from __future__ import print_function import os import numpy as np import time np.random.seed(1337) from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.utils.np_utils import to_categorical from keras.layers import Dense, Flatten, Activation ...
mit
voxlol/scikit-learn
sklearn/linear_model/tests/test_randomized_l1.py
214
4690
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.linear_model.randomized_l1 i...
bsd-3-clause
darioizzo/pykep
pykep/trajopt/_mga_lt_nep.py
2
10130
from numpy.linalg import norm from math import sqrt, asin, acos from pykep.core import epoch, fb_con, EARTH_VELOCITY, AU, MU_SUN from pykep.planet import jpl_lp from pykep.sims_flanagan import leg, spacecraft, sc_state class mga_lt_nep: """ This class is a pygmo (http://esa.github.io/pygmo/) problem represent...
gpl-3.0
akhilaananthram/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/mathtext.py
69
101723
r""" :mod:`~matplotlib.mathtext` is a module for parsing a subset of the TeX math syntax and drawing them to a matplotlib backend. For a tutorial of its usage see :ref:`mathtext-tutorial`. This document is primarily concerned with implementation details. The module uses pyparsing_ to parse the TeX expression. .. _p...
agpl-3.0
glouppe/scikit-learn
sklearn/__init__.py
29
3071
""" 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...
bsd-3-clause
sahg/SAHGutils
sahgutils/io/dwafdata.py
1
5130
"""Utilities for fetching and plotting DWAF real-time data. This module contains some simple functions to make it easier to read and plot the data from GRIB(version 1) files produced by SAWS Unified Model. The module relies on Wesley Ebisuzaki's wgrib programme being somewhere on your systems path. If you don't have w...
bsd-3-clause
DarkEnergySurvey/ugali
ugali/scratch/simulation/validate_sim_population.py
2
11123
import os import glob import numpy as np import astropy.io.fits as pyfits import matplotlib.patches as patches import pylab pylab.ion() ########## def wrap(x): x_return = x x_return[x > 180.] = x[x > 180.] - 360. return x_return ########## def getCatalogFile(catalog_dir, mc_source_id): """ Inpu...
mit
sinhrks/pandas-ml
pandas_ml/test/test_groupby.py
1
5710
#!/usr/bin/env python import numpy as np import pandas as pd import sklearn.datasets as datasets import pandas_ml as pdml import pandas_ml.util.testing as tm class TestModelFrameGroupBy(tm.TestCase): def test_frame_groupby(self): df = pd.DataFrame({'A': [1, 2, 1, 2], ...
bsd-3-clause
mrocklin/into
into/backends/hdfstore.py
1
3041
from __future__ import absolute_import, division, print_function import pandas as pd import datashape from datashape import discover from ..append import append from ..convert import convert, ooc_types from ..chunks import chunks, Chunks from ..resource import resource HDFDataset = (pd.io.pytables.AppendableFrameTa...
bsd-3-clause
WaltXon/curvey
volumes.py
1
3643
from collections import OrderedDict import pprint import datetime import pandas as pd from arps import arps_hyp_rate from phd import rate_at_t, cum_at_t, effective_decline_annual, nominal_decline_annual from config import config from functions import get_products, annual_to_monthly_rate from templates import volumes ...
cc0-1.0
pnedunuri/scikit-learn
examples/linear_model/plot_ransac.py
250
1673
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example we see how to robustly fit a linear model to faulty data using the RANSAC algorithm. """ import numpy as np from matplotlib import pyplot as plt from sklearn import ...
bsd-3-clause
xiaoxiamii/scikit-learn
examples/svm/plot_svm_kernels.py
329
1971
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM-Kernels ========================================================= Three different types of SVM-Kernels are displayed below. The polynomial and RBF are especially useful when the data-points are not linearly sep...
bsd-3-clause
noamkatzir/palm-hand-reading
tests/test6.py
1
3575
__author__ = 'noam' import os import cv2 import numpy as np from matplotlib import pyplot as plt from numpy import linalg from operator import itemgetter, attrgetter, methodcaller # return list of center sorted descending to the contour area # and the min rect cordinates def mapPalmAndFingers(contours, image): ha...
bsd-3-clause
RPGOne/scikit-learn
sklearn/gaussian_process/tests/test_gpr.py
8
11823
"""Testing for Gaussian process regression """ # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from scipy.optimize import approx_fprime from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels \ import RBF, Constan...
bsd-3-clause
sstoma/CellProfiler
cellprofiler/modules/saveimages.py
1
60060
'''<b>Save Images </b> saves image or movie files. <hr> Because CellProfiler usually performs many image analysis steps on many groups of images, it does <i>not</i> save any of the resulting images to the hard drive unless you specifically choose to do so with the <b>SaveImages</b> module. You can save any of the proc...
gpl-2.0
caogang/wgan-gp
gan_language.py
1
9868
import os, sys sys.path.append(os.getcwd()) import time import numpy as np import torch import torch.autograd as autograd import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import language_helpers import tflib as lib import tflib.plot from sklearn.preprocessing import OneHotEncoder ...
mit
yiori-s/fit_instagram_gender
instagram_collector.py
1
2456
import sys from settings import instgram_access_token from api import InstagramAPI, Alchemy import pandas as pd import csv def following_users(api, user_name): instgram_user_id = api.user_id(user_name=user_name) following_users = api.follows_list(user_id=instgram_user_id) return following_users def use...
mit
xuyifan0720/image-processor
Smart_image/Smart_image/photo_editor.py
1
7183
import cv2 import numpy as np from matplotlib import pyplot as plt import os from Tkinter import * from PIL import Image, ImageStat import math import argparse class PhotoEditor: def __init__(self, directory_name, destination, brightness,blur): self.img = None self.imageFile = None self.di...
mit
kayarre/Tools
test_rec2.py
1
9831
from __future__ import print_function """ Do a mouseclick somewhere, move the mouse to some destination, release the button. This class gives click- and release-events and also draws a line or a box from the click-point to the actual mouseposition (within the same axes) until the button is released. Within the method...
bsd-2-clause
rthouvenin/meteography
meteography/django/broadcaster/views.py
1
4747
# -*- coding:utf-8 -*- from itertools import groupby import io from datetime import datetime from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.dates import DateFormatter from matplotlib.figure import Figure from matplotlib.ticker import MaxNLocator import numpy as np from dj...
mit
lneisenman/meanet
meanet/random.py
1
2638
# -*- coding: utf-8 -*- from __future__ import (print_function, division, absolute_import, unicode_literals) import matplotlib.pyplot as plt import numpy as np from .mea import MEA from .meanet import corr_matrix_to_graph, calc_cfp_from_MEA def shuffle(data): """ Return a random spiket...
bsd-3-clause
ivankreso/stereo-vision
scripts/egomotion_kitti_eval/old/kitti_eval/plot_kitti_path.py
1
2072
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt import math filepath1 = "/home/kivan/Projects/datasets/KITTI/poses/07.txt" filepath2 = "/home/kivan/Dropbox/experiment_data/img/07_nodf.txt" #filepath2 = "/home/kivan/Dropbox/experiment_data/img/07_df.txt" #filepath2 = "/home/kivan/Dropbox/experiment...
bsd-3-clause
vanpact/scipy
scipy/special/basic.py
26
64332
# # Author: Travis Oliphant, 2002 # from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy._lib.six import xrange from numpy import (pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt, where, mgrid, sin, place, issubdtype, extract, ...
bsd-3-clause
subutai/htmresearch
htmresearch/frameworks/pytorch/duty_cycle_metrics.py
2
2176
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2018, 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 progra...
agpl-3.0
tody411/ImageViewerFramework
ivf/ui/matplot_frame.py
1
1647
# -*- coding: utf-8 -*- ## @package ivf.ui.matplot_frame # # ivf.ui.matplot_frame utility package. # @author tody # @date 2016/02/11 from PyQt4.QtGui import * from PyQt4.QtCore import * import matplotlib.pyplot as plt from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas fro...
mit
TammoR/rgb_simplex
create_simplex.py
1
1990
import numpy as np import matplotlib import matplotlib.pyplot as plt def plot_rgb_image(image, figsize=(6, 6), fontsize=18, dpi=150, labels=True): """ plot rgb simplex. image is an array of shape (X,Y,3) """ x_size, y_size, _ = image.shape font = {'family': 'serif', ...
gpl-3.0
fdesjardins/nara-stepbrowser
src/browserMatPlotFrame.py
1
5362
#!/usr/bin/env python import gc from PyQt4 import QtGui, QtCore from PyQt4.QtGui import QPushButton from PyQt4.QtGui import QLabel, QSlider, QComboBox from PyQt4.QtGui import QMessageBox, QSpinBox, QSpacerItem from PyQt4.QtCore import Qt import numpy from numpy import arange, sin, pi import matplotlib from matplotl...
mit
b1quint/samfp
samfp/old/split_scan_files.py
1
4985
#!/usr/bin/env python # -*- coding: utf8 -*- """ Split Scan Files This script splits the scan files based on their header informations. This makes easier to handle the data later. """ from __future__ import division, print_function from multiprocessing import Pool import argparse import astropy.io.fits a...
bsd-3-clause
HACKtheMACHINE/data-waddle
template.py
1
2050
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ R Template for HACKtheMACHINE September 22nd and 23rd Created on Sun Sep 17 13:55:52 2017 @author: danielbrownjr """ # Import Packages import numpy as np import matplotlib.pyplot as plt import pandas as pd # Import package modules from sklearn.preproc...
mit
nhejazi/scikit-learn
examples/preprocessing/plot_scaling_importance.py
45
5269
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Importance of Feature Scaling ========================================================= Feature scaling though standardization (or Z-score normalization) can be an important preprocessing step for many machine learn...
bsd-3-clause
loli/semisupervisedforests
sklearn/utils/setup.py
296
2884
import os from os.path import join from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): import numpy from numpy.distutils.misc_util import Configuration config = Configuration('utils', parent_package, top_path) config.add_subpackage('sparsetools') ...
bsd-3-clause
Ginkgo-Biloba/Misc-Python
numpy/Pandas2Excel.py
1
2036
# coding = utf-8 """ (2) 读写 Excel 文件 From: https://github.com/wizardforcel/pandas-official-tutorials-zh/blob/master/3.3.md """ import pandas as pd import matplotlib.pyplot as plt import numpy as np plt.style.use("ggplot") # 设置种子 np.random.seed(111) # 生成测试数据的函数 def CreateDataSet(Number=1): Output = list() for i in ...
gpl-3.0
mclaughlin6464/pdnn
myStuff/show_results.py
1
2141
import numpy as np import sys import os import cPickle, gzip #TODO Not sure what to do with this one, because there isn't a right-wrong to mine. Perhaps average error? pred_file = sys.argv[1] if '.gz' in pred_file: pred_mat = cPickle.load(gzip.open(pred_file, 'rb')) else: pred_mat = cPickle.load(open(pred_fil...
apache-2.0
tkchafin/mrbait
mrbait/seq_graph.py
1
4798
#!/usr/bin/python import networkx as nx import networkx.algorithms.approximation as nxaa #import matplotlib.pyplot as plt import numpy as np from networkx.utils import powerlaw_sequence """Code for ATTEMPTING to approximate the maximal independent set in a graph of conflicting sequences (e.g. aligned > threshold in p...
gpl-3.0
IgorWang/LM4paper
docs/conf.py
1
8689
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys # ...
gpl-3.0
juliandewit/kaggle_ndsb2017
step2_train_nodule_detector.py
2
19296
import settings import helpers import sys import os import glob import random import pandas import ntpath import cv2 import numpy from typing import List, Tuple from keras.optimizers import Adam, SGD from keras.layers import Input, Convolution2D, MaxPooling2D, UpSampling2D, merge, Convolution3D, MaxPooling3...
mit
kbase/feature_values
clusterservice/ClusterServicePyImpl.py
1
4205
#BEGIN_HEADER import sklearn.cluster as cl #END_HEADER class ClusterServicePy: ''' Module Name: ClusterServicePy Module Description: ''' ######## WARNING FOR GEVENT USERS ####### # Since asynchronous IO can lead to methods - even the same method - # interrupting each other, you ...
mit
michalmonselise/sparklingpandas
sparklingpandas/prdd.py
4
5745
"""Provide a way to work with pandas data frames in Spark""" # # 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-2.0
akopich/spark
python/pyspark/sql/context.py
24
24915
# # 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
einarhuseby/arctic
tests/unit/store/test_version_store_audit.py
3
9790
from mock import create_autospec, Mock, sentinel, ANY, call from pymongo.errors import OperationFailure import pytest import pandas as pd from arctic.store.audit import ArcticTransaction from arctic.store.version_store import VersionedItem, VersionStore from arctic.exceptions import ConcurrentModificationException, No...
lgpl-2.1
numenta/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/image.py
69
28764
""" The image module supports basic image loading, rescaling and display operations. """ from __future__ import division import os, warnings import numpy as np from numpy import ma from matplotlib import rcParams from matplotlib import artist as martist from matplotlib import colors as mcolors from matplotlib import...
agpl-3.0
dpshelio/sunpy
examples/plotting/hmi_synoptic_maps.py
1
2783
# coding: utf-8 """ ============================================== Loading an HMI daily synoptic image into a Map ============================================== In this example we load the Daily Synoptic Maps produced by the HMI team. This data is an interesting demonstration of SunPy's Map class as it is not in the m...
bsd-2-clause
Britefury/scikit-image
doc/examples/plot_phase_unwrap.py
14
4080
""" ================ Phase Unwrapping ================ Some signals can only be observed modulo 2*pi, and this can also apply to two- and three dimensional images. In these cases phase unwrapping is needed to recover the underlying, unwrapped signal. In this example we will demonstrate an algorithm [1]_ implemented in...
bsd-3-clause
rs2/pandas
pandas/tests/indexes/period/test_period_range.py
4
3954
import numpy as np import pytest from pandas import NaT, Period, PeriodIndex, date_range, period_range import pandas._testing as tm class TestPeriodRange: @pytest.mark.parametrize("freq", ["D", "W", "M", "Q", "A"]) def test_construction_from_string(self, freq): # non-empty expected = date_ran...
bsd-3-clause
zihua/scikit-learn
sklearn/datasets/tests/test_rcv1.py
322
2414
"""Test the rcv1 loader. Skipped if rcv1 is not already downloaded to data_home. """ import errno import scipy.sparse as sp import numpy as np from sklearn.datasets import fetch_rcv1 from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing i...
bsd-3-clause
th0mmeke/toyworld
util/reaction_distribution.py
1
2778
""" Created on 13 Aug 2013 @author: thom """ import logging import os import config from rdkit.Chem import AllChem as Chem from emergent_reactions import EmergentReactions from molecule import Molecule from chemistry_factory import ChemistryFactory from physics_factory import PhysicsFactory if __name__ == '__main...
gpl-3.0
EmmaIshta/QUANTAXIS
setup.py
1
3743
# coding=utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2017 yutiansut/QUANTAXIS # # 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 limitation th...
mit
Garrett-R/scikit-learn
benchmarks/bench_glm.py
297
1493
""" A comparison of different methods in GLM Data comes from a random square matrix. """ from datetime import datetime import numpy as np from sklearn import linear_model from sklearn.utils.bench import total_seconds if __name__ == '__main__': import pylab as pl n_iter = 40 time_ridge = np.empty(n_it...
bsd-3-clause
hlin117/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
28
18031
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal, assert_true, assert_greater from sklearn.utils.testing impo...
bsd-3-clause
openturns/otagrum
python/doc/examples/plot_using_otagrum.py
1
5402
""" Using otagrum ============= """ # %% import openturns as ot import pyAgrum as gum from matplotlib import pylab as plt import otagrum # %% def showDot(dotstring): try: # fails outside notebook import pyAgrum.lib.notebook as gnb gnb.showDot(dotstring) except ImportError: impo...
lgpl-3.0
cojacoo/testcases_echoRD
gen_test_cXR2.py
1
4225
import numpy as np import pandas as pd import scipy as sp import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import os, sys try: import cPickle as pickle except: import pickle #connect echoRD Tools pathdir='../echoRD' #path to echoRD lib_path = os.path.abspath(pathdir) #sys.path.append(lib_pa...
gpl-3.0
DOV-Vlaanderen/pydov
tests/test_search_itp_lithologischebeschrijvingen.py
1
4162
"""Module grouping tests for the interpretaties search module.""" import pandas as pd from owslib.fes import PropertyIsEqualTo from pydov.search.interpretaties import LithologischeBeschrijvingenSearch from pydov.types.interpretaties import LithologischeBeschrijvingen from tests.abstract import AbstractTestSearch loc...
mit
fengzhyuan/scikit-learn
sklearn/tests/test_kernel_ridge.py
342
3027
import numpy as np import scipy.sparse as sp from sklearn.datasets import make_regression from sklearn.linear_model import Ridge from sklearn.kernel_ridge import KernelRidge from sklearn.metrics.pairwise import pairwise_kernels from sklearn.utils.testing import ignore_warnings from sklearn.utils.testing import assert...
bsd-3-clause