text string |
|---|
from __future__ import absolute_import, print_function
import numpy as np
import healpy as hp
from copy import deepcopy
from .skymodel import SkyModel
from .instrumentmodel import InstrumentModel
from scipy import stats, linalg
import logging
from collections.abc import Iterable
class MapLike(object) :
"""Map-bas... |
<reponame>kusterlab/MasterSpectrum<gh_stars>0
import csv
from statistics import median
import os
from pyteomics import mzid
from mgf_annotation.util import parse_scan_id
class Fragment(object):
def __init__(self, name, indice, charge, mz, error, scanid):
self.name = name
self.indice = indice
... |
<gh_stars>1-10
import numpy as np
from matplotlib import pyplot as plt
import sympy as sp
from scipy.integrate import solve_ivp,cumtrapz
from scipy.optimize import curve_fit
from scipy.stats import expon,lognorm
from ipywidgets import interact, interactive_output, HBox, VBox, IntSlider, Dropdown, RadioButtons, fixed, H... |
"""
:Authors: - Iason
"""
import numpy
import math
from scipy.stats import beta
from collections import defaultdict
import logging
class SliceVariable(object):
def __init__(self, slice_variables={}, conditions={}, a=0.1, b=1):
self.slice_variables = defaultdict(None, slice_variables)
self.condit... |
<gh_stars>0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 17 17:37:12 2017
@author: <NAME>
"""
import numpy as np
import scipy.io
from utils import plot_ODI
from utils import plot_fr_vs_depth
from utils import plot_ODI_CDF
from utils import plot_ODI_PDF
from utils import plot_fr
fro... |
<filename>MHD/FEniCS/MaxwellClass/FullMaxwell.py
from dolfin import *
from numpy import *
from block import *
from block.iterative import *
from block.algebraic.trilinos import *
import scipy as Sci
#import scipy.linalg
from math import pi,sin,cos,sqrt
import scipy.sparse as sps
import scipy.io as save
import scipy
imp... |
import pandas as pd
import numpy as np
from corsempy.model import Model
from scipy.optimize import minimize
class Optimizer:
"""
The optimizer class gets object of class Model and an arbitrary starting point
"""
def __init__(self, md: Model, start_pt: float):
self.md = md
self.start_pt... |
<gh_stars>1-10
"""
This is our script to post process predictions generated by our classifier on images, as well as any other data that needs post-processing.
Further documentation found in each function.
-<NAME> / Dark Element
"""
import sys
import numpy as np
from scipy.sparse import csr_matrix, eye
from scipy.spar... |
<reponame>dimnikolos/algebPy<gh_stars>1-10
from sympy import *
x = symbols('x')
pointsList = [[(4,10),(7,17.5),(12,30)],
[(5,11),(7.5,16),(9,19)],
[(2,7),(3,9),(10,23)],
[(2,6),(4,3),(6,2)],
[(2,1),(5,2.5),(0.5,0.25)],
[(0.2,2.4),(6,14),(10,22)],
... |
<filename>examples/script/get_spearman_qc2.py
import argparse
import itertools
from scipy import stats
if __name__ == '__main__':
ground_truth_loss = [
1.247361211,
1.261452215,
1.255187244,
1.172269599,
1.286044317,
1.196596656,
1.272719775,
1.22119... |
"""Single graphs."""
import functools
import os
from typing import Any, Mapping, NamedTuple, Optional
import numpy as np
import scipy.sparse as sp
import wget
from gud.data.path import data_dir
from gud.data.registry import Registry
single_graphs = Registry("single_graphs")
class GraphData(NamedTuple):
adjacen... |
<gh_stars>10-100
from collections import namedtuple
import numpy as np
from os.path import join, dirname
import pandas as pd
from scipy.interpolate import splrep, splev
from scipy.stats import norm
from ...util import ResError
_P = namedtuple('PowerCurve', 'ws cf')
_synthetic_power_curve_data = None
def synthetic_p... |
from fractions import Fraction
from math import log10
def expansions(limit):
last = Fraction(3, 2)
for _ in range(limit):
yield last
last = Fraction(1) + Fraction(1, last + 1)
def n_digits(n):
return 1 + int(log10(n))
def more(f: Fraction):
return n_digits(f.numerator) > n_digits(f... |
"""Nibabel-based interfaces to eventually upstream to NiWorkflows."""
from nipype.interfaces.base import (
traits,
TraitedSpec,
BaseInterfaceInputSpec,
File,
SimpleInterface,
)
class _BinaryDilationInputSpec(BaseInterfaceInputSpec):
in_file = File(exists=True, mandatory=True, desc="binary file... |
import sys # We need sys so that we can pass argv to QApplication
from pathlib import Path
from dataclasses import dataclass
import numpy as np
from PyQt5 import QtWidgets, QtCore, QtGui, uic
import pyqtgraph as pg
import easyqc.qt
COLOR_PLOTS = (pg.mkColor((31, 119, 180)),)
class EasyQC(QtWidgets.QMainWindow):
... |
<reponame>wdeshazer/gt3
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import UnivariateSpline
from imp_rad import ImpRad
import sys
def calc_Lz_gtedge(T_ev_val):
if T_ev_val < 3.0:
T_ev_val = 3.0
if T_ev_val > 10000:
T_ev_val = 10000
... |
import os
import numpy as np
import librosa
from glob import glob
from multiprocessing import Pool
from tqdm import tqdm
def even_split(a, n):
"""split array `a` into `n` seperate evenly sized chunks"""
n = min(n, len(a)) # if less elements in array than chunks to output, change chunks to array length
k, m... |
<filename>responsibleai/responsibleai/databalanceanalysis/distribution_balance_measures.py
# Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
from typing import Callable, Dict, List
import numpy as np
import pandas as pd
import scipy
from responsibleai.databalanceanalysis.balance_measures import... |
<reponame>AmurG/SPFlow
import numpy as np
from spn.structure.prometheus.data import *
from scipy.stats import multivariate_normal as mn
#Ignore this, only useful if you wish to train parameters via scipy
globalarr = []
#Type of node
def convert(tag):
holder = ['PRD', 'SUM', 'BINNODE']
return holder[tag]
d... |
<filename>examples/MorrisLecar.py
# file for comparing to CGL. implement adjoint methods in Wilson 2020
# https://stackoverflow.com/questions/49306092/...
#parsing-a-symbolic-expression-that-includes-user-defined-functions-in-sympy
# TODO: note heterogeneous terms in right-hand sides are hard-coded.
"""
The logical ... |
<gh_stars>0
"""Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: <NAME>,
# <NAME>
# <NAME>
# <NAME>
# <NAME>
# License: BSD 3 clause
import inspect
import pkgutil
import warnings
import scipy as sp
from functools import wraps
try:
# Python 2
from urllib2 import ur... |
<filename>Scripts/ensembles_temp_2006_2080.py
"""
*Script gathers minimum temperatures and plots anomalies over USA for selected dates in future LENS*
"""
import numpy as np
from netCDF4 import Dataset
import matplotlib.pyplot as plt
from scipy.stats import nanmean
import control_temps_climatologies as C
from mpl_toolk... |
"""
Copyright (c) 2017, <NAME> .All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the follow... |
<filename>tmp/fixing_bad_bos_suggestions.py
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 31 12:36:56 2017
@author: kcarnold
"""
from suggestion import suggestion_generator, lang_model
from suggestion.paths import paths
import numpy as np
from scipy.misc import logsumexp
#%%
clizer = suggestion_generator.clizer
n_c... |
<reponame>wfBranch/evoMPS
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 22 09:29:41 2012
@author: ash
A demonstration of non-uniform dynamics on an infinite chain.
HOW TO USE:
1. Run the heisenberg_af_uniform script separately to obtain a uniform
ground state (setting D as desired).
2. Set N (size of... |
##########################################################################################
#
# Copyright (c) 2017 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO project, an application which
# automatically generates Feynman diagrams and matrix elements for arbi... |
<reponame>omyllymaki/shifting-peaks
import itertools
from typing import Tuple
import numpy as np
from scipy.optimize import nnls
import os
import sys
parent_dir_name = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(parent_dir_name)
from solvers.gn_solver import GNSolver
from solvers.gri... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of pyunicorn.
# Copyright (C) 2008--2022 <NAME> and pyunicorn authors
# URL: <http://www.pik-potsdam.de/members/donges/software>
# License: BSD (3-clause)
#
# Please acknowledge and cite the use of this software and its authors
# when results are used in p... |
# -*- coding: utf-8 -*-
"""
This module implements the extended GM-PHD filter.
"""
from __future__ import absolute_import, division
from inspect import getsource
import numpy as np
from scipy.linalg import cholesky, inv
from .gmphd_filter_base import GmphdFilterBase
class ExtendedGmphdFilter(GmphdFilterBase):
... |
<filename>payment.py<gh_stars>0
from fractions import Fraction
class payment_unit:
def __init__(self, fund_name : str, register : str, cost : Fraction, units : Fraction,
currency_conversion_rate : Fraction, transaction : str):
assert all([x > 0 for x in (units, cost)])
self.__fund_... |
<filename>ismore/parse_traj.py
import argparse
import os
import tables
import pandas as pd
import numpy as np
from scipy.interpolate import interp1d
import pickle
from db import dbfunctions as dbfn
from ismore.common_state_lists import *
from utils.constants import *
from riglib.plants import RefTrajectories
import m... |
<gh_stars>0
from fractions import Fraction
def solution(m):
mixed_flags = 0 # TO tell if the input has ordered states or mixed states
encountered_zerosum = 0
for i in range(len(m)):
row_sum = 0
for j in range(len(m[0])):
row_sum += m[i][j]
if row_sum == 0:
e... |
<filename>zach/airfoil.py
import numpy as np
from numpy import pi, sqrt, cos, sin, tan, sign
from numpy import arctan2 as atan2
from numpy import arctan as atan
from numpy import arcsinh as asinh
from numpy import log as ln
import scipy.optimize as opt
from timeit import default_timer as timer
import matplotlib.pyplo... |
import numpy as np
from gym import utils
from trajopt.envs import mujoco_env
import os
import dm_control.mujoco as mujoco
import fileinput
import trimesh
import scipy
def prep_XML(xml_path, replacement_path):
"""
Prepares MJCF XML code. Replaces mesh and textures directory for compilter
with that specified... |
#!/usr/bin/env python3
# Aproximación a una función continua mediante los polinomios de Bernstein
# (prueba del teorema de aproximación de Weierstrass)
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as st
# La función a aproximar
def f(x):
return np.abs(1 / 2 - x)
def bernstein(f, n, p):
... |
<gh_stars>1-10
from sklearn.datasets import load_boston,load_diabetes,load_breast_cancer
from sklearn.model_selection import train_test_split
import time
import numpy as np
from tqdm import tqdm
import pandas as pd
import scipy as sp
## Sparse Regression ##
#Well specified?
def load_traintest_sparsereg(train_frac, dat... |
<filename>timemodel/offset.py<gh_stars>1-10
"""
File: Offset.py
Purpose: Describes a general Offset type that can be independent of time.
"""
from fractions import Fraction
from timemodel.position import Position
from timemodel.duration import Duration
class Offset(object):
"""
classdocs
"""
def ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 23 16:03:13 2020
@author: michaeltecce
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
import IPython.display as ipd # This is a library that allows us to play audio samples in Jupyter
from sklearn.decompositio... |
<reponame>drewpendergrass/ToyLETKF
import json
import numpy as np
import assimilation_tools as at
import plume_tools as pt
import matplotlib.pyplot as plt
import scipy.stats as ss
import scipy.spatial.distance as ssd
import matplotlib.pyplot as plt
import matplotlib.animation as animation
class SettingsGolem(object):
... |
import matplotlib as mpl
import numpy as np
import matplotlib.pyplot as plt
import scipy
import scipy.stats
from scipy import linalg
import models
from models import GaussianMixture as GMM
from models import BayesianGaussianMixture as BGMM
import os
import sys
data = np.load('./data_itr20.pkl')
X = data.reshape(d... |
<reponame>ion-g-ion/paper-cme-tt
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 9 20:08:32 2020
@author: ion
"""
import tt
import scipy.io
import numpy as np
from CME import CME,Gillespie,CompleteObservations,Observations_grid
import matplotlib.pyplot as plt
import scipy.integrate
import tt... |
<filename>Hall_meassurement/parameter_table_1.py
from scipy import stats, constants
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sys
import math
import seaborn as sns
import matplotlib.ticker
import os
#read the data file
#input [filenames] and [temperature]
import glob
def paramet... |
<gh_stars>0
import unittest
import scipy.sparse as sp
from skmultilearn.cluster import LabelSpaceClustererBase, LabelCooccurenceClustererBase
class ClustererBaseTests(unittest.TestCase):
def test_base_fit_predict_is_abstract(self):
base_class = LabelSpaceClustererBase()
self.assertRaises(NotImple... |
import matplotlib.pyplot as plt
from scipy.io import wavfile as wav
from scipy.fftpack import fft
import numpy as np
rate, data = wav.read('/Users/rathinbhargava/IIITB/Questions/Light/1068/wierd_noises.wav')
fft_out = fft(data)
# %matplotlib inline
l = list(np.abs(fft_out))
print (len(l))
# plt.plot(data, np.abs(fft_ou... |
<filename>sfeprapy/time_equivalence_mc.py
# -*- coding: utf-8 -*-
import copy
import numpy as np
from scipy import stats
from scipy.interpolate import interp1d
from scipy.stats.distributions import norm, gumbel_r
from pandas import DataFrame as df
from sfeprapy.func.tfm_alt import travelling_fire as _fire_travelling
f... |
import numpy as np
from scipy import interpolate # noqa: F401
from compas.geometry import allclose
from compas_nurbs import Curve
from compas_nurbs.knot_vectors import knot_vector_and_params
from compas_nurbs.knot_vectors import CurveKnotStyle
def test_interpolation():
degree = 3
points = [(0., 0., 0.), (3... |
# write function to average across frames to give ensembled averaged cosine theta values at each N - 1 value
import MDAnalysis as mda
import statsmodels as stats
import math
import numpy as np
import pandas
import sklearn
import scipy as scipy
import warnings
# Use sklearn to do fitting
from sklearn.linear_model impo... |
<filename>wtopk.py
import sys, argparse
import numpy as np
import scipy.io
import lacofw
fdot = lambda A,B : (A*B).sum()
fnorm = lambda V : fdot(V,V)
def reshape(x, *shape):
return x.reshape(*shape)
def get_wtopk_loss_grad(scomat,y_tra,rhos,require_grad=True):
# Compute the weighted top-k loss.
ncts, ntr... |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from pynufft import NUFFT
import pkg_resources
import scipy.misc
from OCTFrames import FrameManager,cachedOCT
from octReader import OCTManager
import scipy.ndimage
import scipy as S
from matplotlib.widgets import Slider
import attr
@attr.s(kw_... |
<reponame>talonchandler/polaris2
# VTK utilities
import vtk
from vtk.util import numpy_support
import numpy as np
from scipy.spatial import ConvexHull
from polaris2.geomvis import utilsh
# Setup vtk render and renderwindow
def setup_render():
ren = vtk.vtkRenderer()
ren.UseFXAAOn() # anti-aliasing on
... |
import cPickle,numpy as np,Image,gzip,pylab
from scipy import signal
from scipy import misc
#sub import
import matplotlib.pyplot as plt
from PIL import Image
prepath = 'Captcha/lv1/'
X = []
for Im in range(15000):
path = prepath+"%d.jpg"%(Im)
img = misc.imread(path).astype(np.float)
grayim = np.dot(img[...,:3],[0... |
import contextlib
import os
import time
from collections import defaultdict
from shapely.geometry import Polygon
from shapely.strtree import STRtree
import lovely_logger as logging
import numpy as np
import pandas as pd
import requests
import streamlit as st
from pandas import read_csv
from scipy import stats
from sha... |
<reponame>abkumarggn/python-learning-1<filename>marksaverage.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 15 11:31:46 2018
@author: <NAME>
"""
from statistics import mean
marks = []
for i in range(5):
s=input()
s=int(s)
marks.append(s)
s2=mean(marks)
print(float(s2))
|
<reponame>Sikerdebaard/PREDICTFastr
#!/usr/bin/env python
# Copyright 2016-2019 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... |
<reponame>E7SATAI/wageForcasterMx
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
import random
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# In[2]:
from scipy import stats
from statsmodels.tsa.stattools import pacf
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf... |
import data_import as di
from matplotlib.colors import LogNorm
import matplotlib.pyplot as plt
import numpy as np
import utils as ut
import scipy as sp
def posterior_group(cov, met, p, pi):
c, k = np.shape(p)
post = np.zeros(k)
for i in range(k):
post[i] = pi[i]
for r in range(c):
... |
<filename>25D/AE_bn_LeakyReLU_25AOD_grid_search_custom_normalization_1500epochs/000_plot_mjj.py
import sys
import os
BIN = '../../../'
sys.path.append(BIN)
import ROOT
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
import pickle
import my_matplotlib_style as ms
from scip... |
<reponame>lucy3/bertwsi
from typing import Dict, List, Tuple
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.pipeline import make_pipeline
from collections import Counter
import numpy a... |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 27 10:20:09 2020
@author: enzo
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
#%%
def uniform_center_region(full_well):
import cv2
import numpy as np
# get dimensions
hh, ww, cc = full_well.shape
... |
"""
Name : c12_02_graph_standard_noral_dist.py
Book : Python for Finance (2nd ed.)
Publisher: Packt Publishing Ltd.
Author : <NAME>
Date : 6/6/2017
email : <EMAIL>
<EMAIL>
"""
import scipy as sp
import scipy.stats as stats
import matplotlib.pyplot as plt
x = sp.arange(-3,3,0.... |
import numpy as np
from scipy import sparse
#from pynndescent import NNDescent
from sknetwork.hierarchy import Paris
from sknetwork.hierarchy.postprocess import cut_straight
from tqdm import tqdm
class ParisClusterer(object):
def __init__(self, featureMatrix):
self.featureMatrix = featureMatrix
def l... |
<reponame>slnovak/nitime<filename>nitime/tests/test_utils.py<gh_stars>1-10
import numpy as np
import numpy.testing as npt
import nitime.timeseries as ts
import decotest
import nose.tools as nt
from scipy.signal import signaltools
from nitime import utils
def test_zscore():
x = np.array([[1,1,3,3],
... |
<gh_stars>1-10
"""
"""
from utils import Solution
from typing import Any
import numpy as np
from scipy.ndimage import convolve
class DaySolution(Solution):
def __init__(self, day: int = 20, year: int = 2021) -> None:
super().__init__(day, year)
self._bin2dec = 2 ** np.arange(9).reshape(3, 3)
... |
import time
import os
import requests
import matplotlib.pyplot as plt
import numpy as np
import dateutil.parser
import matplotlib.dates as mdates
from datetime import timezone, timedelta, datetime
from scipy.stats import gamma
from influxdb import InfluxDBClient
from statistics import pvariance, pstdev, mean
influxdb... |
<reponame>ben300694/tensorflow-deeplab-resnet<filename>my_inference.py
"""Run DeepLab-ResNet on a given image.
This script computes a segmentation mask for a given image.
"""
from __future__ import print_function
import argparse
from datetime import datetime
import os
import sys
import time
import yaml
from PIL imp... |
<reponame>ksopan/WRF_Post_MFLUX<filename>SRB_MFC_WRF_Python/plot_barbs_W.py
# <NAME>
# Plotting WRF netCDF output
# Plots a map view of wind barbs and color shading of vertical velocity for a given model level
# Uses the stagger_to_mass.py module to convert the U and V variables to mass point values by averaging.
imp... |
from dataclasses import dataclass
from typing import Sequence
import sympy
import numpy as np
from numpy import zeros, diag, eye, ones, array
from numpy.linalg import cholesky
from numpy.random import multivariate_normal
@dataclass
class SimulationParams:
ymvars: Sequence[sympy.Symbol] # manifest endogenous var... |
<filename>transforms/fcc_fourier/tests.py
__author__ = 'Mikhail'
import unittest
from transforms.fcc_fourier import *
from numpy.linalg import norm
import sympy as sy
import math as fm
# test values from matlab implementation
# http://www.unavarra.es/personal/<NAME>/clenshawcurtisrule
class TestFCC(unittest.TestCas... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3
# name: python3
# ---
# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab... |
<reponame>ctralie/Sonification<filename>UsainBolt/CubicSpline.py
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
import sys
sys.path.append('..')
from CurvatureTools import *
def sample_cubic_spline(xs, ys, t):
"""
Create a 1D cubic spline and sample it
Parameters
-----... |
<reponame>Edelweiss35/deep-machine-learning<filename>dml/tool/normalize.py
from __future__ import division
import numpy as np
import scipy as sp
__all__ = [
'normalize',
'disnormalize',
'normalize_by_extant',
'featurenormal'
]
def featurenormal(X,axis=0):
'''
X is N*M
axis==0: columns
axis==1: rows
'''
m... |
import numpy as np
import matplotlib.pylab as plt
import scipy.stats as stats
def plot_log_population2(population_old, population_new, _title, _xlabel, _ylabel, _bins):
try:
if np.allclose(population_old, population_new):
return
except:
pass
plt.figure(figsize=(10,5))
if Fa... |
<reponame>AlexaVillaume/LRIS_Reduction<filename>lris.py
import sys
import os
import numpy as np
from scipy.optimize import curve_fit
from scipy import interpolate
from astropy.io import fits
from astropy.io.fits import getheader
from astropy.io.fits import writeto
from astropy.convolution import Gaussian1DKernel, convo... |
<gh_stars>0
# --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
# code starts here
bank=pd.read_csv(path)
categorical_var=bank.select_dtypes(include='object')
print(categorical_var)
numerical_var=bank.select_dtypes(include='number')
# code ends here
# ------... |
<reponame>rotsehub/rotsesim<filename>py/rotsesim/cepheid/phot_per_sec.py
#these lines import various libraries to use
import numpy as np
import matplotlib.pyplot as plt
import math
import os
import csv
import random
import itertools
import pandas as pd
from astropy.io import fits
from astropy.table import Table, join... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 15 20:38:52 2017
@author: <NAME>
@email: <EMAIL>
Descripcion
-----------
Pequeno script para realizar el calculo de la energia y forma de la funcion de
onda del oscilador armonico.
Referencias
-----------
(1) <NAME>., <NAME>. (2006). Quantum Chemistry (3... |
<filename>CSIKit/visualization/plot_szenario.py
"""
Classes to Plot a szenario belog different measurements
"""
from cmath import phase
from typing import Dict, List, Tuple
import os
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from CSIKit.csi import IWLCSIFrame as CsiEntry
fr... |
<gh_stars>0
import rdflib
import pandas as pd
import numpy as np
import sys
import os
import pickle
from scipy.spatial.distance import cosine as cosdist
from collections import Counter
from sklearn.metrics import roc_auc_score, precision_recall_fscore_support
import main as node2vec
ml2dbp = pd.read_csv('./MappingMovi... |
import glob
import os
import time
import numpy as np
import scipy.io.wavfile
from scikits.talkbox.features import mfcc
GENRE_DIR = "/home/cheng/Desktop/genres"
GENRE_LIST = ["blues", "classical", "country", "disco", "hiphop", "jazz", "metal", "pop", "reggae", "rock"]
def write_features(features, f):
"""
Thi... |
<gh_stars>0
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import numpy as np
import dash_html_components as html
import pandas as pd
from scipy.stats import norm, kurtosis
import plotly.graph_objs as go
from dash.dependencies import Input, Output, State
import plotly.express as ... |
<gh_stars>0
import serial #pip install PySerial
import pandas as pd
import matplotlib.pyplot as plt
from scipy.interpolate import UnivariateSpline
import os
import time
def roast_profile(port=1, animated=True, cycle_up=30, cycle_down=15, record_cracks=True, file_prefix=None):
from serial.tools.list_ports import co... |
<filename>dataGenerator.py<gh_stars>1-10
from tensorflow.keras.utils import Sequence, to_categorical
from tensorflow.keras.preprocessing.image import apply_affine_transform, apply_brightness_shift
import tensorflow as tf
import numpy as np
import os
from time import time
import cv2
import random
import scipy
from video... |
<gh_stars>1-10
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import matplotlib
matplotlib.use('Agg')
import logging
import argparse
import cPickle as pickle
import gc
from itertools import combinations
import json
import math
# import matplotlib.pyplot as plt
import multiprocessing as mp
import numpy as np
import os
impor... |
<gh_stars>1-10
'''
Simulate motion model for the point-target and extended-target in clutter.
Motion model: constant velocity (CV), constant acceleration (CA), constant turn (CT).
Fluctuating Extended targets model: Swerling targets of type 0,1,3.
Created by <NAME> on 20201030 @Provence-Dalian.
Add swerling target mo... |
<reponame>tgent11/coronavirus_seir_model
import scipy.integrate
import numpy as np
from data_utilities import delay
from constants import SYMPTOM_HOSPITAL_LAG, TIME_IN_HOSPITAL, COMMUNICATION_LAG, DAYS_TOTAL, TEST_LAG, \
QUARANTINE_R1, LIFTED_Q_R2, DAYS0, DELTA_R0, DAYS_Q_LIFTED
def calculate_deaths(days, reco... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# standard library
import os
# 3rd part packages
from skimage import io
from skimage.measure import label, regionprops
from skimage import morphology
import numpy as np
import cv2
from scipy.spatial import Voronoi
from shapely.geometry import Polygon
from sk... |
<reponame>sakshi13-m/StudentCodeSnippets<gh_stars>1-10
import numpy as np
import math as m
import cmath as cm
solutions = []
for re in np.arange(-10,10,0.01):
for im in np.arange(-10,10,0.01):
z = complex(re,im)
#print(f'Checking {z}')
if(abs(z**2 - 2**z) <= 0.01 ):
solutions.... |
"""
FileName [ test.py ]
PackageName [ PFFNet ]
Synopsis [ Generated the dehazed images from the PFFNet Model ]
library:
* PIL == 5.4.1 pip3 install pillow
* scipy pip3 install scipy
"""
import argparse
import os
import sys
import copy
import random
import numpy as np
from joblib ... |
<gh_stars>1-10
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import xarray as xr
import numpy as np
import pandas as pd
import act
import glob
import sys
import operator
import scipy.stats as stats
import datetime as dt
sdate = '20180815'
#sdate = '20180815'
edate = '20190415'
#edate = '20... |
#!/usr/bin/env python3
import unittest
import unittest.mock as mock
import matplotlib.pyplot as plt
import numpy as np
import numpy.testing as nptest
import pandas as pd
import pandas.testing as pdtest
import scipy.linalg
from datafold.dynfold import TSCTakensEmbedding
from datafold.dynfold.dmd import (
DMDEco,
... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 09 13:01:42 2015
@author: <NAME>
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restri... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import copy, warnings
from os import path
from collections import OrderedDict
import itertools
import numpy as np
from scipy import stats, signal, interpolate
import matplotlib.pyplot as plt
... |
import numpy as np
import copy
from scipy.spatial import distance
from sklearn.cluster import KMeans
class OutlierKmeansAlgor():
def __init__(self, num_points, dimensions, num_clusters, max_iter, seed, init_type='random',
threshold_dis = 10., threshold_criterion = 0.01,
max_n... |
#!/usr/bin/env python
from __future__ import print_function, division
import bayesloop as bl
import numpy as np
import sympy.stats as stats
class TestTwoParameterModel:
def test_fit_0hp(self):
# carry out fit (this test is designed to fall back on the fit method of the Study class)
S = bl.HyperSt... |
<filename>performanceComparison/HilbertExper.py
from scipy.linalg import hilbert
from efficient_eigensolvers import PowerMethod, QR_shifted, QR_unshifted, QR_wilkinson_shift, RayleighQuotientIteration
from matricesGenerator import matrix_generator
import numpy as np
import scipy
import matplotlib.pyplot as plt
import s... |
<reponame>archiki/GrIPS
import nltk
from nltk.tokenize import word_tokenize, sent_tokenize
from supar import Parser
import string
import random
from nltk.tokenize.treebank import TreebankWordDetokenizer
import numpy as np
import argparse
from nat_inst_gpt3 import *
from sklearn.metrics import balanced_accuracy_score
fr... |
<reponame>yavuzalikorkut/olanalyze
from flask import Blueprint, render_template, request, session
from utils import helper
from scipy import stats
import pandas as pd
import numpy as np
blueprint = Blueprint('signtest', __name__)
@blueprint.route('/one-sample/sign-test')
def ttest():
return render_template('one... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from scipy.spatial import cKDTree
import numpy as np
def search_kdtree(lats, lons, points):
mytree = cKDTree(np.ds... |
import h5py
import os
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import pearsonr
# seed random number generator
cwd = os.getcwd()
#Open the data file
filepath = cwd + '\\demo.hdf'
f = h5py.File(filepath, 'r')
#Show all channels available in file
chanIDs = f['DYNAMIC DATA']
... |
<gh_stars>1-10
#=========================================================================
#this script was created to test some SP-0256 related functionality.
#In particular:
#Q: can a reasonable approximation be made simply by appending
#pre-recorded phonemes?
# A: it is a little klunky, but it seems intelligible... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.