text string |
|---|
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Extinction functions."""
import os
import numpy as np
from scipy.ndimage import map_coordinates
from astropy.coordinates import SkyCoord
from astropy.wcs import WCS
import astropy.units as u
from astropy.io import fits
from astropy.utils import isiter... |
"""This solves problem #33 of Project Euler (https://projecteuler.net).
Digit cancelling fractions
The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to
simplify it may incorrectly believe that 49/98 = 4/8, which is correct, is obtained by
cancelling the 9s.
We shall consider f... |
from motPapa import DetectionFileReader
from scipy.optimize import linear_sum_assignment
from scipy.spatial import distance_matrix
import numpy as np
import matplotlib.pyplot as plt
from motPapa import IoU_calc, get_bb_pp
gt_path = "../data/gt/gt.txt"
det_path = "../Output/detections.csv"
gt_reader = DetectionFileRea... |
<filename>EISWebFit/plotlydash/dashboard.py
"""Instantiate a Dash app."""
import dash
from dash import dcc
from dash import html
from dash import dash_table
from dash.dependencies import Input, Output, State, ALL
from plotly.subplots import make_subplots
import plotly.express as px
import plotly.graph_objects as go
imp... |
''' Class to hold a model of a full system
'''
import starry
import astropy.units as u
import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy
import string
from datetime import datetime
import pandas as pd
import sys
import os
import pickle
from scipy.optimize import minimize
from .star import ... |
<reponame>APMonitor/applications
# This script simulates a Hot Air Balloon, type AX7-77 from Head Balloons,
# Inc.
#
# <NAME> 06/07/17
import numpy as np
from scipy.integrate import odeint
def hab(x,t,alpha,gamma,mu,omega,delta,beta,u0,u1):
# This function evaluates the ode rhs for the hot air balloon sim... |
<gh_stars>0
#!/usr/bin/env python
"""
# Author: <NAME>
# Created Time : Tue Sep 15 19:15:31 CST 2020
# File Name: dataset.py
# Description:
"""
import os
import numpy as np
import pandas as pd
import scipy
import time
from tqdm import tqdm
from torch.utils.data import Dataset
import anndata as ad
import scanpy as sc
... |
from scipy.stats import entropy
import numpy as np
from .base import ScoredQuerySampler
from .typeutils import check_proba_estimator
def _get_probability_classes(
classifier,
X: np.ndarray) -> np.ndarray:
"""Returns classifier.predict_proba(X)
Args:
classifier: The classifier for whi... |
import os.path
import medipy.itk
medipy.itk.load_wrapitk_module(os.path.dirname(__file__), "MediPyDiffusion")
import estimation
import fiber_statistics
import gui
import io
import registration
from spectral_analysis import spectral_analysis
import scalars
import statistics
import tractography
import utils
|
"""
Classes used for modular modeling of different regression methods
Defines the Regressor Abstract Base Class that can be used to create
custom regression methods
Subclasses of Regressor can be used with the CurveExtension class
in the hrosailing.pipeline module
"""
import inspect
import logging.handlers
from abc... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Module describing the weighted non-linear optimization scheme used to
determine the wavelength sensitivity of the spectrometer using a polynomial
as a model function"""
import os
import numpy as np
import math
import scipy.optimize as opt
import logging
from datetim... |
<gh_stars>10-100
import cv2
import numpy as np
from scipy.spatial.distance import euclidean
from scipy.ndimage.morphology import binary_dilation
from skimage.transform import hough_circle, hough_circle_peaks
from skimage.feature import canny
from skimage import exposure
import pipeline_utils
import face_utils
def ... |
import numpy as np
import scipy.misc, math
from PIL import Image
img = Image.open('images/lena512.bmp')
img1 = np.asarray(img)
fl = img1.flatten()
hist, bins = np.histogram(img1,256,[0,255])
cdf = hist.cumsum()
cdf_m = np.ma.masked_equal(cdf,0)
num_cdf_m = (cdf_m - cdf_m.min())*255
den_cdf_m = (cdf_m.max()-cdf_m.m... |
import numpy as np
import matplotlib.image as mpimg
import h5py
import os
import pandas as pd
import scipy.io as scio
import matplotlib.pyplot as plt
import math
import time
import cv2
depth_maps = h5py.File('/dataspace/zhangboshen/ITOP_LSTM/ITOP_NewBaseline/data/top_train/ITOP_top_train_depth_map.h5', 'r... |
<filename>project/reports/compressed_sensing/tf_network.py
import numpy as np
import utils
import scipy.sparse
import tensorflow as tf
# Global parameters
dataset_name = 'standard'
patch_size = (32, 32) # (patch_height, patch_width)
compression_percent = 60
# Data acquisition
# Generate original images
utils.gener... |
<filename>embedding-calculator/src/services/facescan/plugins/test_landmarks.py
# Copyright (c) 2020 the original author or 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
#
# ... |
<gh_stars>0
import numpy as np
import scipy
import json
import os, itertools
import tensorflow.compat.v1 as tf
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('npy', default=None, help='array')
parser.add_argument('--periodic', action='store_true', default=False, help='Periodic boundary conditio... |
<reponame>aminzayer/Amin-University-Data-Science
# K-NN Classification Algorithms Implementation
from statistics import mean
from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
import os
def clearConsole():
command = 'clear'
if os.name in ('nt', 'dos'): # If Machine is ... |
import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools, random
#from collections import deque
#from heapq import heappush, heappop
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
INF = float("INF")
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1... |
<reponame>michaels10/pydec
from pydec.testing import *
from scipy.misc import factorial, comb
from pydec.math.combinatorial import combinations, permutations
def test_combinations():
for N in xrange(6):
L = range(N)
for K in xrange(N+1):
C = list(combinatio... |
<filename>tests/test_algorithms/test_power_method.py
import math
import numpy as np
from scipy.linalg import block_diag
from lexrank.algorithms.power_method import (
connected_nodes, stationary_distribution,
)
def test_connected_nodes():
t_matrix = np.array([[1]])
result = connected_nodes(t_matrix)
... |
"""
Custom 2D FFT functions.
numpy, scipy and mkl_fft do not have fft implemented such that output argument
can be provided. This implementation adds the output argument for fft2 and
ifft2 functions.
Also, for mkl_fft and scipy, the computation can be performed in parallel using ThreadPool.
"""
from __future__ im... |
#this program will combine images to make a master frame
#if you use this code, please cite Oelkers & Stassun 2018
#import the relevant libraries for basic tools
import pyfits
import numpy as np
import scipy
from scipy import stats
from os import path
import math
import time
#import relevant libraries for a list
imp... |
<reponame>ladisk/FLife<gh_stars>1-10
import numpy as np
from scipy.integrate import quad
from scipy.special import gamma
from scipy.optimize import fsolve
class ZhaoBaker(object):
"""Class for fatigue life estimation using frequency domain
method by Zhao and Baker[1, 2].
References
----------
... |
from numpy import *
import matplotlib.pyplot as plt
from scipy import interpolate
import sys
# x = loadtxt('cdf_r.dat')
# y = arange(0, size(x),1)/float(size(x))
U_x = sort(loadtxt(sys.argv[1])[:,6])
for cnt in range(size(U_x)):
if U_x[cnt] > 1.5:
break;
U_x = U_x[:cnt]
U_t = []
for i in linspace(0,size... |
<reponame>cajal/inception_loop2019<gh_stars>1-10
import datajoint as dj
import torch
import numpy as np
from numpy.linalg import eigvals
from .utils import list_hash, key_hash, deepdraw, process, unprocess, SpatialTransformerPyramid2d, roll, create_gabor
from attorch.regularizers import Laplace
from scipy import ndi... |
<reponame>naga1090/blurImage
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
import imageio
import math
img_url = "https://news.virginia.edu/sites/default/files/article_image/accolades_ss_header.jpg"
img = imageio.imread(img_url).astype('float32') / 255
def displayImage(img):
plt.imsh... |
<gh_stars>10-100
import pytest
from skimpy.nullspace import left_integer_nullspace
import numpy as np
from scipy.sparse import random
from scipy import stats
class ThisCustomRandomState(np.random.RandomState):
def randint(self, k):
i = np.random.randint(k)
return i
def choice(... |
<reponame>wkkxixi/rivuletpy
import os
import numpy as np
from scipy import io as sio
def loadimg(file):
if file.endswith('.mat'):
filecont = sio.loadmat(file)
img = filecont['img']
for z in range(img.shape[-1]): # Flip the image upside down
img[:,:,z] = np.flipud(img[:,:,z])
... |
from numpy import arange, argsort, cumsum, diag, identity, ones
from scipy.linalg import block_diag
from .affine_dynamics import AffineDynamics
from .linearizable_dynamics import LinearizableDynamics
class FBLinDynamics(AffineDynamics, LinearizableDynamics):
"""Abstract class for feedback linearizable affine dyna... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
author: hypatia
"""
import yaml
import rospy
import numpy as np
import math
import matplotlib.pyplot as plt
import statistics
import seaborn
import pandas as pd
from scipy import stats
import seaborn as sns
import random
def bernoulli_sampling(percent=50):
ret... |
<reponame>Advanced-Imaging/3D-render-of-3D-array<filename>volume_rendering_vtk.py<gh_stars>0
#!/usr/bin/python
#import SimpleITK as sitk
from matlab2python import matfile
import vtk
import numpy as np
from vtk.util.vtkConstants import *
def numpy2VTK(img,spacing=[1.0,1.0,1.0]):
# evolved from code from <NAME>.,
... |
<reponame>Timmarh/A10_changeDet
from scipy.spatial import cKDTree
from pyntcloud.ransac.models import RansacPlane
from pyntcloud.ransac.fitters import single_fit
from sklearn.cluster import DBSCAN
import warnings
import pandas as pd
from pyntcloud import PyntCloud
import numpy as np
import pdal
import shapely.wkt
from ... |
'''
Reduced basis methods...
'''
import numpy as np
import scipy as sp
from scipy import linalg
from .solver import solve_sparse, SpSolve
__all__ = ['krylov_subspace',
'compute_modes_pardiso',
'vibration_modes',
'craig_bampton',
'pod',
'modal_derivatives',
... |
<filename>shor.py
from fractions import Fraction
from qiskit import *
from arithmetic_circuit import *
def shor_algorithm(num_qubits: int, a: int, n: int) -> int:
# check args
assert gcd(a, n) == 1
assert a.bit_length() <= num_qubits
assert n.bit_length() <= num_qubits
n_counts = num_qubits * 2... |
<reponame>Hyeondeok-Shin/qmcpack
import h5py
import numpy as np
from scipy.special import sph_harm, factorial2
def write_h5_file():
hf = h5py.File('lcao_spinor.h5','w')
#atoms
atoms = hf.create_group('atoms')
nat = np.array([1])
nsp = np.array([1])
pos = np.array([[0.0,0.0,0.0]])
ids =... |
import numpy as np
import numpy.linalg as LA
import scipy.sparse as sp
from scipy.stats.mstats import gmean
from time import time
from multiprocessing import Process, Pipe
import sys, os, warnings
from a2dr.precondition import precondition
from a2dr.acceleration import aa_weights
from a2dr.utilities import get_version... |
<reponame>fpirovan/imitation
import errno
import os
import numpy as np
def safezip(*ls):
assert all(len(l) == len(ls[0]) for l in ls)
return zip(*ls)
def flatten(lists):
out = []
for l in lists:
out.extend(l)
return out
def flatcat(arrays):
return np.concatenate([a.ravel() for a in a... |
<reponame>Olimaol/BOLDpaper2021<filename>srcSim/get_weightDist.py<gh_stars>1-10
from ANNarchy import *
import pylab as plt
from scipy import signal, stats
from model_neuronmodels import params, rng, Izhikevich2007RS, Izhikevich2007FS
from extras import lognormalPDF, get_log_normal_fit, set_size
### create 1000 neuron... |
<reponame>chatzikon/DNN-COMPRESSION<filename>cifar/step1/cifar10/res110prune.py
import argparse
import numpy as np
import os
import torchnet as tnt
import torch
import torch.nn as nn
from torch.autograd import Variable
from scipy import stats
from models import resnet
from data_loader import get_train_valid_loader, ge... |
from ast import literal_eval
from os import listdir
from os.path import isfile, join
from scipy.sparse import save_npz, load_npz
import numpy as np
import os
import pandas as pd
import pickle
import stat
import yaml
def save_dataframe_csv(df, path, name):
df.to_csv(path+name, index=False)
def load_dataframe_cs... |
<reponame>Jinming-Su/SGNet
import logging
import cv2
import numpy as np
import imgaug.augmenters as iaa
from imgaug.augmenters import Resize
from torchvision.transforms import ToTensor
from torch.utils.data.dataset import Dataset
from scipy.interpolate import InterpolatedUnivariateSpline
from imgaug.augmentables.lines... |
# -*- coding: utf-8 -*-
# =============================================================================
# Here we will be testing with mixtures of student-t, 1d
# =============================================================================
import sys
sys.path.insert(0,"../../src")
import math
import functools
import... |
import os
import ipdb
import matplotlib
import torch as t
from tqdm import tqdm
import numpy as np
from scipy.misc import imsave
from utils.config import opt
from data.dataset import Dataset, TestDataset, inverse_normalize
from model import FasterRCNNVGG16
from torch.autograd import Variable
from torch.utils import d... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Hydrate Modified-van der Waals Platteeuw Equation of State
This file implements a hydrate equation of state (EOS)named
Modified- van der Waals Platteeuw after Ballard and Sloan (2002).
The file consists of a generic hydrate class 'Hydrate EOS' and the
class, 'HvdwpmEos... |
<reponame>nitsuga/MRTeAm<filename>scripts/analysis/plot_allocation_tasc.py
#!/usr/bin/env python
import getopt
import glob, os, pickle, re, sys
import pprint
import rosbag
from collections import defaultdict
# Stats/plotting libraries
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy ... |
import numpy as np
import random
from scipy import interpolate as spi
from matplotlib import pyplot as plt
from matplotlib import animation
from memoize import memoized
class Results(object):
# TODO: improve docs
def __init__(self, shape=None, fname=None, nsigma=1.):
"""Blalbalba
Parameters... |
<filename>itur/models/itu530.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from astropy import units as u
from scipy.optimize import bisect
from itur.models.itu453 import DN65
from itur.models.itu837 import r... |
<gh_stars>0
import os,shutil
import pickle as cPickle
import numpy as np
from scipy.io.wavfile import read
from sklearn.mixture import GaussianMixture
from sklearn import mixture
from Feature_Extraction import extract_features
import warnings
warnings.filterwarnings("ignore")
from flask import Flask,... |
<filename>app/src/main/python/ECGFliterStatic.py
import numpy as np
import pywt
from scipy import signal
def butterBandPassFilter(low_cut, high_cut, sample_rate, order):
# 生成巴特沃斯带通滤波器
semi_sample_rate = sample_rate * 0.5
low = low_cut / semi_sample_rate
high = high_cut / semi_sample_rate
b, a = s... |
<reponame>haller218/AnacondaEstudo
# -*- coding: utf-8 -*-
from scipy.stats import norm
# conjunto de objetos em uma cesta, a media é 8 e o desvio padrão é 2
# Qual a probabilidade de tirar um objeto com peso menor que 6 quilos?
proba = norm.cdf(6,8,2)
print ( proba )
# qual a probabilidade de tirar um objeto co... |
<gh_stars>1-10
#! /usr/bin/python3
r'''###############################################################################
###################################################################################
#
#
# Tegridy MIDI X Module (TMIDI X / tee-midi eks)
# Version 1.0
#
# NOTE: TMIDI X Module starts after the part... |
<reponame>GazzolaLab/BR2-vision-based-smoothing
import os
import sys
import json
import numpy as np
import numpy.linalg as la
import scipy.stats as ss
import scipy.linalg as spl
# http://www.kwon3d.com/theory/dlt/dlt.html
"""
DLT module
"""
class DLT:
"""
End-to-end Direct Linear Transformation (DLT) mod... |
<reponame>nlaanait/qcdenoise
import numpy as np
from sympy.physics.paulialgebra import Pauli, evaluate_pauli_product
from sympy import I
def get_unique_operators(stabilizers=[]):
""" strip leading sign +/- from stabilizer strings """
operator_strings = [x[1:] for x in stabilizers]
return list(set(operator_... |
<reponame>bihealth/atlatl<filename>atlatl/helpers.py<gh_stars>0
import pathlib
import subprocess
import shlex
from collections import defaultdict
from typing import Tuple
import pandas as pd
import numpy as np
import tempfile
import io
import os
from scipy.stats import binom
import plotly.graph_objects as go
import pl... |
import warnings
import numpy as np
from scipy import stats
from scipy.ndimage import convolve1d
from scipy.signal import medfilt, hamming
from scipy.ndimage.filters import convolve1d
def medianfilter(X, axis=2):
ks = [1]*len(X.shape)
ks[axis] = 5
return medfilt(X, kernel_size=ks)
def unsharp_masking(X):
... |
<reponame>xrick/Lcj-DSP-in-Python
import numpy as np
import scipy.signal as signal
import matplotlib.pyplot as plt
M = 65
w1 = signal.boxcar( M )
w2 = signal.hamming( M )
w3 = signal.hann( M )
w4 = signal.bartlett( M )
w5 = signal.barthann( M )
w6 = signal.kaiser( M, 14 )
plt.figure( 1 )
plt.plot( w1 )
plt.xlabel( 'n... |
# -*- coding: utf-8 -*-
########### SVN repository information ###################
# $Date: 2020-12-31 02:44:57 +0900 (木, 31 12月 2020) $
# $Author: toby $
# $Revision: 4687 $
# $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/GSASIIfiles.py $
# $Id: GSASIIfiles.py 4687 2020-12-30 17:44:57Z toby $
########### SVN ... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import numpy as np
import scipy as sp
def moments_mvou(x_tnow, deltat_m, theta, mu, sig2):
"""For details, see here.
Parameters
----------
x_tnow : array, shape(n_, )
deltat_m : array, shape(m_, )
theta : array, shape(n_, n_)
mu : ar... |
import matplotlib.pyplot as plt
import numpy as np
import pyfftw
import scipy.signal as sg
from PIL import Image, ImageDraw
from litho.config import PATH
from litho.gdsii.library import Library
class Mask:
"""
Binary Mask
Args:
x/ymax: for the computing area
x/y_gridsize: the simulated ... |
from __future__ import division, absolute_import, print_function
import numpy as np
import os
import sys
import esutil
import time
import scipy.optimize
import matplotlib.pyplot as plt
from .fgcmUtilities import objFlagDict
from .sharedNumpyMemManager import SharedNumpyMemManager as snmm
class FgcmFlagVariables(ob... |
import tensorflow as tf
import numpy as np
import time
import scipy.sparse as sp
from sklearn.metrics import roc_auc_score, average_precision_score, roc_curve, precision_recall_curve, auc
from preprocessing import construct_feed_dict
from outputs import viz_train_val_data, viz_roc_pr_curve, max_gmean_thresh
def trai... |
# -*- coding: utf-8 -*-
'''
This script performs the calibration process based on the
provided dataset. It will determine the mechanical
tolerances of the system and store them for later use
when creating a look-up table.
First make sure that the experimental data created in m01
is pointed ... |
<filename>LTRSimulation.py
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from __future__ import division
from pandas import *
import os, os.path
import numpy as np
from matplotlib import pyplot as plt
os.chdir('/home/will/LTRtfAnalysis/')
# <codecell>
import glob
files = glob.glob('microarray_da... |
'''Program to find L and U matrix using LU decomposition.
Developed by: <NAME>
RegisterNumber: 21004191
'''
# To print L and U matrix
import numpy as np
from scipy.linalg import lu
A=np.array(eval(input()))
P,L,U=lu(A)
print(L)
print(U) |
<filename>immunopy/MMCorePyFake.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on 2014-05-28
@author: <NAME>
"""
import os
import Tkinter as tk
import ttk
import tkFileDialog
import threading
import numpy as np
from scipy import misc
try:
import MMCorePy
base = MMCorePy.CMMCore
MM_INSTALL... |
<filename>tools/valuation.py
import numpy as np
import os
import glob
from PIL import Image
import cv2 as cv
import os
from sklearn.metrics import confusion_matrix,cohen_kappa_score
from skimage import io
from skimage import measure
from scipy import ndimage
from scipy import misc
from sklearn.metrics import f1_score
f... |
from statistics import mode
from urllib import response
import re
from validate_docbr import CPF
def cpf_valido(numero_do_cpf):
cpf = CPF()
return cpf.validate(numero_do_cpf)
def nome_valido(nome):
return nome.isalpha()
def rg_valido(numero_do_rg):
return len(numero_do_rg) == 9
def celular_valido(n... |
<reponame>PythonCharmers/OOSuite<gh_stars>1-10
from scipy.optimize.lbfgsb import fmin_l_bfgs_b
import openopt
from openopt.kernel.setDefaultIterFuncs import *
from openopt.kernel.ooMisc import WholeRepr2LinConst
from openopt.kernel.baseSolver import baseSolver
class scipy_lbfgsb(baseSolver):
__name__ = 'scipy_lbfg... |
import pandas as pd
from scipy.stats import stats
from sklearn.model_selection import train_test_split
from properties import get_validation_split
def load(file_path):
columns = ['user', 'activity', 'timestamp', 'x', 'y', 'z']
data = pd.read_csv(file_path, names=columns)
data = data.drop(data.query('acti... |
<reponame>takseki/python-machine-learning-book
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from sklearn.linear_model import LogisticRegression
from sklearn.discr... |
import argparse
import json
import os
from os.path import exists
import pickle
from time import time
import math
import torch
from torch.utils.data import DataLoader
from horovod import torch as hvd
from data import (PrefetchLoader,
DetectFeatLmdb, TxtTokLmdb, ItmEvalDataset, itm_eval_collate,
... |
<filename>Evol_Traj_Example_summary.py<gh_stars>1-10
""" Plot a few exemplar traj and plot summary for Convergence Speed"""
import os
import re
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
import seaborn as sns
from time import time
from os.path import join
from scipy.stats import linregress, t... |
<filename>lib/traffic-tool/src/python/invoke_API.py<gh_stars>1-10
# Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtai... |
"""
Created on Sun Feb 2 13:28:48 2020
@author: matias
"""
import numpy as np
import sys
import os
from os.path import join as osjoin
from pc_path import definir_path
path_git, path_datos_global = definir_path()
os.chdir(path_git)
sys.path.append('./Software/utils/')
from int import integrador
from taylor import ... |
from functools import partial
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
DataFrame,
Series,
concat,
isna,
notna,
)
import pandas._testing as tm
import pandas.tseries.offsets as offsets
@td.skip_if_no_scipy
@pytest.mark.pa... |
<reponame>0xDBFB7/covidinator
from time import sleep
import numpy as np
from scipy.signal import cheby1
from scipy.signal import find_peaks
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.optimize import minimize,basinhopping
import time
import math
from math import sin, cos, pi, sqrt... |
<reponame>chengfzy/PythonStudy
"""
Some code for B-Spline curve
S(x) = Sum_{j=0}^{n-1} c[j] * B[j,k;t](x)
B[i,0](x) = 1 if t[i] <= x <= t[i+1], otherwise 0
B[i,k](x) = (x - t[i]) / (t[i+k] - t[i]) * B[i, k-1](x) + (t[i+k+1] - x) / (t[i+k+1] - t[i+1]) * B[i+1, k-1](x)
Ref:
[1] https://docs.scipy.org/doc/scipy/referen... |
import numpy as np
import scipy.stats as ss
import deeprob.spn.structure as spn
import deeprob.spn.algorithms as spnalg
import deeprob.spn.utils as spnutils
from deeprob.spn.learning import learn_spn
class Cauchy(spn.Leaf):
LEAF_TYPE = spn.LeafType.CONTINUOUS
def __init__(self, scope: int, loc: float = 0.0,... |
<filename>src/mult_fit_vl.py
'''
run the validation procedure on a dataset
run it with
mpirun -np 5 python validate.py
'''
import os
import numpy as np
from time import time
import sys
from scipy.optimize import curve_fit
def model(x, *theta):
return theta[0] + np.matmul(x, np.array(theta[1:]))
def r... |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import random
import copy
import uuid
import scipy.stats as stat
from math import log, gamma, exp, factorial, pi, sqrt, erf, atan
from scipy.special import gammainc
from scipy.interpolate import interp1d
import os,sys
def Exponential_rate(t,rat... |
<reponame>velocist/TS4CheatsInfo
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\aging\aging_mixin.py
# Compiled at: 2020-02-26 03:35:36
# Size... |
import numpy as np
from scipy.interpolate import splev
###############################################################################
class FinCurveFitMethod():
pass
###############################################################################
class FinCurveFitPolynomial():
def __init__(self, power=3... |
#!/usr/bin/env python3
# k-means clustering dataset generator
# by <NAME>, 8160192
# Created in the scope of the "Big Data Management Systems" class
#
# USAGE: ./datagen.py <centers_file> (-v) (Show visualizations of data at finish time)
# Input: File (as command line argument) containing the coordinates
# of an arbit... |
from potentials.DiscreteCondPot import *
from nodes.BayesNode import *
import math
import cmath
import misc.Utilities as ut
class BeamSplitter(BayesNode):
"""
The Constructor of this class builds a BayesNode that has a transition
matrix appropriate for a beam splitter.
The following is expected:
... |
#!/usr/bin/env python
# Filename: plot_air_tem.py
"""
introduction: plot the time series of air temperature
authors: <NAME>
email:<EMAIL>
add time: 29 May, 2019
"""
import sys,os
from optparse import OptionParser
import rasterio
import numpy as np
# import pandas as pd # read and write excel files
HOME = os.path.ex... |
<gh_stars>0
# The normal imports
import numpy as np
from numpy.random import randn
import pandas as pd
# Import the stats library from numpy
from scipy import stats
# These are the plotting modules adn libraries we'll use:
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
# Now we'll le... |
<gh_stars>1-10
#To do change compass and alter headding
#
import sys
import os
import fileinput
import re
import numpy as np
import scipy as sp
import pylab
import csv
import linecache
from StringIO import StringIO
def updatewind(curfile,deploydir,probefile,stickid,headerwind):
#test if the file has qc flags
curfi... |
<reponame>Philipp238/Safe-Policy-Improvement-Approaches-on-Discrete-Markov-Decision-Processes<filename>experiment.py<gh_stars>0
import os
import sys
import ast
import time
from distutils import util
import configparser
import numpy as np
import pandas as pd
from scipy.stats import norm
from wet_chicken_discrete.basel... |
<filename>policy/feudalRL/DIP_parametrisation.py<gh_stars>0
###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2019
# Cambr... |
<filename>bw2regional/lca/extension_tables.py
import itertools
from functools import partial
import matrix_utils as mu
import numpy as np
from scipy.sparse import diags
from ..errors import MissingIntersection
from ..intersection import Intersection
from ..meta import extension_tables, intersections
from ..utils impo... |
import tensorflow as tf
import numpy as np
import math
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tf_util
from munkres import munkres
from scipy.spatial import distance
from tensorflow.python.framework ... |
# Copyright (c) 2013, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
#
#Parts of this file were influenced by the Matlab GPML framework written by
#<NAME> & <NAME>, however all bugs are our own.
#
#The GPML code is released under the FreeBSD License.
#Copyright (c) 2005-2013 ... |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import division
from builtins import zip
from builtins import input
from builtins import map
from builtins import next
from builtins import str
from builtins import range
from past.utils import old_div
from builtins import object
import sys
imp... |
import sys
import limix
from limix.core.covar import LowRankCov
from limix.core.covar import FixedCov
from limix.core.covar import FreeFormCov
from limix.core.gp import GP3KronSumLR
from limix.core.gp import GP2KronSum
import scipy as sp
import scipy.stats as st
from limix.mtSet.core.iset_utils import *
import numpy a... |
<reponame>nicokurtovic/SIMIO<filename>codes/analysis_scripts/AntPosResult.py<gh_stars>0
# plot Antennas position results relative to one antenna
# First version imported by <NAME>. All subsequent edits by <NAME>
#
from __future__ import print_function # prevents adding old-style print statements
from asdm import *
im... |
<filename>project5_code/main.py
import numpy as np
import matplotlib.pyplot as plt
import itertools as it
import os.path
from scipy.spatial import Delaunay
from glob import glob
import subprocess
from get_triangulation import get_shape
from transformations import warp_image, get_warp_frames
def load_file(fpath, fnam... |
"""
analytics.py
Author: <NAME>
Description:
This module implements the Analytics class which provides handy statistics from
data obtained while running the synthesizer. The .dat files produced from calling
the save_data method of the plotter class can analyzed and the mean, std deviation
and the like can be returned... |
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name,missing-docstring
# Copyright 2017 IBM RESEARCH. 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://ww... |
import pandas as pd
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
from skimage.transform import resize
import itertools
from sklearn.metrics import confusion_matrix,roc_auc_score, roc_curve, auc, precision_recall_curve, average_precision_score, f1_score
import seaborn as sns
import scipy
from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.