text string |
|---|
import os
import sys
import re
import numpy as np
import random
import getopt
import time
import matplotlib.pyplot as plt
from scipy.interpolate import splrep, pchip, splmake, splev, spline, interp1d
import signal
# ========================================= Exception ================================================= #... |
<filename>conjugate_prior/invgamma.py
import numpy as np
from scipy import stats
try:
from matplotlib import pyplot as plt
except ModuleNotFoundError:
import sys
sys.stderr.write("matplotlib was not found, plotting would raise an exception.\n")
plt = None
class InvGammaNormalKnownMean:
__slots__... |
import numpy as np
from . import regimes as REGI
from . import user_output as USER
import multiprocessing as mp
import scipy.sparse as SP
from .utils import sphstack, set_warn, RegressionProps_basic, spdot, sphstack
from .twosls import BaseTSLS
from .robust import hac_multi
from . import summary_output as SUMMARY
from ... |
import numpy as np
import matplotlib.pyplot as plt
from qibo.models import Circuit
from qibo import gates
import aux_functions as aux
def rw_circuit(qubits, parameters, X=True):
"""Circuit that implements the amplitude distributor part of the option pricing algorithm.
Args:
qubits (int): number of qub... |
<reponame>GaoZiQun/renlianshibei
from scipy import misc
import numpy as np
import os
import cv2
import dlib
# 引入上一节定义的MTCNN人脸检测的函数mtcnn_findFace
from face_detect_main import mtcnn_findFace
# 特征点预测器文件和dlib人脸识别模型文件
shape_predictor_68_face_landmarks = "./shape_predictor_68_face_landmarks.dat"
shape_predictor_5_face_landm... |
<reponame>RaphaelChaleil/RunAnalysis
from .TrackPoint import TrackPoint
from typing import List
import xml.etree.ElementTree as ET
import dateutil.parser
import math
import json
import folium
import urllib.request
from folium import plugins
import branca.colormap
import pandas as pd
from geopy import distance
import nu... |
import jax.numpy as jnp
from jax import jit, random, grad, vmap
from jax.config import config
from jax.ops import index_update, index
try:
from tqdm import trange
except ModuleNotFoundError:
trange = range
from time import time
import os
import matplotlib.pyplot as plt
import seaborn as sns
sns.set("notebook... |
# coding: utf-8
# In[1]:
def Defcat(out,outletid):
otsheds = np.full((1,1),outletid)
Shedid = np.full((10000000,1),-99999999999999999)
psid = 0
rout = copy.copy(out)
while len(otsheds) > 0:
noutshd = np.full((10000000,1),-999999999999999)
poshdid = 0
for i in range(0,len(... |
<gh_stars>0
import os
import sys
import subprocess
import time
import glob
import tempfile
import shutil
import argparse
import importlib
import resource
import logging
import traceback
import warnings
warnings.filterwarnings('ignore', '.*output shape of zoom.*')
from functools import partial
import math
import collec... |
<gh_stars>1-10
import fnmatch
import os
import string
import shutil
import gdal, gdalconst
import numpy
from scipy.stats.stats import pearsonr
#
# Checks existence of correlated images in a list
# If some are identical: first is kept, other moved to another dir
#
#inDir='//ies.jrc.it/H03/Forobs_Export/verhegghen_expo... |
import numpy as np
from nipype.interfaces.utility import Function
import nipype.algorithms.rapidart as ra
import nipype.interfaces.afni as afni
import nipype.interfaces.fsl as fsl
import nipype.interfaces.io as nio
import nipype.interfaces.utility as util
import nipype.interfaces.ants as ants
from nipype.interfaces.an... |
<filename>Scripts/Voice/repDataGen.py
## This file is meant to replicate the exact same process, <NAME> has implemented
# for the voice data.
# This file extracts trian, test and validation sets from rep_voice_cohort.csv
# and packs them into datasets on which analysis can be done
# it consists of three sections, eac... |
import numpy as np
import pandas as pd
from lifetimes.utils import coalesce, calculate_alive_path, expected_cumulative_transactions
from scipy import stats
__all__ = [
'plot_period_transactions',
'plot_calibration_purchases_vs_holdout_purchases',
'plot_frequency_recency_matrix',
'plot_probability_alive... |
# <NAME>
# python 3.6
""" Input:
------
It reads the individual driver's correlation nc files
Also uses regional masks of SREX regions to find dominant drivers regionally
Output:
-------
* Timeseries of the percent distribution of dominant drivers at different lags
"""
from scipy import stats
from scipy impor... |
from pprint import pprint
from sys import stdout
import sympy as sym
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
from scipy.optimize import curve_fit
from sklearn.cross_decomposition import PLSRegression
from sklearn.metrics import mean_squared_error, r2_... |
<reponame>KasparSnashall/Z-scan-models
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 08:42:33 2015
@author: <NAME>
script designed to normalise and fit z-scan data using stochiastic method
includes two models for fitting v1 and v2
license = MIT
"""
import pandas as pd
import matplotlib.pyplot as plt
import nump... |
# Now cluster the clusters
from circulo import metrics
from sklearn import metrics as skmetrics
from scipy.spatial.distance import squareform
from scipy.cluster.hierarchy import average,fcluster
import igraph
import numpy as np
import pickle
def to_crisp_membership(ovp_membership):
return [ a[0] for a in ovp_memb... |
import torch
import torchaudio
import torchaudio.functional as F
import torchaudio.transforms as T
import io
import os
import math
import scipy.signal as ss
from logmmse import logmmse
import librosa
import librosa.display
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import s... |
from typing import Tuple
from e2cnn.nn import *
from e2cnn.group import *
import torch
import torch.nn as nn
import numpy as np
import datetime
from scipy import stats
class ExpCNN(torch.nn.Module):
def __init__(self, n_channels, n_classes,
fix_param: bool = False,
delta... |
<filename>img2mask.py
# -*- coding: utf-8 -*-
import numpy as np
from os import name
if "posix" in name:
from matplotlib import use
use("TkAgg")
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from matplotlib.lines import Line2D
from matplotlib.mlab import dist_point_to_segment
from scip... |
<reponame>ClovisChen/LearningCNN
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from scipy.optimize import least_squares
import numpy as np
def rotate(points, rot_vecs):
"""
Rotate points by given rotation vectors.
Rodrigues' rotation formula is used.
"""
theta = np.linalg.norm(rot_vecs, axis=1)[:... |
<reponame>herrlich10/mripy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import sys, os, glob, shutil, shlex, re, subprocess, multiprocessing, warnings, time
import json
from os import path
from collections import OrderedDict
import nump... |
"""
Script and Functions to assmeble gates for the DMFT Loop
"""
from CQS.util.PauliOps import I
from CQS.util.verification import Nident
import qiskit
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from collections import OrderedDict
from openfermion.ops import FermionOperator, QubitOpe... |
# Author: <NAME>
import collections
import cv2
import math
import numpy as np
from scipy import linalg, ndimage
import xml.etree.ElementTree as ET
def bounding_boxes(jpg_file, xml_file):
# lists to hold xmin, xmax, ymin, ymax coordinates
boxes = []
# convert image to array
img = cv2.imread(jpg_file)... |
import os
import glob
import torch
from torch.utils.data import Dataset
import numpy as np
import scipy.io
from skimage.color import rgb2lab
import matplotlib.pyplot as plt
def convert_label(label):
onehot = np.zeros(
(1, 50, label.shape[0], label.shape[1])).astype(np.float32)
ct = 0
for t in np... |
<reponame>FrankWhoee/Aura<filename>CNN-trainer.py
from __future__ import print_function
import os
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.callbacks import ModelCheckpoint
from aura.aura_loader import get_d... |
from scipy.optimize import leastsq
import statsmodels.api as sm
import matplotlib.pyplot as plt
import numpy as np
def model(p, x1, x10):
p1, p10 = p
return p1 * x1 + p10 * x10
def error(p, data, x1, x10):
return data - model(p, x1, x10)
def fit(data):
p0 = [.5, 0.5]
params = leastsq(error, p0, args=... |
import gzip
from os import listdir
from os.path import dirname, join, isfile, splitext
import multiprocessing as mp
import re
import logging
from Bio import Entrez
import numpy as np
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.model_selection import train_test_split
from gensim.models.word2vec i... |
## Local packages:
%matplotlib inline
%load_ext autoreload
%autoreload 2
%config Completer.use_jedi = False ## (To fix autocomplete)
## External packages:
import pandas as pd
pd.options.display.max_rows = 999
pd.options.display.max_columns = 999
pd.set_option("display.max_columns", None)
np.set_printoptions(linewidt... |
<reponame>lima-84/pysid
"""
Created on Wed Apr 24 10:23:22 2019
In this example it is used the prediction error method to estimate a general
MIMO black box transfer function system given as:
A(q)y(t) = (B(q)/F(q))u(t) + (C(q)/D(q))e(t)
@author: edumapurunga
"""
#%% Example 1: Everythning is unknown
#Import Librar... |
<gh_stars>0
# -*- coding: utf-8 -*-
from scipy import signal
import math
import matplotlib.pyplot as plt
import numpy as np
version = 1
subversion = 0
def butterDesign(fo, fPass, fStop, gPass, gStop, fs):
wp = [2*f/fs for f in fPass]
ws = [2*f/fs for f in fStop]
N, Wn = signal.buttord(wp, ws, gPass, gSt... |
from fractions import Fraction
import numpy as np
from projectq.ops import X, Measure, Rz, H
from src.classical import shor
from src.engines.pq_engine import get_engine
from src.shared.rotate import calculate_phase
from src.topology.all_gates.multiply import CMultModN
from src.topology.circuit import Circuit... |
<filename>utils/process_evaluation.py
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
from sklearn.cluster import KMeans, SpectralClustering
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics import accuracy_score
... |
import numpy as np
import sympy as sym
class Experiment(object):
'''Class which stores all of the experiment parameters and methods for
deriving and calculating CRLB data.
Attributes
__________
lens : int
Objective lens, either 40 or 100
weak_grad : bool
If True, calculate CR... |
# Note: The codes were originally created by Prof. <NAME> in the MATLAB
import numpy as np
from scipy.stats import norm
from scipy.interpolate import interp1d
from gmpe_prob_bjf97 import gmpe_prob_bjf97
from gmpe_BSSA_2014 import gmpe_BSSA_2014
from gmpe_CY_2014 import gmpe_CY_2014
# General function to do PSHA calcu... |
#Copyright 2018 Google LLC
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, softwa... |
# -*- coding: utf-8 -*-
"""
Plot Attenuation and transmission of GOTTHARD detector element
"""
from __future__ import division
import matplotlib.pylab as plt
import os
import glob
import numpy as np
GOTTHARDArea = 1130 * (50 / 1000) * 2 # mm
Distance = 163 # cm
ScintillatorArea = 430 * 430 # mm
print 'The area o... |
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_almost_equal
from sklearn.feature_selection import VarianceThreshold
from splearn.feature_selection import SparkVarianceThreshold
from splearn.rdd import DictRDD
from splearn.utils.testing import SplearnTestCase, assert_true
from splear... |
<gh_stars>0
import json
import plotly
import pandas as pd
import re
import nltk
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk import pos_tag
from sklearn.base import BaseEstimator, TransformerMixin
from scipy.stats.mstats import gmean
from ... |
"""Forest of density trees"""
import numpy as np
import multiprocessing
from scipy.stats import multivariate_normal
from joblib import Parallel, delayed
from tqdm import tqdm
from .density_tree_create import create_density_tree
from .random_forest import draw_subsamples
from .density_tree_traverse import descend_densi... |
<filename>Experiment Processing/experiment2/hovered_tracks/hovered_rating_over_time.py
import statistics
import numpy as np
from scipy.stats import ttest_ind
from database.session import Session
from recommender.distance_metrics.cosine_similarity import CosineSimilarity
import matplotlib.pyplot as plt
def hovered_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# To fitting the given SBP data with the following beta model:
# s = s0 * pow((1.0+(r/rc)^2), 0.5-3*beta) + c
# And this tool supports the following two requirements for the fitting:
# (1) ignore the specified number of inner-most data points;
# (2) ignore the da... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
################################################################
# The contents of this file are subject to the BSD 3Clause (New) License
# you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://directory.fsf.org/wik... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# /usr/bin/python2
'''
By <NAME>. <EMAIL>.
https://www.github.com/kyubyong/vq-vae
'''
from __future__ import print_function
import tensorflow as tf
from data_load import load_data
from hparams import Hyperparams as hp
from utils import get_wav, mu_law_decode
from train import ... |
import os
import sys
import numpy as np
import scipy
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import cv2
from PIL import Image
from skimage import io
from skimage.transform import resize
import matplotlib.pyplot as plt
sys.path.append('../')
from model.models import CRNet
fr... |
# pyright: reportMissingModuleSource=false
"""
Simple Truss Calculator
Version: 1.5
Source: https://github.com/lorcan2440/Simple-Truss-Calculator
By: <NAME>
Contact: <EMAIL>
Tests: test_TrussCalc.py
Calculator and interactive program for finding internal/reaction forces,
stresses and strains o... |
import numpy as np
import cmath
import multiprocessing
from Bio import SeqIO
from tqdm import tqdm
from joblib import Parallel, delayed
import itertools
import sys
from calculate_corr import calculate_corr
def read_from_fasta(filename):
reads = []
for record in SeqIO.parse(filename, "fasta"):
reads.ap... |
<reponame>gabecarra/GraphPipe
import os
import sys
import time
from math import ceil
from statistics import mean
from sys import platform
import numpy as np
import cv2
import progress.bar as progress_bar
import src.graph_parser as gp
# Import OpenPose python wrapper
try:
dir_path = os.path.dirname(os.path.realpa... |
# region "Import Libraries"
from scipy import interp
# Avoiding warning
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import warnings
from sklearn.linear_model import bayes
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassifier
from skle... |
<reponame>antoine-spahr/Label-Efficient-Volumetric-Deep-Semantic-Segmentation-of-ICH
"""
author: <NAME>
date : 29.09.2020
----------
TO DO :
- check interpolation order for resize (1 or 3) + for other transform (need order 3 ?)
- check if need a depth padding for 3D nifti for evaluation (so that whole volume can be ... |
<filename>utils/plot_mri_stack.py
"""
Plot MRI slices stacked vertically
"""
import os
import matplotlib.pyplot as plt
from pylab import *
from mpl_toolkits.mplot3d import Axes3D
from matplotlib._png import read_png
import scipy.misc
from matplotlib.collections import PolyCollection
from matplotlib import colors as mc... |
<gh_stars>0
import numpy as np
from scipy.spatial.distance import euclidean
from fastdtw import fastdtw
x = np.array([[0.26, 0.75],[0.26, 0.75], [0.29, 0.72],[0.31, 0.73],[0.31, 0.73]])
y= np.array([[0.26, 0.27], [0.28, 0.36], [0.21, 0.35], [0.19, 0.45], [0.18, 0.48], [0.33, 0.36], [0.36, 0.49], [0.30, 0.49], [0.22, ... |
import numpy as np
import scipy
import torch
from scipy.spatial import Delaunay
import torch
from ..ops.roiaware_pool3d import roiaware_pool3d_utils
from . import common_utils
def points_in_box_3d_label(points, boxes, slack=1.0, shift=np.array([[0,0,0,0,0,0]])):
'''
:param points: N, 3
:param boxes: M, 8
... |
<reponame>francisbui/SDEV300Lab5<filename>file_io.py<gh_stars>0
"""
* <NAME>
* SDEV 300
* Professor <NAME>
* Lab 5 - Data Analysis Application (with File I-O and Exceptions)
* Sept 18, 2020
* The purpose of this program is to import various csv files with try and except
* function. After the file has been import... |
import pdb
import pickle
import pandas as pd
import os
import numpy as np
import sys
import matplotlib.pyplot as plt
from scipy.sparse import data
from utils_predict import spectra_test, dataset_len, sample_ids
import torch
import torch.nn as nn
import torch.nn.functional as F
device = torch.device("cpu")
... |
<gh_stars>0
"""Unit tests for enrich class.
See Also:
:class:`..enrich`:
Author: <NAME> <<EMAIL>>
"""
import os
import sys
base_dir = os.path.dirname(__file__)
data_dir = os.path.join(base_dir, "resources")
sys.path.extend([os.path.join(base_dir, '../..')])
from sklearn.utils.validation import check_array
from... |
import os
import csv
import pickle
import numpy as np
from scipy.signal import butter, lfilter, savgol_filter, savgol_coeffs, filtfilt
import matplotlib.pylab as plt
from random import shuffle
import datetime
import json
import load
import visualization
from scipy import signal
from processing import resample, savitzk... |
<reponame>Cocopyth/MscThesis<filename>amftrack/pipeline/scripts/image_processing/mask_skel.py
from path import path_code_dir
import sys
sys.path.insert(0, path_code_dir)
from amftrack.util import get_dates_datetime, get_dirname
import pandas as pd
import ast
from scipy import sparse
import scipy.io as sio
fro... |
"""
Generates a ListTomoParticle object from a input STAR file with vesicles segmentations
Input: - STAR file for pairing STAR files with vesicles segmentations
Output: - A STAR file with a ListTomoParticles object pickled
"""
__author__ = '<NAME>'
# ################ Package import
import vtk
import... |
<filename>simple/hex/voltage/volt.py
from fractions import Fraction
# compute voltage drops across empty hex board, with 1.0 on top and 0.0 on bottom
# remove connection between adjacent cells in first and last row, as
# these are not in any minimal winning path
# notice that node with biggest voltage drop is 2,2, no... |
<filename>code/matusplotlib.py
import numpy as np
import pylab as plt
import matplotlib as mpl
from scipy.stats import scoreatpercentile as sap
from scipy.special import erfinv
from scipy import stats
import pickle,os
from sys import stdout
from PIL import ImageFont, ImageDraw, Image
__all__ = ['getColors','errorbar'... |
from typing import Iterable
import torch
import scipy.stats
def eval_on_path(model, path, X_test, y_test, *, score_function=None):
if score_function is None:
score_fun = model.score
else:
assert callable(score_function)
def score_fun(X_test, y_test):
return score_function(... |
from manim_imports_ext import *
import scipy.stats
CASE_DATA = [
9,
15,
30,
40,
56,
66,
84,
102,
131,
159,
173,
186,
190,
221,
248,
278,
330,
354,
382,
461,
481,
526,
587,
608,
697,
781,
896,
999,
1124,... |
#!/usr/bin/env python3
import numpy as np
from scipy import signal
from scipy import io
from numpy import random
import math
import matx_common
from typing import Dict, List
class mvdr_beamformer:
def __init__(self, dtype: str, size: List[int]):
self.size = size
self.dtype = dtype
np.rand... |
import json
import numpy as np
import plotly
import plotly.graph_objects as go
import scipy.misc as sc
import sympy as sp
from sympy.parsing.sympy_parser import parse_expr
def result(func):
def wrapper(params):
f_str, var_str = params["function"].split(",")
var = sp.symbols(var_str)
f_pa... |
from utils.tf_utils import create_padding_mask, create_look_ahead_mask
import collections
import tensorflow as tf
from python_speech_features import logfbank
import scipy.io.wavfile as wav
import numpy as np
def parse_wav(file):
rate, sig = wav.read(file)
fbank_feat = logfbank(sig, rate)
return fbank_feat... |
<filename>src/svmbff.py
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# Author <NAME>
# E-mail <EMAIL>
# License MIT
# Created 13/10/2016
# Updated 20/01/2017
# Version 1.0.0
#
"""
Description of svmbff.py
======================
bextract -mfcc -zcrs -ctd -rlf -flx -ws 1024 -as 898 -sv -fe filename.mf -w o... |
import matplotlib
matplotlib.use('tkagg')
import matplotlib.pyplot as plt
import sys
import os
import pickle
import seaborn as sns
import scipy.stats as ss
import numpy as np
import core_compute as cc
import core_plot as cp
from scipy.integrate import simps, cumtrapz
def deb_Cp(theta, T):
T = np.ar... |
# -*- coding: UTF-8 -*-
# From <NAME>'s iSRb tool
from warnings import warn
import numpy as np
#from skimage.measure import profile_line # toolbox implements its own line profle measurement routine
from scipy.optimize import curve_fit, minimize
from scipy.signal import find_peaks, peak_widths
from time import time
... |
<reponame>rn5l/rsc18
# -*- coding: utf-8 -*-
"""
Created on 09.06.2018
Based on https://github.com/dawenl/vae_cf/blob/master/VAE_ML20M_WWW2018.ipynb
@author: malte
"""
import numpy as np
import pandas as pd
import tensorflow as tf
from scipy import sparse
import bottleneck as bn
from algorithms.ae.helper.d... |
<gh_stars>10-100
from scipy.optimize import linear_sum_assignment
import torch
from torch import nn
import numpy as np
def linear_assignment(distance_mat, row_counts=None, col_counts=None):
batch_ind = []
row_ind = []
col_ind = []
for i in range(distance_mat.shape[0]):
dmat = distance_mat[i, :... |
<reponame>NREL/flasc<gh_stars>1-10
# Copyright 2021 NREL
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... |
<gh_stars>10-100
import numpy as np
import pylab
from scipy import sparse
import regreg.api as R
Y = np.random.standard_normal(500); Y[100:150] += 7; Y[250:300] += 14
loss = R.signal_approximator(Y)
sparsity = R.l1norm(len(Y), lagrange=0.8)
D = (np.identity(500) + np.diag([-1]*499,k=1))[:-1]
D = sparse.csr_matrix(D)... |
#!/usr/bin/env python
from scipy.sparse import coo_matrix
class Matrix:
"""A sparse matrix class (indexed from zero). Replace with NumPy arrays."""
def __init__(self, matrix=None, size=None):
"""Size is a tuple (m,n) representing m rows and n columns."""
if matrix is None:
self.dat... |
from detectron2.utils.logger import setup_logger
setup_logger()
import cv2, os, re
import numpy as np
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from densepose.config import add_densepose_config
from densepose.vis.extractor import DensePoseResultExtractor
import torch
import a... |
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.gridspec import GridSpec
from time import time
import os
from menpofit.base import build_grid
from menpofit.fitter import raise_costs_warning
from menpofit.result impo... |
from os import path as osp
import h5py
import numpy as np
from scipy.interpolate import interp1d
from scipy.spatial.transform import Rotation
from utils.logging import logging
from utils.math_utils import unwrap_rpy, wrap_rpy
class DataIO:
def __init__(self):
# raw dataset - ts in us
self.ts_all ... |
<reponame>thatguynoah/Bio-IA<filename>optimizedTTest.py
# this file is intended to be an optimized/completed version of the origininal t-test sim done in jupyter notebooks.
# This is being done for a few reasons:
# 1. code is messy in the notebook - by compiling here I can be more clean
# 2. unoptimized - This is ... |
<gh_stars>10-100
"""Raster interpolation functions
Depends on GDAL/OGR
"""
# Author: <NAME>
import numpy as np
from osgeo import gdal
from osgeo import gdal_array
from scipy.interpolate import RegularGridInterpolator
def raster_details(input_raster):
'''
Read GDAL supported raster format with elevation dat... |
<reponame>1minus1/porespy<gh_stars>0
import porespy as ps
import numpy as np
import scipy as sp
import pytest
import scipy.ndimage as spim
import matplotlib.pyplot as plt
plt.close('all')
class GeneratorTest():
def setup_class(self):
np.random.seed(10)
def test_cylinders(self):
X = 100
... |
# Remarks: This file is designed for copy-paste directly on Python interpreter shell.
# Configure project parameters here.
def apply_params():
# Choose default function for this alias (Useful when using different platform).
load_audio_from_system_input=load_audio_from_linux_system_input
## Initialization
### Python... |
<filename>shared.py
import cv2
import random
import GPyOpt as gy
#import noise as ns
import tensorflow as tf
#tf.get_logger().setLevel('ERROR')
#print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
import noise as ns
import numpy as np
import matplotlib as mpl
import matplotlib.pypl... |
<gh_stars>0
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# *****************************************************************************/
# * Authors: <NAME>, <NAME>
# *****************************************************************************/
import os, datetime, pprint, csv, json
import pickle
import traceb... |
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import griddata
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.ticker import LinearLocator, FormatStrFormatter
from matplotlib import cm
def weight_function(x, y, z0 = 100.0, k = 0.02):
"""Функция для генерации отклонения веса при ... |
<gh_stars>0
#This script will extract the data from the casaxp (.vms) exported file format for the ixps maps.
#The data is stored in a list of numpy arrays, that can be manipulated however. Right now it applies a median filter
#and then plots only the energies that correspond to the copper peak (552-554 eV).
#The prog... |
<reponame>bende937/pychan3d<gh_stars>1-10
import numpy as np
from scipy.sparse import coo_matrix, dok_matrix, csgraph, linalg
from scipy.spatial.distance import cdist
from collections import Counter
import pickle
import logging
logging.basicConfig(filename='log_network', format='%(asctime)s: %(message)s', level=l... |
# Script which downloads and preprocesses a collection of UCI datasets.
# Flag --dir specifies the relative path at which the script will work.
# The script creates a directory called "data" under --dir and downloads
# the UCI data there. It then preprocesses the data to a format ready
# to be consumed by the models. B... |
import numpy as np
import math
from scipy.fftpack import dct
from filter import ThresholdFilter
from window import Windowing
class FeatureExtractor:
"""
This class transforms sound files to feature vectors
Those feature vectors could either be one dimensional or
multi dimensional.
"""
... |
<reponame>gavinkalika/w3-learning-ml
import numpy
from scipy import stats
def calculate_mean(data_set):
"""
This method calculates mean
:type data_set: int[]
:rtype: None
"""
x = numpy.mean(data_set) # calculate mean
print(x)
def calculate_median(data_set):
"""
This method cal... |
import numpy as np
from scipy.sparse import lil_matrix
from scipy.optimize import least_squares, minimize
from scipy.spatial.transform import Rotation as R
import time
import matplotlib.pyplot as plt
import argparse
f, cx, cy = 1000, 320, 240
msg = """This script is a Python file related to global bundle adjustment. ... |
import numpy as np
import scipy as sc
import matplotlib.pyplot as plt
from diffusion_1D import *
Nz = 50#number of space steps
diffusivity = 1.
Nt = 20 #number of time steps printed
timeMax = 20.
zmax = 0.
zmin = -10. #depth after wich we don't calculate
BC_0 = {'type':'Dir', 'T0':1., 'position':0}
BC_1 = {'type... |
<reponame>dqnykamp/sympy
from sympy.matrices.expressions import MatrixSymbol
from sympy.matrices.expressions.diagonal import DiagonalMatrix, DiagonalOf
from sympy import Symbol, ask, Q
n = Symbol('n')
x = MatrixSymbol('x', n, 1)
X = MatrixSymbol('X', n, n)
D = DiagonalMatrix(x)
d = DiagonalOf(X)
def test_DiagonalMatr... |
from tkinter import * # Importing the GUI library
from sympy import * # Importing the graphing library
from sympy.solvers import solve
from sympy import Symbol
canvas = Tk() # Creates a background window
canvas.geometry("1424x840+0+0")
canvas.title("Solve any polynomial equati... |
<reponame>incredible-masters-students/smart-key-box<gh_stars>0
import statistics
from time import sleep
from argparse import ArgumentParser
from gpiozero import Button, LED
from post_message import SlackMessage
from read_settings import SMART_KEY_BOX_SETTINGS, PROJ_DIR
from create_logger import create_logger
from get... |
"""utils.py
Various utility scripts that can be used
through the entire package
"""
import random
import pandas as pd
import numpy as np
from sklearn.preprocessing import MinMaxScaler, MaxAbsScaler
from scipy import stats
def verify_name_in_series(df, y_name):
"""
Verify that a column name is in the dataframe... |
#!/usr/bin/env python
# coding: utf-8
# ## Calculate distance between means/medoids of mutation groupings
#
# Our goal is to find an unsupervised way of calculating distance/similarity between our mutation groupings ("none"/"one"/"both") which isn't affected by sample size, to the degree that differentially expressed... |
<reponame>DEVX1/NAOrapp-Pythonlib
#!/usr/bin/env python
# -*- encode: utf-8 -*-
#Copyright 2015 RAPP
#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-... |
<reponame>ferrocactus/cellar<gh_stars>1-10
import unittest
import numpy as np
from numpy.testing import (assert_almost_equal, assert_array_almost_equal,
assert_array_equal, assert_equal)
from scipy.stats import ttest_ind
from statsmodels.stats.multitest import multipletests
from src.units._... |
from scipy.io import wavfile
import noisereduce as nr
import numpy as np
from noisereduce.utils import int16_to_float32, float32_to_int16
from librosa.feature import rms
import argparse
#
# Find longest section of audio where the energy is below mean - thresh * stddev
#
def find_some_background_noise(rate, y):
th... |
#!/usr/bin/env python3
# easy console set up
import pdb
import numpy as np
import sympy as sy
import scipy as sp
sy.init_printing(use_latex=True,forecolor="White")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.