text
string
import pickle import functools from functools import partial import itertools import imp import multiprocessing from multiprocessing import Pool import re import os from pathlib import Path import numpy as np import scipy import pandas as pd import bruno_util from bruno_util import pandas_util from bruno_util import...
<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # In[ ]: """ Created on Mon Apr 29 09:56:21 2019 @author: jacob """ import ftplib import glob import subprocess as sp import csv import numpy as np import netCDF4 as nc4 import pygrib as pg import matplotlib.pyplot as plt plt.switch_backend('agg') import scipy impor...
<reponame>guidov/cmtm import numpy as np import scipy import matcompat # if available import pylab (from matlibplot) try: import matplotlib.pylab as plt except ImportError: pass #%function [cu]=cohbias(v,cb); #% #%Corrects for the bias inherent to coherence estimates. Note the Matlab #%function cohere.m ret...
<gh_stars>1-10 ########### # plot_rc.py: load a dynamic spectrum, bin to an appropriate resolution, and # then make a scatterplot of RCP vs. LCP to identify r_c from the slope ########### import dynspec.plot import dynspec.pipeline_utils reload(dynspec.plot) reload(dynspec.pipeline_utils) from dynspec.p...
# -*- coding: utf-8 -*- """ Created on Sun Nov 22 20:04:52 2020 @author: takashi-154 """ import os import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import tifffile as tiff import astropy.io.fits as iofits from scipy import optimize from skimage import exposure class DynamicBa...
import numpy as np from PDE_find import Diff, Diff2, FiniteDiff import Data_generator as Data_generator import scipy.io as scio from requests import get from inspect import isfunction import math import pdb import random import matplotlib.pyplot as plt import torch.nn as nn import torch from torch.nn import...
<reponame>PavanKB/arvato_customer_segmentation<gh_stars>0 import pandas as pd import numpy as np from collections import Counter from scipy.stats import chi2_contingency def calc_proportion(x): """ Calculates the proportion for each unique value in list :params x: A list of values """ p = Counter(...
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- # File: noisered.py # Date: Fri Dec 27 04:23:28 2013 +0800 import sys from scipy.io import wavfile import os from random import Random from silence import remove_silence from utils import monophonic NOISE_WAV = "/tmp/noise.wav" NOISE_MODEL = "/tmp/noise.prof" THRES = 0...
<filename>Hindmarsh-Rose-Codes/hindmarsh_rose.py # -*- coding: utf-8 -*- """ Created on Fri May 7 11:23:09 2021 @author: <NAME> Hindmarsh Rose model """ import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint def hindmarsh_rose_model(X, t, current, r, x1, a, b, c, ...
<reponame>ICRC-BME/epycom<gh_stars>0 # -*- coding: utf-8 -*- # Copyright (c) St. Anne's University Hospital in Brno. International Clinical # Research Center, Biomedical Engineering; # Institute of Scientific Instruments of the CAS, v. v. i., Medical signals - # Computational neuroscience. All Rights Reserved. # Distri...
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random import sys from collections import deque, defaultdict, Counter; from heapq import heappush, heappop from itertools import permutations, combinations, product, accumulate, groupby from bisect import bisect_left, bis...
<filename>pyrsss/ionex/read_ionex.py """ IONEX Parser & Interpolator v1.1 written by <NAME> University of Illinois at Urbana-Champaign <EMAIL> January 23, 2016 Developed in accordance with the format specifications described in "IONEX: The IONosphere Map EXchange Format Version 1" written by <NAME>, <NAME> Astronom...
<filename>src/benchmarking/utils.py # Copyright 2020 ChainLab # # 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 ...
<reponame>jonvw28/SLICUAV # -*- coding: utf-8 -*- """ Created on Fri Mar 22 15:07:00 2019 @author: jon structure to compute features for a given tree crown clusterwise Inputs: tag_id - a unique numeric ID for labelling each cluster that is analysed tag - the species three letter tag for this species (eg MAC) rgb_im...
<gh_stars>0 import numpy as np def lotka(t, x, theta): y = np.empty(x.shape) y[0] = x[0] * (theta[0] - theta[1] * x[1]) y[1] = -x[1] * (theta[2] - theta[3] * x[0]) return y def lotka_old(t, x): y = np.empty(x.shape) y[0] = x[0] - x[0]*x[1] y[1] = -x[1] + x[0]*x[1] return y def lotk...
from abc import abstractmethod from math import pi from better_abc import ABC from scipy.special import gamma from utils.integrands import sanitize_variable from utils.integrands.abstract import Integrand, KnownIntegrand, RegulatedKnownIntegrand class VolumeIntegrand(Integrand, ABC): """Abstract class to define...
<reponame>airibarne/Kats # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Base I/O code for time series data in Kats This is a base implementation to load datasets for test and evaluation/b...
import logging logging.disable(logging.CRITICAL) import numpy as np import scipy as sp import scipy.sparse.linalg as spLA import copy import time as timer import torch import torch.nn as nn from torch.autograd import Variable import copy # samplers import mjrl.samplers.trajectory_sampler as trajectory_sampler import m...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set() import os from sklearn.cluster import MeanShift from scipy.stats import norm from tqdm import tqdm def plot_distribution(series, path, title='', xlabel=None): '''Plot a histogram of a series with mean, std and m...
<filename>cpab/cpa1d/CpaSpace.py #!/usr/bin/env python """ Created on Sun Mar 9 21:43:46 2014 Author: <NAME> Email: <EMAIL> """ import numpy as np #from cpab.essentials import * from scipy import sparse from of.utils import * from of.gpu import CpuGpuArray from cpab.cpaNd import CpaSpace as CpaSpaceNd from cpab.cpaN...
from mutation import * from evolocity_graph import * import evolocity as evo np.random.seed(1) random.seed(1) def parse_args(): import argparse parser = argparse.ArgumentParser(description='Coronavirus sequence analysis') parser.add_argument('model_name', type=str, help='Type of la...
<reponame>peterdonnelly1/u24_lymphocyte import pickle import sys import os import urllib import gzip import cPickle import time import lasagne import theano import numpy as np import theano.tensor as T from lasagne import layers from lasagne.updates import nesterov_momentum from nolearn.lasagne import NeuralNet from n...
""" Module for calculating DCT type 4 using FFT and pre/post-twiddling .. warning:: These core transforms will produce aliasing when used without overlap. Please use :py:mod:`mdct` unless you know what this means. """ from __future__ import division import numpy import scipy __all__ = [ 'mdct', 'imdct',...
<reponame>viniciusriosfuck/vertical # cd C:\Users\Fuck\Documents\python\quarentena_vertical # python SEIR_IJ_v7.py import numpy as np import pandas as pd def get_input_data(): '''Provides the inputs for the simulation''' from collections import namedtuple Demograph_Parameters = namedtuple('Demograph_Par...
<filename>code/Trianing_tensorflow.py import pandas as pd import numpy as np import swifter from collections import Counter import statistics from statistics import mode import pickle import time import math import matplotlib.pyplot as plt from sklearn.metrics import roc_auc_score, roc_curve from keras.callbacks impo...
<reponame>geojames/py_streamNormalcoords #!/usr/bin/env python # -*- coding: utf-8 -*- #------------------------------------------------------------------------------ __author__ = '<NAME>' __contact__ = '<EMAIL>' __copyright__ = '(c) <NAME> 2019' __license__ = 'MIT' __date__ = '3 December 2019' __version__ = '2...
<gh_stars>100-1000 import torch import random import typing from scipy.special import comb class EpisodeSampler(torch.utils.data.BatchSampler): """Sample data to form a classification task Args: data_source (Dataset): dataset to sample from """ def __init__(self, sampler: torch.utils.data.Sa...
<filename>datasets/jacquard.py from __future__ import print_function from __future__ import absolute_import # -------------------------------------------------------- # Visual Detection: State-of-the-Art # Copyright: <NAME> # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # ---------------...
"""Interpolation image and mask by linear function. method: resampleImageToFixedSize resampleMaskToFixedSize resampleImageToFixedSpacing resampleMaskToFixedSpacing resampleImageToFixedScale resampleMaskToFixedScale """ import numpy as np from scipy.ndimage.interpolation import zoom class DataResampler(object): d...
<filename>Dryads/load.py import sys import os import warnings import numbers # from collections import * # import numpy as np import scipy # from astropy.io import fits import astropy.wcs as wcs import astropy.units as u import astropy.constants as c import FITS_tools as fits_tools # import matplotlib.pyplot as plt...
import pycuda.driver as drv import numpy as np from scipy.sparse import csr_matrix from km3net.kernels import Match3BSparse import km3net.util as util from .context import create_plot, skip_if_no_cuda_device def test_Match3BSparse(): skip_if_no_cuda_device() N = 500 window_width = 150 x,y,z,ct = uti...
<filename>data_preparation/processing/longread/assign_RI_persistence_metric.py #!/usr/bin/env python3 """ assign_RI_persistence_metric.py Python 3 code for assigning read-transcript maps with intron persistence values SAMPLE RUN: time python intronomer-paper/benchmarking_data/assign_RI_persistence_metric.py -m HX1_fi...
""" Test the pipeline module. """ from distutils.version import LooseVersion from tempfile import mkdtemp import shutil import time import pytest import numpy as np from scipy import sparse from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import as...
<gh_stars>1-10 #!/usr/bin/env python import gflags import httplib2 import logging import math import numpy import pprint import sys from apiclient.discovery import build from apiclient.errors import HttpError #from oauth2client.client import OAuth2WebServerFlow from oauth2client.client import AccessTokenRefreshError...
<gh_stars>1-10 # fixtures.py # Copyright (c) 2013-2019 <NAME> # See LICENSE for details # pylint: disable=C0111,C0411,E0611,R0903,R0914,W0621 # Standard library imports from __future__ import print_function import math import os import shutil import warnings # PyPI imports from imageio import imread import numpy as n...
<reponame>cscorley/triage from __future__ import print_function, division import csv import src import src.main import src.utils import logging import sys import scipy.stats import os.path def fake(*args, **kwargs): print('Fake called with', str(args), str(kwargs)) sys.exit(1) # fake out the create_model so...
<gh_stars>0 # We can pick up a certain MP3 music from our local computer or from the dataset # Do feature extraction and statistical computation # Put feature into model and give the predicted genre of the music import os from keras.models import load_model from scipy import stats import utils import numpy as np...
<filename>tests/test_align.py import pytest import numpy as np import scipy.ndimage as ndi from autolamella.align import ( _calculate_beam_shift, _normalize_image, _simple_register_translation, ) import autolamella.data from autolamella.data.mocktypes import MockAdornedImage @pytest.mark.parametrize( ...
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import abc import sys import numpy as np import pandas as pd from sklearn import linear_model, preprocessing, cluster import scipy.linalg as slin import scipy.sparse....
<reponame>wtsia/gosl import numpy as np import scipy.linalg as la from auxiliary import * a = np.array([ [+1-1j, +2, +1, +1, -1, +0+0j], [+2+0j, +2, +1, +0, +0, +0+1j], [+3+1j, +1, +3, +1, +2, -1+0j], [+1+0j, +0, +1, -1, +0, +0+1j], ],dtype=complex) tmp = np.array([ [+1, -1, +0, -1], [-1, -1, ...
<gh_stars>1-10 # SPDX-License-Identifier: Apache-2.0 # Copyright 2019 Blue Cheetah Analog Design 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/LI...
<gh_stars>0 """ xpath mapping from xml file, with convertion functions """ from datetime import datetime import numpy as np from scipy.interpolate import RectBivariateSpline, interp1d from shapely.geometry import box import pandas as pd import xarray as xr import warnings import geopandas as gpd from shapely.geometry ...
<reponame>gavin-parker/Thesis import numpy as np import os from scipy import ndimage import tensorflow as tf class ReflectanceDataset: normals = [] inputs = [] ground_truths = [] def __init__(self): self.inputs = tf.train.match_filenames_once("{}/radiance/*.png".format(self.train_...
<gh_stars>1-10 from collections import defaultdict import keras.backend as K import pickle import pathlib import pandas as pd import scipy.special import scipy.stats from keras.models import Model import gc import palmnet.hunt from palmnet.core.faustizer import Faustizer from palmnet.core.layer_replacer_faust import L...
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import numpy as np import pandas as pd import scipy from scipy import stats import matplotlib.pyplot as plt import pandas sentiment_singularity_csv = '8GPU_rnn_translator_singularity.csv' sentiment_native_csv = '8GPU_rnn_translator_nativ...
from scipy import misc import numpy as np fonts = ['AcmeFont', 'AgencyFB', 'Algerian', 'ArialBlack', 'Broadway', 'Calibri', 'Itaianate'] alpha = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] for font in font...
<gh_stars>1000+ # coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 requ...
import numpy as np import math from sympy.physics.quantum.cg import CG from scipy.special import sph_harm def radial_function(x, J, alpha=1, beta=0.5): return np.exp(alpha * np.linalg.norm(x) + beta + J * 0.001) def get_Q_lk_transpose(k, l, J, m): Q_lk_transpose = np.zeros((2 * l + 1, 2 * k + 1)) for i ...
<gh_stars>0 # Copyright (c) 2015-2016, the authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import sys import numpy as np from scipy.linalg import LinAlgError from GPy import Model,likelihoods from GPy.core.parameterization.variational import VariationalPosterior, NormalPosterior...
""" This module contains the functions needed to use the spherical harmonic techniques """ import numpy as np import scipy.sparse from scipy.special import lpmv, spherical_jn, spherical_yn from numba import jit #@jit(nopython=True) def sub2indSH(m,n): """ i = sub2indSH(m,n) Convert Spherical Harmonic (m,n) indi...
<reponame>anabastos/faceteer import spacy import json from collections import Counter import numpy as np from scipy import stats import xlwt nlp = spacy.load('pt') age_list = [] gender_list = [] city_list = [] religion_list = [] with open('../data.json') as json_file: data = json.load(json_file) text = '' ...
<filename>spectral_work.py import gmi_misc import gmi_config gmi_config.read_config() import matplotlib.pyplot as plt import pyshtools import numpy as np from scipy.interpolate import griddata MINN = 1 #FOLDER = 'result_2degx2deg_100000_apriori_wolfgang_ocean_cont_CRUST' #try: # raw_grid_inp = gmi_misc.read_g...
<reponame>AdityaAS/cycada import os.path from .cityscapes import remap_labels_to_train_ids import numpy as np import scipy.io import torch import torch.utils.data as data from PIL import Image from .data_loader import register_data_params, register_dataset_obj from .data_loader import DatasetParams from .cityscapes i...
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, <NAME> and <NAME>. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistribut...
# -*- coding: utf-8 -*- from ebisu import * from ebisu.alternate import * import unittest import numpy as np def relerr(dirt, gold): return abs(dirt - gold) / abs(gold) def maxrelerr(dirts, golds): return max(map(relerr, dirts, golds)) def klDivBeta(a, b, a2, b2): """Kullback-Leibler divergence between two...
<filename>code/teststar3_dataall.py<gh_stars>0 # this is to test a field to get stellar parameters but for the data not for a field import pyfits import glob import pickle from scipy import interpolate from scipy import ndimage import numpy as np from glob import glob testfile = "normed_data.pickle" def test_fi...
import cv2 import torch from torch.autograd import Variable import torch.utils.data import numpy as np import scipy.io as scio import os from PIL import Image import model as model import anchor as anchor from tqdm import tqdm os.environ["CUDA_VISIBLE_DEVICES"] = "1" fx = 475.065948 fy = 475.065857 u0 = 315.944855 v0...
from sympy import (Symbol, symbols, factorial, factorial2, binomial, rf, ff, gamma, polygamma, EulerGamma, O, pi, nan, oo, zoo, simplify, expand_func) from sympy.functions.combinatorial.factorials import subfactorial from sympy.utilities.pytest import XFAIL, raises def test_rf_ev...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import sys import numpy as np import scipy.optimize import matplotlib.pyplot as plt import cv2 import ellipse DEBUG_IMAGES = [] def debug_show(name, src): global DEBUG_IMAGES filename = 'debug{:02d}_{}.pn...
#!/usr/bin/env python import datetime import numpy as np import os import pause import pickle import rospy as ros from scipy.interpolate import interp1d import sys import time from PyQt5 import QtCore, QtWidgets, QtGui import qdarkstyle import matplotlib matplotlib.use('Qt5Agg') import matplotlib.pyplot as plt from ...
import json import time from typing import List, Tuple from pymemcache.client.base import Client import numpy import requests from PIL import Image import mss.tools from light_scene import LightScene client = Client('localhost') sct = mss.mss() def get_dominant_color(im) -> Tuple: import numpy as np import ...
""" Decimal """ from decimal import Decimal as D, getcontext, FloatOperation from decimal import ROUND_DOWN getcontext().prec = 50 getcontext().traps[FloatOperation] = True #getcontext().rounding = ROUND_05UP a = D('3.14') # Correct #a = D(3.14) # Wrong! print(a ** D('0.123')) print(a % D('1.5')) print(D(2).sqrt()) p...
<filename>poleSeeker.py #pl.ylabel(r'$x_{n}$') - TEX stuff from numpy import inf,pi,cos,sin from sympy import fourier_transform,plot,exp,symbols,Heaviside from sympy.abc import t,s import numpy as np from matplotlib import pyplot as pl from pylab import stem,linspace import re def poleSeeker(fxn): pattern0 = 'u\[-...
<filename>framework/Optimizers/FiniteDifference.py # Copyright 2017 Battelle Energy Alliance, 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 # # http://www.apache.org/licenses/LICENSE-2....
import numpy as np import scipy as sp import pandas as pd import matplotlib.pyplot as plt import seaborn as sb database = sb.load_dataset("tips") print(database) graph=sb.FacetGrid(database,col="sex",hue="smoker") graph.map(plt.scatter,"total_bill","tip") plt.show()
<reponame>antonioalfa22/EFE-WebClassifier from scipy import stats def getInitialWordsFrequency(filename): file = open(filename, 'r', encoding="utf-8") lines = file.readlines() file.close() wordsList = [] for i in range(0, 5000): wordsList.append(lines[i].split("\t")[0]) return wordsLis...
"""" This implementation is largely based on and adapted from: https://github.com/sskhandle/Iterative-Classification """ import numpy as np import scipy.sparse as sp def get_class(kls): parts = kls.split('.') module = ".".join(parts[:-1]) md = __import__(module) for comp in parts[1:]: md = g...
<gh_stars>0 from alignments.MegaAlignment import MegaAlignment from regression.CloneFrequencyComputer_cnv1 import CloneFrequencyComputer_cnv1 from scipy import stats import numpy class Calculation: def compute_estimated_SNVfrequency1(self, CloFre, CloSeq): eSNVfre={} c=0 snv_num=len(...
""" Shuffle spikes with different parameters and see how the proportion of syllables having significant PCC changes """ from pyfinch.database.load import DBInfo, ProjectLoader from util.draw import * def create_db(): from pyfinch.database.load import ProjectLoader db = ProjectLoader().load_db() with open...
# -*- coding: utf-8 -*- """ Unit tests for the spectral module. :copyright: Copyright 2014-2020 by the Elephant team, see `doc/authors.rst`. :license: Modified BSD, see LICENSE.txt for details. """ import unittest import numpy as np import scipy.signal as spsig import quantities as pq import neo.core as n from numpy...
# -*- coding: utf-8 -*- import numpy as np import scipy.optimize as opt import numpy.linalg as la import numpy.ma as ma import warnings from .wst import WST from .wst_operator import WSTOp from .rwst import RWST from .rwst_models import RWSTModel1 class RWSTOp: """ Reduced Wavelet Scattering Transform (RWST...
<reponame>skforest/intro_ds # -*- coding: UTF-8 -*- """ 此脚本用于展示利用谱聚类进行图片分割 """ import os import numpy as np import scipy as sp import matplotlib.pyplot as plt from sklearn.feature_extraction import image from spectral import spectral_clustering def read_img(path): """ 读取图片,并将其转换为邻接矩阵 """ # 对于彩色照片,只...
# <NAME> (Rechazo de Banda) import numpy as np from PIL import Image, ImageOps import matplotlib.pyplot as plt from scipy import ndimage def imageToArray(filename: str, rgb: bool = False): img = Image.open(filename) if not rgb: img = ImageOps.grayscale(img) img_array = np.array(img) return img...
<gh_stars>0 from anlffr.helper import biosemi2mne as bs import mne import numpy as np from scipy import io import os import fnmatch import pylab as pl # Adding Files and locations froot = 'D:/DATA/Saccade/' subj = 'BM' fpath = froot + subj + '/' print 'Running Subject', subj bdfs = fnmatch.filter(os.listdir(fpath...
<reponame>xida2020/scikit-fem from unittest import TestCase from pathlib import Path import numpy as np import pytest from scipy.spatial import Delaunay from numpy.testing import assert_array_equal, assert_almost_equal from skfem.mesh import (Mesh, MeshHex, MeshLine, MeshQuad, MeshTet, MeshTri, ...
from scipy.optimize import fsolve from matplotlib import cm, rcParams from shapely import geometry import matplotlib.pyplot as plt import numpy as np import pandas as pd import math, csv, os """ ToDo : check if this is equivalent to the G-function for weak coupling """ c = ['#aa3863', '#d97020', '#ef9f07', '#449775',...
"""Functions for downloading and reading MNIST data.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import scipy.io as sio import gzip import os import glob from six.moves import urllib import numpy import cPickle def extract_test_data(work_directory, o...
import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import os import numpy as np import random from scipy import misc #import tensorflow.contrib as tf_contrib # Xavier : tf_contrib.layers.xavier_initializer() # He : tf_contrib.layers.variance_scaling_initializer() # Normal : tf.random_normal_initializ...
#!/usr/bin/env python """Discrete synthesis from a dummy abstraction with mixed switching. This is an example to demonstrate how the output of a discretization algorithm that abstracts a switched system might look like, where the mode of the system depends on a combination of environment and system controlled variable...
<reponame>yohm/GWSN_metamodeling #%% from pyexpat import model import sys,math import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from keras.models import load_model from icecream.icecream import ic #%% mpl.rcParams.update(mpl.rcParamsDefault) #%% plt.rcParams['font.family'] ='sans-serif' plt....
<gh_stars>1-10 from fawkes.models import NetworkPoisson from scipy.stats import gaussian_kde import matplotlib.pyplot as plt import numpy as np import h5py as h5 import pandas as pd import os import sys def import_data(path, name, dates): mkt_open = 34200 mkt_close = 57600 msg_columns = ['sec', 'nano', 'ty...
<filename>test_pymc3_w_ext.py import numpy as np import matplotlib.pyplot as plt plt.style.use('seaborn-darkgrid') from dust_extinction.dust_extinction import GCC09_MWAvg, FM90 import theano import theano.tensor as tt def fm90func(c1, c2, c3, c4, xo, gamma, x, hs): return c1 + c2*x + c3*(x**2/((x**2 - xo**2)**2 ...
# -*- coding: utf-8 -*- """ ========== Statistics ========== Demonstrates the different statistics you can use with ChainConsumer. """ ############################################################################### # By default, ChainConsumer uses maximum likelihood statistics. Thus you do not # need to explicitly ...
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) try: import Tango import pylab as pb except: pass import numpy as np from base_plots import gpplot, x_frame1D, x_frame2D from ...models.gp_coregionalized_regression import GPCoregionalizedRegres...
<gh_stars>1-10 from time import sleep, time_ns from scipy.spatial import distance from serial import Serial from shared.byte_coders import * from random import choices from string import ascii_lowercase from numpy import mean, std, sqrt from scipy import stats class Measurer(): """An object that performs the measure...
<gh_stars>1-10 from __future__ import print_function import numpy as np from scipy.spatial import cKDTree from scipy.spatial.distance import cdist import networkx as nx __all__ = ['closest_points', 'optimal_permutation'] def closest_points(from_pts, to_pts): return cKDTree(to_pts).query(from_pts)[1] def opti...
import sys import optparse import argparse from scipy.io import wavfile import numpy as np import utils from optparse import OptionParser if __name__ == '__main__': parser = OptionParser() parser.add_option("-s", type="float", dest="start_time", default=1) parser.add_option("-f", type="float", dest="en...
<filename>src/common/training/batcher.py<gh_stars>10-100 import torch import numpy as np from scipy.sparse import coo_matrix from torch.autograd import Variable from common.training.options import gpu class Batcher(): def __init__(self,data,size): self.data = data self.size = size self....
'''The functions of the lambdata package ''' # Prints the contingency table and chi2 stats # given two columns of a DataFrame import pandas as pd import numpy as np from scipy import stats def cont_chi2(col1, col2): contingency = pd.crosstab(col1, col2) print(contingency) chi2, p_value, dof, expected = ...
#!/usr/bin/env python """ Test the creation of redundant features (see sklearn source) The structure of X is columns of [informative, redundant, nuisance] features """ import numpy as np from scipy import stats from sklearn.preprocessing import MinMaxScaler from sympy import symbols from synthetic_data.synthetic_dat...
import scipy.io mat = scipy.io.loadmat('/media/ghost/8c5dd22b-3c0c-41d2-9807-c4094164ca3e/ghost/down/nyu_depth_v2_labeled(1).mat') mat.items()
# Copyright 2018-2020 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
"""This module contains the alpha-s calculation.""" import warnings import scipy from ..core.adsorbate import Adsorbate from ..core.isotherm import Isotherm from ..graphing.calcgraph import plot_tp from ..utilities.exceptions import ParameterError from ..utilities.math_utilities import find_linear_sections from .are...
<gh_stars>10-100 from __future__ import print_function, division, absolute_import from warnings import warn import numpy as np import numpy.linalg as npl from scipy.stats import rankdata from . import subsample_columns, grouped_path, default_lagrange_sequence from ..affine import astransform, power_L from ..smooth i...
<filename>omnidata_annotator/scripts/create_segmentation_2d_images.py """ Name: create_segmentation_2d_images.py Desc: Creates and saves 2D segmentation images for each point. We use normalized cuts for segmenting images into perceptually similar groups. Requires (to be run): - generate_points.py ...
<gh_stars>1-10 import xarray as xr import rioxarray import pandas as pd import numpy as np import faiss from scipy.interpolate import griddata from sklearn.neighbors import NearestNeighbors from datetime import timedelta, date # Script to join monthly ERA .grib data with daily MODIS .tiff data # We join in both time (...
""" (C) Copyright 2021 IBM Corp. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
#!/usr/local/sci/bin/python # PYTHON3 # # Author: <NAME> # Created: 22 April 2015 # Last update: 2 Apr 2019 # Location: /data/local/hadkw/HADCRUH2/UPDATE2014/PROGS/PYTHON/ # this will probably change # GitHub: https://github.com/Kate-Willett/Climate_Explorer/tree/master/PYTHON/ # ----------------------- # CODE PURPOSE...
__author__ = '<NAME> and <NAME>' from scipy import size, zeros, ndarray, array from numpy.random import randn from pybrain.structure.evolvables.evolvable import Evolvable class ParameterContainer(Evolvable): """ A common interface implemented by all classes which contains data that can change during executi...
<reponame>LiuNingtao/Python- import math import numpy as np import h5py import matplotlib.pyplot as plt import scipy from PIL import Image from scipy import ndimage import tensorflow as tf from tensorflow.python.framework import ops from cnn_utils import * np.random.seed(1) X_train_orig, Y_train_orig, X_test_orig, Y_...