text string |
|---|
"""
OVERVIEW:
Python module for microbiome statistical analysis tools.
"""
import os, sys
import numpy as np
import warnings
import scipy.stats
import Taxonomy
def jsd(x,y):
#Jensen-shannon divergence
warnings.filterwarnings("ignore", category = RuntimeWarning)
x = np.array(x)
y = np.array(y)... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 23 11:23:03 2017
@author: tih
"""
import numpy as np
import os
import scipy.interpolate
import gdal
from openpyxl import load_workbook
import osr
from datetime import datetime, timedelta
import pandas as pd
import shutil
import glob
from netCDF4 import Dataset
import warn... |
# -*- coding: utf-8 -*-
"""
Analysis of audio data
August, 2016
Functionality
-------------
- Cross-correlation to identify time delay
Inputs
------
- audio_file_input_one : str
Should point to a WAV file
- audio_file_input_two : str
Should point to a WAV file
Outputs
-------
- correlation_graph : PNG
... |
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
"""
Figure 7
--------
Error in predicted magnitude as a function of magnitude difference
between the two blended galaxies
"""
import numpy as np
import matplotlib.pylab as plt
import matplotlib.colors as clr
import seaborn as sns
import pandas as pd
from scipy.stats... |
<reponame>michalkahle/RackScanner<filename>dm_reader.py
import os
import logging
from time import time
from functools import partial
import numpy as np
import cv2
from pylibdmtx import pylibdmtx
import pandas as pd
import re
from math import atan, sqrt
import matplotlib.pyplot as plt
import scipy, scipy.nd... |
# Use the filter on lots of things and save the data and generate plots
import numpy as np
import h5py
import scipy.sparse
import scipy.io
from constants import *
import ipdb
import sys
import cPickle as pickle
flen = DEE
flen_2 = 3
dt = EPSILON
st = 0.75 #kind of equivalent to sigma
root = '/home/bjkomer/deep_learnin... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 2 20:03:46 2019
@author: Ashish
"""
from scipy.spatial.distance import pdist, squareform
from sklearn.cluster import DBSCAN
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from numpy import sin,cos,arctan2,sqrt,pi # import from numpy
# earth's... |
# -*- coding: utf-8 -*-
import numpy as np
import scipy.stats as st
from abc import ABCMeta, abstractmethod
from .mvar.comp import ldl
from .mvarmodel import Mvar
from .aec.utils import filter_band, calc_ampenv, FQ_BANDS
import six
from six.moves import map
from six.moves import range
from six.moves import zip
#####... |
from fractions import Fraction
from wick.expression import AExpression
from wick.wick import apply_wick
from wick.convenience import one_e, two_e, E1, E2, PE1, ketE2, commute
H1 = one_e("f", ["occ", "vir"], norder=True)
H2 = two_e("I", ["occ", "vir"], norder=True)
H = H1 + H2
T1 = E1("t", ["occ"], ["vir"])
T2 = E2("t... |
<filename>stake/mdps/posmdp.py
import mdptoolbox
import matplotlib.pyplot as plt
import numpy as np
import scipy.sparse as ss
import seaborn as sns
import warnings
warnings.filterwarnings('ignore', category=ss.SparseEfficiencyWarning)
PASS = 0
ENDORSE = 1
BAKE = 2
BOTH = 3
ACTIONS = ['PASS', 'ENDORSE', 'BAKE', 'BOTH']... |
import fiona
from scipy.spatial import KDTree
from pyproj import Geod
from shapely.geometry import shape
from collections import defaultdict
from heapq import heappush, heappop
def to_graph(link_path, node_path):
adjacency_list = defaultdict(list)
with fiona.open(link_path) as link_collection,\
f... |
<gh_stars>1-10
import numpy as np
from scipy import linalg
#------------------------ PCA Functions -----------------------#
# eeg should be in the dimension of (trial, channel, timepoints)
def PCA_transform(eeg, n_components, variance_threshold):
# # Below is the sklearn implementation
# from sklearn.decomp... |
#!/usr/bin/env python3
#
# Copyright 2019 PSB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
# Demonstrates the usage of existing stop criterions and
# creation of new stop criterions.
# Stop criterions are a way to stop (or pause) the minimizer
# under certain conditions. Maybe you want the minimizer to
# stop when a certain error is converged, or after a certain
# time, or a number of iterations. For all th... |
# Copyright 2022 The jax3d 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 required by applicable law or agreed to in wr... |
<reponame>mnslarcher/metodi-statistici-big-data
import numpy as np
from scipy.interpolate import UnivariateSpline
from scipy.optimize import minimize
class CurvaPrincipale:
def _distanza_euclidea(self, l, X):
X_prz = np.array((self.f1_hat(l), self.f2_hat(l))).T
return ((X - X_prz) ** 2).sum()
... |
<reponame>cwh32/DiffCapAnalyzer<gh_stars>1-10
import glob
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from pandas.testing import assert_frame_equal
import scipy.signal
from diffcapanalyzer.app_helper_functions import decoded_to_dataframe
from diffcapanalyzer.app_helper_functions im... |
<filename>recgve/models/tensorflow/igccf.py
#!/usr/bin/env python
__author__ = "XXX"
__email__ = "XXX"
from tensorflow import keras
import logging
import os
import tensorflow as tf
from constants import *
from representations_based_recommender import RepresentationsBasedRecommender
from utils.decorator_utils import t... |
<filename>on_centerline.py
#!/usr/bin/env python
# ON DWI centerline extraction and nonlinear registration
import numpy as np
import nibabel as nib
import scipy.ndimage as ndimage
import os
import sys
import on_dbsi_utils
# USER INPUT: directory / filename
def run(filename, filename_on_init, filename_flt, filename_... |
import numpy as np
from scipy.constants import c
from PyHEADTAIL.general.element import Element
from PyHEADTAIL.particles.slicing import UniformBinSlicer
from PyPIC.PyPIC_Scatter_Gather import PyPIC_Scatter_Gather
class Transverse_Efield_map(Element):
def __init__(self, xg, yg, Ex, Ey, L_interaction, slicer,
... |
import numpy as np
from scipy.optimize import minimize
from .optimizer import Optimizer
class L_BFGS_B(Optimizer):
def __init__(self, cost, tol=1e-2):
''' Args:
cost (function): a callable which takes a single argument X and returns a single result
tol (float): convergence t... |
<filename>go_client.py
#!/usr/bin/env python3
from tsdb import TSDBClient
import timeseries as ts
import numpy as np
import asyncio
import matplotlib.pyplot as plt
import sys
from scipy.stats import norm
########################################
#
# This file can be used to test the basic client functionality.
# For i... |
from olnet import run_sim, save_sim, save_sim_hdf5
from olnet.tuning import get_orn_tuning, get_receptor_tuning, create_stimulation_matrix, gen_shot_noise, combine_noise_with_protocol, gen_gauss_sequence
from brian2 import *
import numpy as np
import olnet.models.droso_mushroombody_apl as droso_mb
from olnet import Att... |
<filename>reliabpy/commons/normal_relations.py
# -*- coding: utf-8 -*-
"""
NORMAL AND LOGNORMAL RELATIONS
==============================
this script trqnsformans the parameters from lognormal to normal and
vice-versa.
"""
import numpy as np
def N2logN(mean, std):
'''
NORMAL TO LOGNORMAL
=================... |
import os
# os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import scipy
import scipy.io as sio
def main(args):
from DCHN import Solver
solver = Solver(args)
cudnn.benchmark = True
if args.mode == 'train':
ret = solver.train()
elif args.mode == 'eval':
ret = solver.eval()
print(args)... |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for tools.linalg
"""
from scipy import sparse
import numpy as np
from numpy.testing import (
assert_array_equal, assert_almost_equal, assert_allclose)
import pytest
from sm2.tools.linalg import (pinv_extended, nan_dot, chain_dot,
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 13 19:01:56 2017
@author: dipanjan
"""
import pandas as pd
from scipy import misc
#from mpl_toolkits.mplot3d import Axes3D
import matplotlib
#import matplotlib.pyplot as plt
# Look pretty...
matplotlib.style.use('ggplot')
import os
samples = []
... |
<gh_stars>100-1000
# 3rd-party imports
import numpy as np
from scipy.interpolate import interp1d
from scipy.signal import hanning
from scipy.fftpack import fft, ifft
import numba
import matplotlib.pyplot as plt
# build-in imports
from decimal import Decimal, ROUND_HALF_UP
def synthesisRequiem(source_object, filter_ob... |
import torch
from torch import nn
from torch.autograd import Variable
from torch.nn import functional as F
from torchvision.models.vgg import vgg16_bn
from torchvision.models.inception import inception_v3
import numpy as np
from scipy.stats import entropy
from miscc.datasets import AudioSetImage, iterate_minibatches, ... |
<reponame>dianab01/RoboND-Kinematics-Project
from sympy import *
from time import time
from mpmath import radians
import tf
import numpy as np
'''
Format of test case is [ [[EE position],[EE orientation as quaternions]],[WC location],[joint angles]]
You can generate additional test cases by setting up your kuka projec... |
import numpy as np
from .gcn.utils import *
from .models import *
from .gcn.inits import *
from .ss_encoder import Linear
import time
import scipy.sparse as sp
import torch
import torch.nn as nn
import torch.nn.functional as F
class Decoder(nn.Module):
def __init__(self, name, dim, mlp_dim = None):
supe... |
import geomtwo.msg as gms
import matplotlib.pyplot as plt
import cmath as cm
class Vector:
def __init__(self, *args, **kwargs):
if len(args) is 2:
self._data = complex(*args)
return
if len(args) is 1:
if isinstance(args[0], (self.__class__, gms.Vector)):
... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import metrics
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score
import seaborn as sns
from scipy.spatial import distance
x = pd.read_csv("First_Echelon/Input/demanda_bodegas.csv")
latitude = x["latitud... |
<gh_stars>1-10
# This is a parent class of models for active learning and counterfactual elicitation.
# Contains implementations of the different acquisition functions.
import numpy as np
import scipy.linalg as la
import copy
from scipy.stats import norm
class Model(object):
def predict(self, new_predictors, mode... |
<reponame>eshort0401/TINT<filename>tint/objects.py
"""
tint.objects
============
Functions for managing and recording object properties.
"""
import warnings
import copy
import numpy as np
import pandas as pd
import pyart
from scipy import ndimage
from skimage.measure import regionprops
from scipy.ndimage import cent... |
<reponame>Jayanth-kumar5566/TDA_Allergy
import numpy
import scipy
import matplotlib.pyplot as plt
from sklearn import linear_model
import pandas
import seaborn as sns
#----------FLAT Reconstruction---------------
def drop(A,ind):
''' A is a numpy matrix
ind is the index of the column to be removed'''
p... |
import _init_paths
from model.config import cfg
from model.test import im_detect
from model.nms_wrapper import nms
from utils.timer import Timer
import matplotlib.pyplot as plt
import numpy as np
import scipy.io as sio
import os, sys, cv2
import argparse
import tensorflow as tf
from nets.vgg16 import vgg16
CLASSES = ... |
<reponame>RandalJBarnes/AkeyaaPy
"""Support for the general projected normal distribution.
pnormpdf(theta, mu, sigma):
Evaluate the probability density function for the general projected
normal distribution.
pnormcdf(lb, ub, mu, sigma):
Evaluate the Pr(lb < theta < ub) for a general projected normal
d... |
import networkx.algorithms.isomorphism as iso
from networkx.algorithms import isomorphism
import numbers
from scipy.sparse import csr_matrix
from typing import Sequence, Tuple, Generator
from gowpy.gow.builder import GraphOfWords
from gowpy.gow.typing import Nodes
from sklearn.base import BaseEstimator
from gowpy.... |
"""
Routines for reading a Philips .spar/.sdat formats and returning an
DataRaw object populated with the file's data.
"""
# Python modules
import re
import os.path
# 3rd party modules
import numpy as np
from scipy.spatial.transform import Rotation
# Our modules
import vespa.common.mrs_data_raw as mrs_data_raw
imp... |
#!/usr/bin/env python
import numpy as np
#Importing the fft and inverse fft functions from fftpackage
from scipy.fftpack import dct,fft,fftfreq,idct,ifft
#create an array with random n numbers
x = np.array([1.0, 2.0, 1.0, -1.0, 1.5])
#Applying the fft function
y = fft(x)
print(y)
#FFT is already in the workspace, us... |
<reponame>mmagnuski/sarna<gh_stars>1-10
import numpy as np
import scipy
from scipy import stats
from scipy.stats import ttest_ind, ttest_rel, levene
from borsar.stats import compute_regression_t
from .utils import progressbar as progressbar_function
# TODO:
# - [ ] avoid calculating p, now it is computed but thrown ... |
<filename>code/plotting/plot_bfit.py
#!/usr/bin/env python3
#
# Plots the power spectra and Fourier-space biases for the HI.
#
import numpy as np
import os, sys
import matplotlib.pyplot as plt
from pmesh.pm import ParticleMesh
from scipy.interpolate import InterpolatedUnivariateSpline as ius
from nbodykit.lab import Bi... |
import numpy as np
import open3d as o3d
from scipy.spatial import Delaunay
import matplotlib.pyplot as plt
from functools import reduce
import math
import os
import random
random.seed(10)
from SH import PolygonClipper
origin = []
refvec = []
# assign directory
directory = '/home/marian/calibration_ws/monodepth-FPN/... |
<reponame>m-lab/analysis
#!/usr/bin/env python
import gflags
import json
import logging
import math
import numpy
import os
import pprint
import sys
from scipy.misc import pilutil
FLAGS = gflags.FLAGS
gflags.DEFINE_integer('start_year', 2013, 'Start processing from this year')
gflags.DEFINE_integer('start_month', 1,... |
# -*- coding: utf-8 -*-
"""deep-q-learning.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1jeN8am0akHaXYMbnwq_o_tjnj7VIA_F4
"""
# This project is a step of the PROROK project. We use openAI to learn How to make deep reinforcement learning.
im... |
<reponame>chrhck/pyABC
import numpy as np
from scipy import stats as st
import pandas as pd
import copy
import logging
import dask.delayed
import dask.array as da
logger = logging.getLogger(__name__)
def calc_variation(per_model_w, n_per_model, test_w):
variations_at_X = np.stack([st.variation(ws, axis=0) for w... |
<gh_stars>1-10
import numpy as np
from scipy.stats import binned_statistic
# import pandas as pd
def fib(n):
'''
return n digits of the Fibonacci sequence
very inefficiently b/c i'm basic
'''
out = np.zeros(n)
out[1] = 1
for k in range(2,n):
out[k] = out[k-2] + out[k-1]
return ... |
<reponame>fsoubelet/PyHEADTAIL<gh_stars>0
'''
@date: 24/11/2015
@author: <NAME>
'''
import h5py as hp
import os
import unittest
import numpy as np
from scipy.constants import c, e, m_p
from PyHEADTAIL.particles.particles import Particles
from PyHEADTAIL.monitors.monitors import (
BunchMonitor, SliceMonitor, Ce... |
<gh_stars>100-1000
#!/usr/bin/python
import sys, getopt, locale
from scipy.stats.stats import pearsonr
import numpy
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.dates
import os.path
from sys import getsizeof
from scipy.spatial import distance
import platform
def replace... |
<reponame>translationalneurosurgery/tool-scarpa
"""generate modulation vectors"""
from scipy.interpolate import interp1d
from numpy import ndarray
import numpy as np
def create_modulation(anchors: ndarray, samples: int, kind: str = "nearest") -> ndarray:
"""Use the modulation anchors to interpolate a modulation v... |
"""
Triplet generators.
Functions for creating generators that will yield batches of triplets.
Triplets will be created using neighbour matrices, which can either be precomputed or
dynamically generated.
"""
from abc import ABC, abstractmethod
from functools import partial
import itertools
import random
import math
... |
<gh_stars>1-10
#http://www.smac.lps.ens.fr/index.php/Python_programs
#monte carlo ising
#http://www.physics.rutgers.edu/grad/681/python/haule-examples/ising.py
#http://code.activestate.com/recipes/414200-metropolis-hastings-sampler/
from scipy import weave
from pylab import *
#from numpy.random import random_integers... |
<gh_stars>0
# built in
import statistics
# to test
from app.database import Database
import app.database as database
# correct
from answers.database import rows_to_list_of_dicts as get_correct_rows
def test_rows_to_list_of_dicts():
rows = database.rows_to_list_of_dicts()
expected ={
"id": int,
... |
# Enter your code here. Read input from STDIN. Print output to STDOUT
import math
import cmath
def parse_complex_number(string):
complex_number = string.strip()
x_is_negative = True if complex_number[0] == '-' else False
complex_number = complex_number[1:] if x_is_negative else complex_number
y_is_neg... |
from sklearn import svm, datasets
import sklearn.model_selection as model_selection
from sklearn.metrics import accuracy_score
from sklearn.metrics import f1_score
import numpy as np
import matplotlib.pyplot as plt
import glob
import cv2
import os
import seaborn as sns
import pandas as pd
import sys
from skimage.filter... |
# -------------------------------------------------------------------------------
# Name: Problem 66
# Purpose: projecteuler.net
#
# Author: aliksey
#
# Created: 06.04.2012
# Copyright: (c) aliksey 2012
# Licence: <your licence>
# ---------------------------------------------------------------... |
<reponame>halilagin/parcoord-brushing
"""
Inferring a binomial proportion via exact mathematical analysis.
"""
import sys
import numpy as np
from scipy.stats import beta
from scipy.special import beta as beta_func
import matplotlib.pyplot as plt
#from HDIofICDF import *
from scipy.optimize import fmin
#from scipy.stats... |
<reponame>LetteraUnica/unipi_lab_courses
import pylab
from scipy.optimize import curve_fit
import numpy
import menzalib as mz
########################################################################### Funzioni #########################################################################
def f(x, a, b):
return a*x +... |
<reponame>amarallab/waldo
# coding: utf-8
# Description:
# This notebook is an attempt to implement the state behaivior model from
# The Geometry of Locomotive Behavioral States in C. elegans
# Gallagher et al.
#
### Imports
# In[2]:
# standard imports
import os
import sys
import numpy as np
import scipy
import sci... |
'''Module containing core functions to perform the P-GPFA fit.
.. module:: engine
:synopsis: A useful module indeed.
.. moduleauthor: <NAME> <<EMAIL>>
'''
import inference
import learning
import util
import numpy as np
import scipy.io as sio
import scipy.optimize as op
import scipy as sp
import matplotlib.pyplo... |
import numpy as np
import math
import pywt
import scipy.signal
import scipy.linalg
import scipy.sparse
def gaussian_filter(x, length, sigma, n_iter):
n = np.arange(0, length) - (length - 1.0) / 2
f = np.exp(-1/2 * (n / sigma)**2)
f = f / f.sum()
for _ in range(n_iter):
x = np.convolve(f, x, 's... |
import os
import psycopg2
import json
import urllib.parse as urlparse
from flask import Flask, jsonify, request
from psycopg2.extras import RealDictCursor
from psycopg2.extensions import AsIs
import numpy as np
from numpy import random
from scipy.spatial.distance import cdist
app = Flask(__name__)
def closest_point(p... |
<reponame>joaopedromoraez/study-on-packages-license-npm<filename>src/statistical-graphs.py
import statistics as st
import matplotlib.pyplot as plt
from numpy import array
import math
import pandas as pd
from statisticalLib import *
# Define as listas de valores
arquivoCSV = './analysis_summary.csv'
dup_geral = lerCSV(... |
# -*- coding: utf-8 -*-
import sympy
import numpy as np
import math
from matplotlib.pyplot import plot
from matplotlib.pyplot import show
import matplotlib.pyplot as plt
import matplotlib
# 解决无法显示中文问题,fname是加载字体路径,根据自身pc实际确定,具体请百度
# zhfont1 = matplotlib.font_manager.FontProperties(fname='/System/Library/Fonts/Hirag... |
import numpy as np
from scipy.signal import square
from matplotlib import pyplot as plt
#Define the square wave to be approximated by specifying frequency f and the mean value
f = 5 #Frequency
T = 1/f
omega = (2*np.pi)/T
for series in range (1, 10, 2):
t = np.linspace(0, 1, 5000, endpoint=False)
fourier_terms = ... |
<filename>src/hcb/artifacts/make_line_fit_plots.py<gh_stars>0
import math
import pathlib
import sys
from typing import List, Tuple, Dict, Any
import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
from scipy.stats import linregress
from hcb.artifacts.make_lambda_plots import DesiredLineFit, project_inter... |
<reponame>lukius/datafit
import scipy
import math
import warnings
from score import BICScore
class DataClassifier(object):
# Characterizes a data set assigning scores to every probability
# distribution provided in scipy.stats. After adjusting the curves through
# the maximum likelihood estimator, a sco... |
from __future__ import division
from warnings import warn
import numpy as np
from dipy.reconst.cache import Cache
from dipy.reconst.multi_voxel import multi_voxel_fit
from dipy.reconst.csdeconv import csdeconv
from dipy.reconst.shm import real_sph_harm
from scipy.special import gamma, hyp1f1
from dipy.core.geometry im... |
from PIL import Image
from pylab import *
from scipy.ndimage import measurements, morphology
# 形态学(或数学形态学)是度量和分析基本形状的图像处理方法的基本框架与集合。
# 形态学通常用于处理二值图像,但是也能够用于灰度图像。
# 载入图像,然后使用阈值化操作,以保证处理的图像为二值图像
im = array(Image.open('test.jpg').convert('L'))
# 通过和 1 相乘,脚本将布尔数组转换成二进制表示。
im = 1 * (im < 240)
# 使用 label() 函数寻找单个的物体,
# 并且按... |
# -*- coding: utf-8 -*-
from tqdm import tqdm
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
from scipy.cluster.hierarchy import linkage, fcluster
import seaborn as sns
__all__ = ['GDNBData']
class GDNBData(object):
"""
the core class for the GDNB method, the instance of thi... |
<filename>safe_il/agents/mpc/mpc_utils.py<gh_stars>0
from functools import partial
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import scipy.stats as stats
# -----------------------------------------------------------------------------------
# Agent
# -------... |
<filename>Auctions/Digital Marketplace/simple_2_bidders/paper_plots.py
#!/usr/bin/env python
# encoding: utf-8
"""
paper_plots.py
Created by <NAME> on 2011-08-29.
Copyright (c) 2011 University of Strathclyde. All rights reserved.
"""
from __future__ import division
import sys
import os
import numpy as np
import scipy.... |
<gh_stars>0
import numpy as np
from matplotlib import pyplot as plt
from scipy.stats import lognorm
from scipy import stats
import math
import pandas as pd
import seaborn as sns
from myUQlib import *
# fig, ax = plt.subplots(2)
# standard deviation of normal distribution K
# sigma_K = 1
# mean of normal distribution
... |
<gh_stars>10-100
import logging
logger = logging.getLogger(__name__)
import os
from chainer.dataset import DatasetMixin
import imageio
import numpy as np
from scipy.io import loadmat
from pose.hand_dataset.dataset import HandPoseDataset as HandDataset
from pose.graphics import camera
from pose.hand_dataset.common_d... |
<reponame>jfozard/HEI10
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
import os
import os.path
from imageio import imread
from scipy.signal import find_peaks, find_peaks_cwt
from scipy.signal import peak_prominences
import scipy.linalg as la
from functools import reduce
import pickle... |
from sympy import *
from float_ import Float, ComplexFloat
import functions
import constants
from utils_ import bitcount
def polyfunc(expr, derivative=False):
"""
Convert a SymPy expression representing a univariate polynomial
into a function for numerical evaluation using Floats /
ComplexF... |
# -*- coding: utf-8 -*-
from warnings import warn
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats
from ..complexity import (complexity_lempelziv, entropy_approximate,
entropy_fuzzy, entropy_multiscale, entropy_sample,
... |
from __future__ import absolute_import, division, print_function
import sys
import random
import pickle
import logging
import logging.handlers
import numpy as np
import csv
import scipy.sparse as sp
import torch
# Dataset names.
from sklearn.feature_extraction.text import TfidfTransformer
ML1M = 'ml1m'
LASTFM = 'la... |
#!/usr/bin/python3
import queue
import unittest
import numpy as np
import scipy.optimize
import helper.basis
import helper.function
import tests.misc
class Test44SpatAdaptiveBFS(tests.misc.CustomTestCase):
@staticmethod
def getExampleHierarchicalFundamentalBases():
bases1D = [[
#helper.basis.Hierarchi... |
<gh_stars>1-10
"""
Tools for reversing parsed notation back into a standard form.
In other words in combination with parsing translate relative intervals like M3- to ratio notation such as 5/4 or (absolute) pitch notation like C5#-
"""
from collections import Counter
from fractions import Fraction
from numpy import arr... |
from droplet_pressure.droplet import Droplet
import matplotlib.pyplot as plt
from matplotlib.patches import Arc, Path, PathPatch, Circle, FancyArrowPatch
from matplotlib.animation import FuncAnimation, FFMpegFileWriter, FFMpegWriter
import numpy
from numpy import pi, sin, cos, radians
from scipy.stats import linregress... |
import numpy as np
import os
import cv2 as cv
import matplotlib.pyplot as plt
import scipy.io as sio
import FaceDataIO as fdio
import tensortoolbox as ttl
from tensorly.decomposition import parafac
################################### Improved Method ###################################
def run():
databas... |
<filename>intern/object_mix.py
import os
import bpy
from contextlib import contextmanager
from fractions import Fraction
from typing import List
from ear.fileio.adm.elements import ObjectCartesianPosition, JumpPosition, AudioBlockFormatObjects
from ear.fileio.bw64 import Bw64Reader
from .geom_utils import speaker_act... |
import os, glob
import numpy as np
import random
from scipy import misc
from app import OUTPUT_TILES_FOLDER
class ZoomLoader(object):
def __init__(self, zoom):
self.files = glob.glob(os.path.join(OUTPUT_TILES_FOLDER, str(zoom), '*', '*.png'))
self.i = -1
def __iter__(self):
return self
def __len__... |
from brightics.common.report import ReportBuilder, strip_margin, plt2MD, \
pandasDF2MD, keyValues2MD
from scipy.stats import bartlett
import seaborn as sns
import statsmodels.api as sm
import matplotlib.pyplot as plt
from statsmodels.formula.api import ols
from statsmodels.sandbox.stats.multicomp import TukeyHSDRe... |
import pandas as pd
import numpy as np
from scipy import signal
import networkx as nx
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib
import scipy.interpolate
def read_sig(path, n_channels, header=None, sep='\t', rem_len=5):
"""
Read signal in tabular ... |
# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_daq as daq
import pandas as pd
import numpy as np
from scipy import signal
from dash.dependencies import Input, Output, State, ClientsideFunction, MATCH, ALL
from dash.exceptions import PreventUpdate
i... |
<filename>examples/lemontest-collect-perturbed-trace-metas.py
import random
import numpy as np
from matplotlib import pyplot as plt
from beamngpy import BeamNGpy, Scenario, Vehicle, setup_logging, StaticObject, ScenarioObject
from beamngpy.sensors import Camera, GForces, Electrics, Damage, Timer
import scipy.misc
imp... |
<reponame>J-Garcke-SCAI/jaxkern
import jax.numpy as np
import numpy as onp
from scipy.spatial.distance import pdist, squareform
from sklearn.metrics.pairwise import euclidean_distances
from jaxkern.dist import distmat, pdist_squareform, sqeuclidean_distance
onp.random.seed(123)
def test_distmat():
X = onp.rand... |
import numpy as np
from scipy.optimize import minimize
def neg_L(x,C):
"""negative log-likilhood of parameters P of a pcmc model given data in C
Arguments:
x- parameters for PCMC model
C- dictionary containing choice sets and counts"""
Q = comp_Q(x)
L = 0
for S in C:
pi_S = np.log(solve_ctmc(Q[S,:][:,S]))
... |
import numpy as np
from scipy.fftpack import dct
def cutSample(data):
if len(np.shape(data))==2:
data=data[:,0]
fadeamount = 300
maxindex = np.argmax(data > 0.01)
startpos = 1000
if len(data) > 44100:
if maxindex > 44100:
if len(data) > maxindex + (44100):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Special thanks to @KY-Ng for visualisation code!
'''
import numpy as np # pip3 install numpy
from scipy.integrate import ode, solve_ivp # pip3 install scipy
import pandas as pd # pip3 install pandas
import matplotlib.pyplot as plt # pip3 install matplotlib
# { -- CH... |
#!/usr/bin/env python
# encoding: utf-8
#
# -----------------------------------------------------------------------------------------------------------------------
# Name: test_fractions.py
# Version: 0.0.1
# Summary: Tests for Fraction class.
#
# Author: <NAME>
# Author-email: <EMAIL>
#
# License: MIT
# -----... |
import re
import os
import decimal
import argparse
import numpy as np
from sympy import Symbol
from scipy import interpolate
from sympy.stats import sample, Uniform, Exponential
def main():
""" Add interactivity for LHE analysis """
from argparse import ArgumentParser
parser = ArgumentParser()
parser... |
<filename>3he4he/priors.py
'''
Defines the prior distributions associated with the sampled R-matrix
parameters and normalization factors.
'''
import numpy as np
from scipy import stats
import constants as const
def my_truncnorm(mu, sigma, lower, upper):
'''
My version of a truncated normal distribution that ... |
<filename>notebooks/paper_figures/run_pareto_plot.py
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import figurefirst as fifi
import scipy.fftpack
import pynumdiff
import pickle
import time
from multiprocessing import Pool
import multiprocessing
PADDING = 'auto'
def get_data(problem, noi... |
import numpy as np
from scipy import stats
x1 = [] #Spent on setup
for i in range(94):
x1.append(20000)
for i in range(31):
x1.append(60000)
for i in range(14):
x1.append(90000)
for i in range(19):
x1.append(100000)
x2 = [] #Spent on games
for i in range(82):
x2.append(500)
for i in range(15):
... |
<filename>substitutions/quantify.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 1 13:56:13 2017
@author: ernestmordret
"""
import pandas as pd
from scipy.interpolate import interp1d
import re
import numpy as np
import os
def create_modified_seq(modified_seq, destination):
"""
Inp... |
import math as math
import numpy as np
from scipy.optimize import linear_sum_assignment
import time
from abc import ABC, abstractmethod
def getdirection(a, b):
ax, ay = a["xcenter"], a["ycenter"]
bx, by = b["xcenter"], b["ycenter"]
x = bx - ax
y = by - ay
if (x ** 2) + (y ** 2) > 100:
retur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.