text string |
|---|
<reponame>jiafeng5513/relaynet_pytorch
import numpy as np
import pylab as pl
from scipy import interpolate
import matplotlib.pyplot as plt
x = np.linspace(0, 2*np.pi+np.pi/4, 10)
y = np.sin(x)
x_new = np.linspace(0, 2*np.pi+np.pi/4, 100)
#f_linear = interpolate.interp1d(x, y)
tck = interpolate.splrep(x, y) # 原始点(xi... |
<filename>ir_axioms/modules/similarity.py
from abc import ABC, abstractmethod
from functools import lru_cache, cached_property
from itertools import product, combinations
from statistics import mean
from typing import (
final, Final, Iterable, Dict, Collection, Optional, Tuple, Sequence
)
from nltk.corpus import w... |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 29 23:25:47 2015
Data incubator challenge question
"predicting power usage for new home owners" version 1.0
based on 2010 usage and weather data in Chicago
@author: <NAME>
"""
import pandas as pd
import numpy as np
import requests
import json
import calendar
from ggplot... |
r"""
.. autofunction:: openpnm.models.physics.diffusive_conductance.ordinary_diffusion
.. autofunction:: openpnm.models.physics.diffusive_conductance.taylor_aris_diffusion
.. autofunction:: openpnm.models.physics.diffusive_conductance.generic_conductance
"""
import scipy as _sp
def ordinary_diffusion(target,
... |
<filename>app/caffeine.py<gh_stars>0
import logging
import os
import tqdm
import codecs
import h5py
from scipy.sparse import coo_matrix, csr_matrix
from implicit.als import AlternatingLeastSquares
import numpy as np
log = logging.getLogger("implicit")
def calculate_similar_event(path, output_filename):
model =... |
import matplotlib.collections
import matplotlib.pyplot as plt
import matplotlib.tri as tri
import scipy.sparse as sp
import numpy as np
def plot_lattice(L, ax=None, dot='.'):
"""Plot a 2D or 3D representation of the lattice on the given
axis, or create one if none is given.
Parameters
----------
... |
<filename>RSNA Pneumonia Detection Challenge/Retina_net model.py
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import pandas as pd
import numpy as np
import scipy.misc
import pydicom
import glob
import sys
import os
import pandas as pd
import base64
from IPython.display import HTML
# In[ ]:
from scipy.ndimag... |
<filename>draftplot_PWx.py
from scipy.integrate import odeint
import os
import matplotlib as mpl
import numpy as np
import matplotlib.pyplot as plt
import sys
hstep = .01
sstep = .01
hmin = 0.
hmax = 2.
smin = 0.
smax = 3.
rmin = .01
rmax = 3.
rstep = .1
rr = np.arange(rmin,rmax+rstep,rstep)
LL3 = 1.2
LL4 = 0.22
... |
"""Adapt plot functions with seaborn to get more beautiful plots."""
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import os
import collections
import itertools
import numpy as np
import scipy.stats a... |
<reponame>rafaelrojasmiliani/gsplines
"""
Test the cost function from the problem 1010
"""
import numpy as np
import sympy as sp
import quadpy
import unittest
from opttrj.costnonlinear import cCostNonLinear
from itertools import tee
class cMyCost(cCostNonLinear):
def runningCost(self, _t, _tauv, _u):
... |
#!usr/bin/python 3.6
#-*-coding:utf-8-*-
'''
@file: shrinkage.py, shrinkage clustering
@Author: <NAME> (<EMAIL>)
@Date: 06/24/2020
@Paper reference: Shrinkage Clustering: A fast and \
size-constrained clustering algorithm for biomedical applications
'''
import os
import sys
path = os.path.dirname(os.path.abspath... |
import os
import numpy as np
import scipy.sparse
import scipy.optimize
class Softmax:
def __init__(self):
self.path='G:\MACHINE_LEARNING_ALGORITHMS\Logistic_and_Stochastic_Regression'### insert your path here!
self.C1=0.0001 #weight decay (regularization parameter)
... |
import tkinter.filedialog
import tkinter.simpledialog
from tkinter import messagebox
import numpy as np
import matplotlib.pyplot as plt
import wfdb
import peakutils
from scipy import signal
import pandas as pd
# To display any physiological signal from physionet, a dat-File needs to have a complementary hea-... |
<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
print "HANDLING IMPORTS..."
import os
import time
import operator
import numpy as np
import matplotlib.pyplot as plt
import cv2
from scipy import interpolate
from sklearn.utils import shuffle
from sklearn.metrics import confusion_matrix
import itertools... |
# Written by <NAME> on July 1, 2016
# Updated October 2017
# ## Input Data and Parameters
from Fit_XRD_Input import *
# ## Outline
# - Import data
# - Specify 2theta range
# - Identify phases
# - Set starting parameter values for a (and c)
# - Identify peaks present in 2theta range for given a (and c)
# - Get star... |
<reponame>TheSchilk/PmodADC
import scipy.signal as sps
import numpy as np
def resample_audio(audio, fs_from, fs_to):
number_of_samples = round(len(audio) * float(fs_to) / fs_from)
audio = sps.resample(audio, number_of_samples)
# Ensure re-sampling did not create samples outside of [-1,1]:
max_amplitu... |
"""
Get CAP data and MRIQ of the current sample.
Only need to be ran once for tidying things up, but keep it here for book keeping.
"""
import json
import os
import numpy as np
import pandas as pd
from scipy import io
from nkicap import get_project_path, read_tsv
SOURCE_MAT = "sourcedata/CAP_results_organized_toHaoT... |
<filename>generate_skeleton_try1-12.py
from __future__ import division
from __future__ import print_function
import argparse
from datetime import datetime
import json
import os
import numpy as np
import tensorflow as tf
import scipy.io as sio
from wavenet_skeleton import WaveNetModel
SAMPLES = 16000
LOGDIR = './log... |
#!/usr/bin/python
from fg_constants import *
import cross_validation as cv
import matplotlib.pyplot as plt
import numpy as np
from scipy.linalg import svd
def load_regressor(name, num):
lags = cv.REGRESSORS[name](num)
return lags[:, :(lags.shape[1]/3)]
def trunc_svd(x, d):
u, s, _ = svd(x, full_matric... |
import torch
from torch.utils.data.dataset import Dataset
from torchvision import transforms
import torchvision.transforms.functional as TF
import numpy as np
from PIL import Image, ImageFilter, ImageDraw
import pandas as pd
import matplotlib as mpl
mpl.use('Agg')
from matplotlib import cm
import matplotlib.pyplot a... |
<filename>GPy/testing/link_function_tests.py
import numpy as np
import scipy
from scipy.special import cbrt
from GPy.models import GradientChecker
_lim_val = np.finfo(np.float64).max
_lim_val_exp = np.log(_lim_val)
_lim_val_square = np.sqrt(_lim_val)
_lim_val_cube = cbrt(_lim_val)
from GPy.likelihoods.link_functions im... |
#A very simple poblation simulator made to study what happen when a society reaches the food-consumption limit.
#Made by ElBarto27. Feel free to reproduce this script giving the correspondent credits.
from scipy.stats import norm
import random
#Opening and clearing the file where the code will write how many peop... |
from __future__ import division
if 1:
# deal with old files, forcing to numpy
import tables.flavor
tables.flavor.restrict_flavors(keep=['numpy'])
import os, sys, math
import warnings
import pkg_resources
from tvtk.api import tvtk
from tvtk.common import configure_input_data
import numpy
import numpy as n... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
MCMC-estimation of status transition rates from IUCN record
Created on Mon Oct 28 14:43:44 2019
@author: <NAME> (<EMAIL>)
"""
import numpy as np
np.set_printoptions(suppress=True)
import pandas as pd
import os,sys
import datetime
from scipy.optimize import curve_fit
... |
<gh_stars>1-10
import pyaudio
import time
import numpy as np
from matplotlib import pyplot as plt
import scipy.signal as signal
print("Start run")
CHANNELS = 1
RATE = 44000
p = pyaudio.PyAudio()
fulldata = np.array([])
dry_data = np.array([])
def main():
stream = p.open(format=pyaudio.paFloat32,
... |
<reponame>henrywu2019/mlprodict
"""
@file
@brief Direct calls to libraries :epkg:`BLAS` and :epkg:`LAPACK`.
"""
import numpy
from scipy.linalg.blas import sgemm, dgemm # pylint: disable=E0611
from .direct_blas_lapack import ( # pylint: disable=E0401,E0611
dgemm_dot, sgemm_dot)
def pygemm(transA, transB, M, N, K... |
<reponame>IgiArdiyanto/control-engineering-with-python
# Third-Party Libraries
import numpy as np
import scipy.integrate as sci
import matplotlib.pyplot as plt
import matplotlib.animation as ani
def solve(**kwargs):
kwargs = kwargs.copy()
kwargs["dense_output"] = True
y0s = kwargs["y0s"]
del kwargs["y... |
<filename>Initial Submission (20200803) Version/Pre-Print (20200624) Version/Analysis Code/CovidDataSmoothing.py
import json
import subprocess
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from shutil import copy
from scipy import interpolate
from statsmodels.tsa.seasonal import STL
def impo... |
# -*- coding: utf-8 -*-
#
"""
Solve a linear equation system with the kinetic energy operator.
"""
import numerical_methods as nm
import sys
from scipy.sparse.linalg import LinearOperator
import time
import numpy
import cmath
import matplotlib.pyplot as pp
from matplotlib import rc
rc("text", usetex=True)
rc("font", ... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 12 19:42:57 2018
@author: kanav
"""
import logging
from pyscf import gto, scf, ao2mo
from pyscf.lib import param
from scipy import linalg as scila
from pyscf.lib import logger as pylogger
from qiskit.chemistry import QiskitChemistryError
# from qis... |
"""Evaluate exported frame-level probabilities."""
from __future__ import division
import argparse
import csv
import glob
import numpy as np
import os
from scipy.special import softmax
import sys
CSV_SUFFIX = '*.csv'
np.set_printoptions(threshold=sys.maxsize)
def import_probs_and_labels(args):
"""Import probabili... |
import pandas as pd
import json
# plots
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.stats as stats
# Load and read json data
df = pd.read_json('full_info.json', lines=True)
user_name, commits, followers, repo, stars, forks, organizations, issues, contributions = \
[], [], [], [], [], [], [], [... |
import numpy as np
import scipy
import scipy.special
import scipy.interpolate
import pickle
import sklearn
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import MySQLdb
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
import sqla... |
# coding: utf-8
# # Stock Choice Decision Analysis
# Code written and commentated by <NAME>
# ### Load Relevant Packages
# In[1]:
from pandas_datareader import data
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from datetime import datetime
import numpy as np
import math
from scipy.spec... |
import os
import mrcfile
import numpy as np
import pandas as pd
import networkx as nx
from igraph import Graph
from scipy import ndimage as ndi
from skimage import transform, measure
import tkinter as tk
from tkinter import ttk
import tkinter.filedialog
import matplotlib
from matplotlib import cm
import matplotlib.py... |
<filename>UforFunction.py
from sympy import *
from sympy.abc import *
import functions as func
from decimal import *
def findAbsFuncU(function, U, variable, means, roundornot=True):
"""
This function is used to find the absolut compound U, as well as the values of U of temp variables
:param functio... |
import scipy.io
from matplotlib import pyplot as plt
import numpy as np
def load_imu_data():
dt = 0.01
gyro_data = scipy.io.loadmat('./source/11.ARS/ArsGyro.mat')
acce_data = scipy.io.loadmat('./source/11.ARS/ArsAccel.mat')
ts = np.arange(len(gyro_data['wz'])) * dt
gyro = np.concatenate([
... |
<reponame>renatomello/qibo
"""Test methods in `qibo/core/hamiltonians.py`."""
import pytest
import numpy as np
from scipy import sparse
from qibo import hamiltonians, K
from qibo.tests.utils import random_complex
def random_sparse_matrix(n, sparse_type=None):
if K.name in ("qibotf", "tensorflow"):
nonzero... |
import matplotlib.pyplot as plt
import datetime as datetime
import numpy as np
import pandas as pd
import talib
import seaborn as sns
from time import time
from sklearn import preprocessing
from pandas.plotting import register_matplotlib_converters
from .factorize import FactorManagement
import scipy.stats as stats
imp... |
<reponame>Tamlyn78/geo
from os import listdir, makedirs
from os.path import abspath, basename, dirname, isdir, join
import re
import csv
import numpy as np
import pandas as pd
from scipy import stats, ndimage, signal
import matplotlib.pyplot as plt
from matplotlib import cm, rc
from mpl_toolkits.axes_grid1 import make... |
import sys
sys.path.insert(0, '..')
sys.path.insert(0, '../EnergyCost')
from qpthlocal.qp import QPFunction
from qpthlocal.qp import QPSolvers
from qpthlocal.qp import make_gurobi_model
from ICON import *
from sgd_learner import *
from sklearn.metrics import mean_squared_error as mse
from collections import defaultdict... |
<filename>notebooks/generative.py
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import os
import pdb
from tqdm import tqdm
import argparse
import pandas as pd
import sys
BASE_DIR=os.path.dirname(os.getcwd())
sys.path.append(BASE_DIR)
sys.path.append('/home/tam63/geometric-js')
import tor... |
<reponame>Mayu14/2D_comp_viscos
# coding: utf-8
from math import sqrt
from scipy import interpolate
from scipy.spatial import Delaunay
import numpy as np
from numpy.linalg import norm
from naca_4digit_test import Naca_4_digit, Naca_5_digit
from joukowski_wing import joukowski_wing_complex, karman_trefftz_wing_complex
i... |
<filename>src/iceberg_penguins/search/data_processing/m_im_util.py
"""
Utility scripts for images
Author: <NAME>
License: MIT
Copyright: 2018-2019
"""
import os
import numpy as np
from PIL import Image
from scipy import misc
#AT this point, I don't even know what is this file about. junk codes assembly.
def list_to_fil... |
#!/usr/bin/python
import petsc4py
import slepc4py
import sys
petsc4py.init(sys.argv)
slepc4py.init(sys.argv)
from petsc4py import PETSc
from slepc4py import SLEPc
Print = PETSc.Sys.Print
# from MatrixOperations import *
from dolfin import *
import numpy as np
import matplotlib.pylab as plt
import scipy.sparse as sps
... |
#<NAME>
#1001551151
#knn_classify(<training_file>, <test_file>, <k>)
# Importing all needed libraries
import numpy as np
import math
import sys
import random
from scipy import stats
from scipy.spatial import distance
import statistics as s
from statistics import mean, median, mode, stdev
fname = sys.argv[1]
fname1 =... |
<reponame>nataboll/ellipsoids<filename>src/solver.py
from src.data import Data
import numpy as np
from scipy.optimize import minimize
import matplotlib.pyplot as plt
# area of ellipse
# def f(x):
# return np.pi * (x[0] * x[3] - x[1] * x[2]) ** 2
def f(x):
return np.pi * (1 / float(x[0] ** 2 * x[1] ** 2)... |
import time
import numpy as np
from cvxopt import matrix, solvers
from sympy import pprint
solvers.options['show_progress'] = False
solvers.options['maxiters'] = 1
def getSolution(code_gen, x_0, u_0, x_ref, u_ref, params):
A = code_gen.A_mat(x_0[:,0:1], x_0, u_0, params)
b = code_gen.b_mat(x_0[:,0:1], x_0, u_0, para... |
## Add modules that are necessary
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from sympy import *
import matplotlib.pyplot as plt
import operator
from IPython.core.display import display
import torch
from torch.autograd import Variable
import torch.utils.da... |
<filename>function_zoo.py<gh_stars>0
# Librerias
import numpy as np
from numpy import poly1d,polyfit
import matplotlib.pyplot as plt
from sympy import Symbol
import pandas as pd
# Para imprimir en formato LaTex
from sympy.interactive import printing
printing.init_printing(use_latex=True)
def Rachford_Rice_4(z,k,L... |
# -*- coding: utf-8 -*-
# This file is part of the OpenSYMORO project. Please see
# https://github.com/symoro/symoro/blob/master/LICENCE for the licence.
"""
This module of SYMORO package contains function to compute the base
inertial parameters.
"""
import sympy
from sympy import Matrix
from pysymoro.geometry i... |
<reponame>lokijota/datadrivenastronomymooc
import numpy as np
import statistics
import time
from astropy.coordinates import SkyCoord
from astropy import units as u
def crossmatch(cat1, cat2, max_dist):
matches = []
nomatches = []
start = time.perf_counter()
skycat1 = SkyCoord(cat1*u.degree, frame='icrs')
... |
<reponame>NunoEdgarGFlowHub/cvxpy
"""
Copyright 2013 <NAME>
This file is part of CVXPY.
CVXPY is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versio... |
<filename>math_signals/test/test_relation.py
import unittest
import numpy as np
from scipy.integrate import cumulative_trapezoid
from numpy.testing import assert_array_equal
from math_signals.math_relation import Relation
from math_signals.defaults.base_structures import BaseXY
def pre_integr(x, y):
r... |
<filename>data_format_scripts/makeDatasetTxt_4Points_fromCasper.py
import os
from xml.etree import ElementTree
from scipy.spatial import distance as dist
import numpy as np
from time import sleep
import cv2
from PIL import Image, ImageDraw
import colorsys
def order_points(ptsArr):
# pt_a, pt_b: out of the 2 left ... |
from vtk import vtkSplineWidget, vtkLineSource, vtkActor, vtkPolyDataMapper
from numpy import linspace
from math import pi, asin, sqrt, sin
from scipy import interpolate
import numpy as np
# CODE REGIONS:
# 1) Spline computing
# 2) Spline redrawing
# 3) Setters
# 4) Getters
# 5) Coordinates transformation
# 6) Handle... |
"""This script creates the patched dataset"""
import sys
import glob
import json
from tqdm import tqdm
import numpy as np
from PIL import Image
import multiprocessing
from datetime import datetime
from joblib import Parallel, delayed
from scipy.interpolate import interp1d
from scipy.ndimage import generic_filter
from ... |
from sympy import *
#3次曲線と点の距離を陽に書き下すプログラム
X = Symbol("X")
Y = Symbol("Y")
t = Symbol("t")
l_x = Symbol("l_x")
l_y = Symbol("l_y")
a_x = Symbol("a_x")
b_x = Symbol("b_x")
c_x = Symbol("c_x")
d_x = Symbol("d_x")
a_y = Symbol("a_y")
b_y = Symbol("b_y")
c_y = Symbol("c_y")
d_y = Symbol("d_y")
print( expand( (X - (a... |
import numpy as np
from fractions import Fraction
if __name__ == '__main__':
#enter coordinates vectors
Y = np.array([[-420,-330]]).T
X = np.array([[300,0]]).T
# y =mx +c
O = np.ones(X.shape)
A = np.append(X,O,axis=1)
A_t = A.T
A_t_dot_A = A_t.dot(A)
A_t_dot_A_inv = np.linalg.inv(A_t_dot_A)
... |
<reponame>PintarM/AdventOfCode<filename>2020/day13.py
# -*- coding: utf-8 -*-
"""Advent Of Code 2020, Day 13
@author: Matevz
"""
from sympy.ntheory.modular import crt
def get_input(file_name):
"""Process input text file."""
try:
file = open(file_name, 'r')
content = file.read()
except I... |
<reponame>dalakada/TwiCSv2<filename>stats_eddie/SVM.py
# coding: utf-8
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn import svm
from scipy import stats
class SVM1():
def __init__(self,train):
#train the algorithm once
self.train = pd.read_... |
import numpy as np
from scipy.stats import norm
def simulate_gbm(s_0, mu, sigma, n_sims, T, N, random_seed=42, antithetic_var=False):
'''
Function used for simulating stock returns using Geometric Brownian Motion.
Parameters
----------
s_0 : float
Initial stock price
mu : float
... |
<filename>examples/plotting/AdaptiveW_process_SA.py
from sklearn.preprocessing import StandardScaler
import numpy as np
from sklearn.metrics import r2_score
from matplotlib import pyplot as plt
import os
from matplotlib.lines import Line2D
from exp_variant_class import exp_variant#,PCA
from sklearn.decomposition import... |
<reponame>RidleyLeisy/data-science-1
import pandas as pd
import numpy as np
from sklearn.pipeline import Pipeline
import category_encoders as ce
from scipy.spatial.distance import cdist
from sklearn.externals import joblib
from db_helper import DbHelper
cols = ['column_a', 'player', 'all_nba', 'all_star', 'draft_yr... |
#!/usr/bin/python3
import json
import seaborn as sns
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
import matplotlib.colors as colors
from scipy.stats import spearmanr
import pylab
import scipy.cluster.hierarchy as sch
from scipy.stats import pearsonr, friedmanchisqu... |
<reponame>CFARS/TACT
"""
This is the main script to analyze projects without an NDA in place.
Authors: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
Updated: 7/01/2021
Example command line execution:
python TACT.py -in /Users/aearntsen/cfarsMASTER/CFARSPhase3/test/518Tower_Windcube_Filtered_subset.csv -config... |
<filename>tuning.py
import numpy as np
from tqdm import tqdm
import elo
import utils
import random
import plotly.graph_objects as go
from sklearn.metrics import r2_score
from scipy.stats import linregress
import pandas as pd
from predictions import predict_tournament, ROUNDS
ERRORS_START = 4 #after 4 seasons (starts c... |
<reponame>jjhong922/cell2location
from datetime import date
from functools import partial
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pyro
import torch
from pyro import poutine
from pyro.infer.autoguide import AutoNormal, init_to_mean
from scipy.sparse import isspars... |
"""RQ3: Happiness algorithm as impacted by localness"""
import csv
import os
import argparse
import sys
from collections import OrderedDict
import numpy
from scipy.stats import spearmanr
from scipy.stats import wilcoxon
sys.path.append("./utils")
import bots
LOCALNESS_METRICS = ['nday','plurality']
HAPPINESS_EVALU... |
# -*- coding: utf-8 -*
"""信号処理一般関数"""
def gen_chirp(duration, fs=96, **kwargs):
"""Generate chirp signal.
特定の長さのチャープ信号を返します.
Args:
duration (float) : 生成する信号の持続時間 (単位は sec).
fs (int, optional) : 生成する信号のサンプリング周波数
(単位は kHz. デフォルトでは 96kHz)
**kwargs: scipy.signal.chirp 関数に... |
<gh_stars>0
from fractions import Fraction
from dash import html
import numpy as np
from dash import callback_context
from dash.dependencies import Input, Output
from pymatgen.core.structure import Structure
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from pymatgen.util.string import unicodeify_spacegrou... |
import numbers
import os
import sys
import warnings
from typing import List
import numpy as np
import scipy.signal
import scipy.sparse
from scipy.sparse.linalg import cg, LinearOperator
from . import Backend, ComputeDevice
from ._backend_helper import combined_dim
from ._dtype import from_numpy_dtype, to_numpy_dtype,... |
<filename>python/table_bandits.py
import random
import numpy as np
from scipy.stats import bernoulli
# TODO: how best to assign rewards? Should "too soon" of use be penalized? Should max reward be > 1?
# what if something is used twice? Shouldn't this increase reward? for now no extra reward is given
class ContextBa... |
# THIS TAKES AN ALREADY FORMATED DATA TABLE from matlab AND DOES THE REGRESSIONS
# IT ALSO MAKES THE PLOTS
# LAST EDITED 11-29-17
import pandas
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from pylab import *
from pyteomics import mass # can do cool isotope math stuff, not us... |
import os
import cflearn
import platform
import unittest
import numpy as np
from typing import Dict
from cflearn_benchmark import Benchmark
from scipy.sparse import csr_matrix
from cftool.ml import patterns_type
from cftool.ml import Tracker
from cftool.ml import Comparer
from cftool.misc import timestamp
from cfdata... |
import sys, os
import numpy as np
def frac_dimension(z, threshold=0.9):
def pointcount(z,k):
s=np.add.reduceat(np.add.reduceat(
z, np.arange(0, z.shape[0], k), axis=0 ),
np.arange(0, z.shape[1], k), axis=1)
return len(np.where( ( s>0 ) & (s<k*k) )[0])
z=(z<t... |
import os
import json
import argparse
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import pearsonr
from d3pe.metric.score import RC_score, TopK_score, get_policy_mean
BenchmarkFolder = 'benchmarks'
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-... |
<reponame>HuanjunWang/rl_homework<filename>hw2/train_pg_v2.py
import numpy as np
import tensorflow as tf
import gym
import logz
import scipy.signal
import os
import time
from multiprocessing import Process
import shutil
class MyArgument(object):
def __init__(self,
exp_name='vpg',
... |
import os
import random
import argparse
import logging
import json
import time
import multiprocessing as mp
import scipy.sparse as ssp
from tqdm import tqdm
import networkx as nx
import torch
import numpy as np
import dgl
#os.environ["CUDA_VISIBLE_DEVICES"]="1"
def process_files(files, saved_relation2id, add_traspose... |
from __future__ import division
from __future__ import absolute_import
import os
import sys
import shutil
import time
import random
import argparse
import torch
import torch.backends.cudnn as cudnn
import torchvision.datasets as dset
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from torc... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 22 21:22:58 2018
@author: bruce
"""
import pandas as pd
import os
import numpy as np
from scipy import fftpack
from scipy import signal
import matplotlib.pyplot as plt
pkl_file=pd.read_pickle('/Users/bruce/Documents/uOttawa/Projec... |
#!/usr/bin/env python3
import math
import sys
import os
import time
import pybullet as p
from time import sleep
import time
import rospy
import tf
from scipy import signal
import pybullet_data
import rospkg
from transforms3d.quaternions import quat2mat
from wolfgang_pybullet_sim.terrain import Terrain
import numpy as... |
<reponame>anmartinezs/pyseg_system
"""
Curates an output STAR file from Relion to work as input for pyseg.pyorg scripts for microtubules
Input: - STAR file with the particles to curate
- STAR file to pair tomograms used for reconstruction with the one segmented used to pick the particles
Out... |
<reponame>harishbalakrishnan3/Visual-Categorization<filename>docs/_downloads/d6b1e39143e3255799ec607967cb9223/sample.py
"""
A sample python script that illustrates how to use the gcm module.
As a first step, we need to find the model's parameters - c,w,b (we will assume r = 2).
This is done using MLE. After we find the... |
from sympy.crypto.crypto import (alphabet_of_cipher, cycle_list,
encipher_shift, encipher_affine, encipher_substitution,
encipher_vigenere, decipher_vigenere,
bifid5_square, bifid6_square, bifid7_square,
encipher_hill, decipher_hill, encipher_bifid5, encipher_bifid6,
encipher_bifid7, decip... |
#python:
from collections import namedtuple
import numpy as np
from scipy.constants import speed_of_light
import gprMax.input_cmd_funcs as gprmax_cmds
import aux_funcs
Point = namedtuple('Point', ['x', 'y', 'z'])
# ! Simulation model parameters begin
# * Naming parameters
simulation_name = 'Antenna in free spac... |
"""The script makes the sources to have same length,
as well as have the same sampling rate"""
from scipy.io import wavfile
import utilities as utl
# Read the .wav files as numpy arrays
rate1, data1 = wavfile.read("sourceX.wav")
rate2, data2 = wavfile.read("sourceY.wav")
# Plot the sounds as time series data
utl.plot... |
from subprocess import call
import matplotlib.pyplot as plt
import numpy as np
import tqdm
from scipy import ndimage
def callCP(MFA, cp_p, cppipe_p):
"""Call CellProfiler (http://cellprofiler.org/) to perform cell segmentation. CellProfiler segmentation pipeline
is in the spaceM folder with the '.cppipe' exte... |
import os
import subprocess
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import argparse
import seaborn as sns # I love this package!
sns.set_style('white')
import torch
from sklearn.metrics import accuracy_score, roc_auc_score, roc_curve
import scipy.stats as stats
def plot_roc(attr, target... |
<filename>rnmu/test/test_acontrario_point.py
from __future__ import print_function
import matplotlib.pyplot as plt
import matplotlib.colors as plt_colors
import numpy as np
import scipy.io
import scipy.stats
from rnmu.pme.point import Point
from rnmu.pme.line import Line
import rnmu.pme.stats as stats
def plot_soft_p... |
'''
Analyze PHiP-seq read counts matrix to generate enrichment-over-beads-only scores.
Algorithm sketch:
[I] For each bead-only sample:
[1] Bin the read counts across clones into some number of bins (default 50).
[2] For each set of clones c associated with each bin:
For each other sample s:
... |
<filename>Utilities/MS_UT_Stack2Dir.py<gh_stars>0
#! /usr/local/python-2.7.6/bin/python
#
# Copyright (C) 2015 by <NAME>.
#
# Purpose: given a segmentation stack,
# produce a directory of RGB files
import os, sys, re, h5py
import tifffile as tiff
import numpy
from skimage.morphology import label
from scipy.ndimage im... |
# Load libraries
import pandas
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
from sklearn import model_selection # 模型比较和选择包
from sklearn.naive_bayes import GaussianNB
class Bayes_Test():
# 读取样本 数据集
def load_dataset(self):
url = 'Iris.csv'
names = ['sepal-lengt... |
# -*- coding: utf-8 -*-
"""
This file contains ELMKernel classes and all developed methods.
"""
# Python2 support
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from .mltools import *
import numpy as np
import ... |
#!/usr/bin/env python3
import argparse
import binascii
import os
import struct
import sys
import serial
import numpy as np
import scipy.io as sio
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--serial', default='/dev/tty.usbserial-AL00EZAS')
parser.add_argument('-b', '--baudrate', default=3000000,... |
<gh_stars>0
"""
Lagrange's Interpolation class File
"""
import sympy as sp
import numpy as np
from time import process_time as timer
class Neville:
def __init__(self):
self.Q = []
self.time_ellapsed = 0
self.x = np.array([])
self.y = np.array([])
self._x = sp.symbols('x', ... |
from unittest import TestCase
from .. .spectrumuncurver import SpectrumUncurver
from PIL import Image
from scipy.optimize import curve_fit
import numpy as np
from matplotlib import pyplot as plt
class TestSpectrumProcessor(TestCase):
def setUp(self) -> None:
self.processor = SpectrumUncurver()
def te... |
"""
This module contains a list of common imports
Useful to rapidly start a Notebook without writing all imports manually.
It will also set up the main logging.Logger
## Usage
```python
from emutils.imports import *
```
## Imports
- Python Standard Modules: os, sys, time, platform, gc, math, random, collections, it... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
__author__ = '<NAME>, MD'
__email__ = '<EMAIL>'
__version__ = '1.1.0'
from argparse import ArgumentParser
from operator import itemgetter
from random import shuffle
from scipy.sparse import lil_matrix
from time import sleep, time
from timeit import default_timer as timer... |
def stimulus_create(type, wl, va, ratio):
# STIMULUS_CREATE generates a 2D stimulus vector for phototaxis experiments of desired type and resolution
# Inputs:
# type - type of stimulus, e.g. 'bar'/'dog'/'square'/'log' (see below for full list)
# wl - "width" or "wavelength" of pattern in degre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.