text string |
|---|
from fastai.vision import *
from fastai.callbacks import *
from fastai.basic_train import Recorder
from fastai.core import ifnone, defaults, Any
import numpy as np
from fastai.torch_core import to_np
import matplotlib.pyplot as plt
from typing import Optional
import scipy
import itertools
import fastai
import torchvisi... |
import scipy.signal as signal
import numpy as np
class Prediction(object):
def __init__(self, peaks_ixs=None, offset_hist=None, offset_conv_sum=None,
loc_pred=None, loc_conf=None, offsets=None, density_data=None):
# Peaks data
self._peaks_ixs = None
self.peaks_ixs... |
<filename>bgtorch/bgtorch/distribution/sampling/_mcmc/permutation.py
__author__ = "noe"
import numpy as np
from scipy.optimize import linear_sum_assignment
from deep_boltzmann.util import ensure_traj, distance_matrix_squared
class HungarianMapper:
def __init__(self, xref, dim=2, identical_particles=None):
... |
import numpy as np
import os
import shutil
import glob
import JSONHelper
import quaternion
import argparse
import os.path as osp
import pickle
import align_utils as utils
import xml.etree.ElementTree as et
from xml.dom import minidom
import cv2
import struct
import scipy.ndimage as ndimage
def loadMesh(name ):
ve... |
import numpy as np
import pyDOE2
import sample_generator as sg
from copy import deepcopy
import os
import glob
import pickle
import sys
import emcee
from linna.nn import *
from scipy.special import erf
from scipy.stats import chi2
import io
import gc
import torch
from torch.utils.data import Dataset, DataLoader
from to... |
from fenics import *
import numpy as np
from ufl import nabla_div
import sympy as sym
def solver(f, phi, K1_val, K2_val, K3_val, b_12_val, b_23_val, mesh, degree):
"""
Solving the Reduced Darcy multi-compartment model for 3 equal sized
porous media with domain of Omega = [0,1] x [0,1] using pressure bounda... |
# @Time : 2019/10/11 下午6:25
# @Author : <NAME>
# @File : data.py
# @Orgnization: Dr.Cubic Lab
import numpy as np
import scipy.io
###########################
## Function to load data ##
###########################
def loaddata():
'''
Load training/test data into workspace
This function assumes y... |
import sympy as sp
import numpy as np
from devito import (Eq, Operator, VectorTimeFunction, TimeFunction, NODE,
div, grad)
from examples.seismic import PointSource, Receiver
def blanch_symes(model, geometry, v, p, **kwargs):
"""
Stencil created from from Blanch and Symes (1995) / Dutta an... |
import random
print("-------------random --- 生成伪随机数")
random.seed(1)
print(random.getstate())
random.setstate(random.getstate())
print(random.getrandbits(10))
print("--------------")
print(random.randrange(20))
print(random.randrange(20)) # 这相当于 choice(range(start, stop, step))
print(random.randint(1, 10)) # 返回随机... |
"""
### env
textacy==0.9.0
...
### fetch source data
- **Tatoeba:** A crowd-sourced collection of sentences and their translations into many languages. Style is relatively informal; subject matter is a variety of everyday things and goings-on. Source: https://tatoeba.org/eng/downloads.
- **Leipzig Corpora:** A colle... |
<reponame>DDMGNI/viRMHD2D
'''
Created on 21.03.2016
@author: <NAME> (<EMAIL>)
'''
import sys, petsc4py
from importlib import import_module
from petsc4py import PETSc
import h5py
import numpy as np
import argparse, datetime, time
import pstats, cProfile
from rmhd.config.config import Config
from rmhd.solvers.comm... |
from typing import Optional
import numpy as np
import scipy.sparse as sp
import torch
from scipy import linalg
from torch import Tensor
from tqdm import tqdm
from torch_geometric.data import Data
from graphwar.attack.targeted.targeted_attacker import TargetedAttacker
from graphwar.utils import singleton_fi... |
"""
This script creates a boolean mask based on rules
1. is it boreal forest zone
2. In 2000, was there sufficent forest
"""
#==============================================================================
__title__ = "Boreal Forest Mask"
__author__ = "<NAME>"
__version__ = "v1.0(19.08.2019)"
__email__ = "<EMAIL>"
#=... |
<gh_stars>1-10
import math
import datetime
import collections
import statistics
import itertools
def input_list():
ll = list(map(int, input().split(" ")))
return ll
tc = int(input())
for _ in range(tc):
n = int(input())
arr = input_list()
e, o = [], []
for i in range(0, len(arr)):
i... |
from utils import read_data
from collections import deque
from statistics import median
from typing import NamedTuple
class PointValue(NamedTuple):
value: int
corrupted: bool
CELL_CLOSERS = {
"{": "}",
"[": "]",
"(": ")",
"<": ">"
}
POINT_VALUES_ONE = {
")": 3,
"]": 57,
"}": 119... |
<filename>src/pi_FPE/pi_FPE/footplacementestimator.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 8 14:42:06 2020
@author: Nick1
"""
import os
import re
import sys
import numpy as np
import pandas as pd
import yaml
from scipy import optimize
from termcolor import colored
from .getevents impor... |
<filename>notebooks/py/SeqFISH.py
#!/usr/bin/env python
# coding: utf-8
#
# EPY: stripped_notebook: {"metadata": {"kernelspec": {"display_name": "starfish", "language": "python", "name": "starfish"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-pyt... |
<filename>teacher_student/micro_feature_learning_integrated_playground.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
import os
import sys
sys.path.insert(1, '/home/labs/ahissarlab/orra/imagewalker')
sys.path.insert(1, '/home/orram/Documents/GitHub/imagewalker')
import random
import numpy as np
import ten... |
<filename>Chat/voice/voice.py
import speech_recognition as sr
from pydub import AudioSegment
import sounddevice as sd
from scipy.io.wavfile import write
import pyttsx3
import query
import os
engine = pyttsx3.init()
fs = 44100
seconds = 5
toSay = ''
try: os.remove('output.wav', 'transcript.wav')
except: pass
print("S... |
import tensorflow as tf
import numpy as np
from . import distance
from typing import Optional, Union
from scipy.special import logit
class GaussianRBF(tf.keras.Model):
def __init__(self, sigma: Optional[tf.Tensor] = None, trainable: bool = False) -> None:
"""
Gaussian RBF kernel: k(x,y) = exp(-(1/... |
import collections
import errno
import logging
import os
import re
import shutil
import uuid
import time
import traceback
import sys
import pandas as pd
import numpy as np
from openpyxl import load_workbook
from xlrd.biffh import XLRDError
from sklearn import preprocessing
from skbio.stats.composition import ilr, clr
... |
<reponame>wadpac/SleepStageClassification
import sys,os
import numpy as np
import pandas as pd
from sklearn.metrics import precision_recall_fscore_support, classification_report
from scipy.stats import spearmanr
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def main(argv):
infile = argv[0]... |
# %% [markdown]
# ##
import warnings
def noop(*args, **kargs):
pass
warnings.warn = noop
import os
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy
import seaborn as sns
from joblib import Parallel, delayed
from scipy.ndimage import gaussi... |
<gh_stars>10-100
# JN 2016-03-02
"""
show resposes in css-gui
"""
from __future__ import print_function, division, absolute_import
import os
import numpy as np
import scipy.signal as signal
from .sort_widgets import MplCanvas
from matplotlib.pyplot import imread
from matplotlib.offsetbox import OffsetImage, Annotatio... |
<reponame>ihumphrey/Xi-cam.SAXS<gh_stars>1-10
import numpy as np
from scipy import signal
from xicam.plugins.operationplugin import operation, output_names, display_name, describe_input, describe_output, \
categories
from pyFAI.azimuthalIntegrator import AzimuthalIntegrator
from typing import Tuple
@operation
@ou... |
<filename>KIDs/psd_fitting.py
import numpy as np
from scipy.stats import binned_statistic
import scipy.optimize as optimization
import matplotlib.pyplot as plt
#set of modules for fitting psd of kinetic inductance detectors
#Written by Jordan 1/5/2017
#To Do
#add verbose = true keyword
#Change Log
#1/9/2017 Added si... |
"""
Demonstration of Python Scientific computing.
Uses Newton Raphson's method as a vehicle.
"""
import matplotlib.pyplot as plt
import scipy as sp
def myfunc(x):
"""
Generic function.
Parameters
----------
x: float or array_like
The value or array at which to calculate the function
... |
import abc
import wave
from wave import Wave_read
from scipy.io.wavfile import read
from pathlib import Path
from muselearn.src.containers.waveform import Waveform
class _Loader(object):
__metaclass__ = abc.ABCMeta
def __init__(self, path_to_file: Path):
self._path_to_file = path_to_file
self... |
<gh_stars>0
# To test, run in the terminal 'ipython -i typemath.py'
import warnings
import math
import os
import json
import sympy
class typemathtextError(Exception):
pass
class typemath:
r"""Creates an object that can be used for easy-to-use methods to create calculators.
It does this by creating m... |
<reponame>Simon-Pu/CSI-Net<filename>train.py<gh_stars>0
import scipy.io as sio
from torch.utils.data import TensorDataset, DataLoader
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import matplotlib.pyplot as plt
import math
import time... |
#! /usr/bin/env python
# encoding: utf-8
# Copied from https://github.com/mauriciovander/silence-removal/blob/master/segment.py
import numpy
import scipy.io.wavfile as wf
import sys
from synth.config import config
class VoiceActivityDetectionYAM:
def __init__(self, sr, ms, channel):
self.__sr = sr
... |
<reponame>parmarsuraj99/Finance
# Imports
from pandas_datareader import DataReader
from yahoo_fin import stock_info as si
from scipy.stats import zscore
from statistics import mean
import datetime as dt
import pandas as pd
import numpy as np
import warnings
import talib
import time
import ta
# Settings
warnings.filte... |
<gh_stars>1-10
"""
This module contains functions to model univariate and multivariate
phase distributions and to fit them to data.
:Authors: <NAME> <<EMAIL>> and
<NAME> <<EMAIL>>
:Reference: Cadieu CF, Koepsell K (2010) Phase coupling estimation from
multivariate phase statistics. Neural Comput... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 8 10:02:36 2021
@author: philippbst
"""
import torch
import numpy as np
from abc import ABC, abstractmethod
from torch.optim import Adam, LBFGS
from torch.optim.lr_scheduler import StepLR
from torch.utils.data import DataLoader
from neural_network... |
<gh_stars>10-100
import numpy as np
import pandas as pd
import scipy as sp
import warnings
import os
from torch import nn
import torch
import parser
from .splines import spline, Spline
def checkups(params, formulas):
"""
Checks if the user has given an available distribution, too many formulas or wrong parame... |
# Created by <NAME> at 2019-07-23
# All right reserved
# Department of Computer Science
# the University of Warwick
# <EMAIL>
import os
from datetime import datetime
import dill
import numpy as np
from scipy import integrate
class QueryEngine:
def __init__(self, mdl, reg, kde, n_training_point, n_total_point, x_... |
# -*- coding: utf-8 -*-
"""
Tools for calculating the Evaporative Demand Drought Index (EDDI) from reference evapotransipiration data.
"""
import pandas as pd
import numpy as np
import bottleneck as bn
from statsmodels.sandbox.stats import stats_mstats_short as sms
from scipy import stats
class EDDI(object):
"""
... |
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 3 18:12:36 2020
@author: Akash1313
"""
#Question 1
###############################################################################
print("---------------------------Question1----------------------------------------")
import numpy as np
import pandas as pd
import scipy a... |
<filename>md_csl.py
#immediate things to do:
#1. finish statistics X
#2. add S(q,w) X
#4. add tail corrections
#5. Add final configuration
#6. add a simple user interface function
#7. clean up, make tidy
#8. Add final configuration
#9. add lots of comments
#10. go through a second time to check I understand everything
... |
"""Parser for propositional formulas represented using infix notation.
The symbols used for the logical connectives are as follows:
+------------+--------+
| Connective | Symbol |
+============+========+
| conj. | ``&`` |
+------------+--------+
| disj. | ``|`` |
... |
<gh_stars>0
import random
import numpy as np
from utils import gen_random_atoms, dump_atoms
from sklearn.metrics.pairwise import paired_distances
from scipy.spatial.distance import pdist, squareform, cdist
import itertools
import time
neighbor_mask = np.array(list(itertools.product([-1, 0, 1], [-1, 0, 1], [-1, 0, 1]))... |
<gh_stars>0
from fractions import Fraction
from time import time
global_denominators = []
def get_n_level_denominator(n):
global global_denominators
result = Fraction()
if len(global_denominators) >= n:
return global_denominators[n - 1]
if n == 1:
result = Fraction(2)
else:
... |
<gh_stars>10-100
"""This module is used for the storage analysis."""
from scipy.sparse import dia_matrix
import numpy as np
import collections
import math
from math import ceil
bytes_per_double_data = 8
bytes_per_metadata = 4
def coo(matrix):
nnz = matrix.nnz
return (2 * nnz * bytes_per_metadata,
... |
<filename>MindLink-HeartCare/heartRateDetection/heartRate_V4.py
'''
This file is referenced from a blog below:
https://handsome-man.blog.csdn.net/article/details/102586996
heart rate: beat per minute (bpm)
'''
import cv2
import numpy as np
import dlib
import time
from scipy import signal
# Constants
# WINDOW_TITLE ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 17 17:08:04 2019
@author: <NAME>
Percentage Comparison
MDA EDEM
"""
#Resets ALL (Careful This is a "magic" function then it doesn't run as script)
#reset -f
#load basiclibraries
import os
import numpy as np
import pandas as pd
from pandas.api.types impor... |
import tensorflow as tf
import numpy as np
from networks.select import select_G
from dataset import train_dataset_sim, test_dataset_sim
from loss import G_loss
from args import parse_args
import metasurface.solver as solver
import metasurface.conv as conv
import scipy.optimize as scp_opt
import os
import time
## Log... |
<filename>qc_tests/records.py
#!/usr/local/sci/bin/python
#*****************************
#
# Known Records Check (KRC)
#
# Check for exceedence of world records
#
#
#************************************************************************
# SVN Info
#$Rev:: 219 ... |
#!/usr/bin/env python
import os
import scipy.io as sio
import glob
PYTHON_DIR = os.path.dirname(os.path.realpath(__file__))
DATA_DIR = os.path.join(os.path.dirname(PYTHON_DIR), 'pmtkdataCopy')
def load_mat(matName):
"""look for the .mat file in pmtk3/pmtkdataCopy/
currently only support .mat files create by... |
<filename>beatmap/core/bet.py<gh_stars>1-10
import numpy as np
import scipy as sp
import logging
from beatmap import io as io
from beatmap import utils as util
from beatmap import vis as figs
from collections import namedtuple
def bet(iso_df, a_o, info, *args):
"""
Performs BET analysis on isotherm data for a... |
<reponame>ishine/EmotionControllableTextToSpeech
import numpy as np
import scipy.io as sio
# load data.mat file
datadict = sio.loadmat('../saved_data/pubfig_data.mat')
# some variables are in bad format
# process them to make them in correct format
attr_names = [x[0] for x in datadict['attribute_names'][0]]
datadict... |
<filename>shapes/Text.py<gh_stars>1-10
import sympy
class Text:
matplotlib_obj = None
def __init__(self, xy, text, color, fontsize, offset, halignment, valignment, bbox, latex, pixel, mplprops, figure):
if not isinstance(color, list):
offset = [offset]
color = [color]
xy = [xy]
text = [text]
halignm... |
<reponame>pratik0917/greyatom-python-for-data-science
# --------------
# 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(bank.columns)
print(categorical_var.columns)
numeri... |
#!/usr/bin/env python -u
# -*- coding: utf-8 -*-
# Copyright 2019 Microsoft (author: <NAME>)
from __future__ import absolute_import, division, print_function
import argparse
import glob
import os
import sys
import numpy as np
import soundfile as sf
from scipy.io import wavfile
from tqdm import tqdm
EPS = np.fin... |
<gh_stars>1-10
import scipy.fftpack
import warnings
def compute_padding(M, N, J):
"""
Precomputes the future padded size.
Parameters
----------
M, N : int
input size
Returns
-------
M, N : int
padded size
"""
M_padde... |
<filename>classify_and_test.py<gh_stars>0
import pandas
import io
import pickle
import time
import numpy as np
from sklearn import decomposition, discriminant_analysis
from sklearn.svm import SVC
from sklearn.neighbors import KDTree, KNeighborsClassifier
from scipy.spatial.distance import cdist
from functools import re... |
<gh_stars>100-1000
"""Testing utilities for custom :mod:`sklearn` functionalities.
Parts of this code have been copied from :mod:`sklearn`.
License: BSD 3-Clause License
Copyright (c) 2007-2020 The scikit-learn developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modif... |
<filename>src/clustering.py<gh_stars>0
from enum import Enum
from typing import Any, Tuple
from nltk import word_tokenize
from nltk.stem.porter import PorterStemmer
from nltk.corpus import stopwords
from scipy.sparse.csr import csr_matrix
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster ... |
<filename>rep_counter.py
import os
from scipy.signal import find_peaks
import numpy as np
class RepCounter:
'''repetition counter class to count the number of cycle counts on a 1D signal
Args:
max_buffer_size: maximum size of the buffer before it resets automatically (not implemented yet)
min_... |
#source
#region
#import
#region
import math
from sympy import *
import matplotlib.pyplot as plt
from numpy import linspace
import numpy as np
from sympy.codegen.cfunctions import log10
from sympy.abc import x,t,y
from collections import OrderedDict
from operator import itemgetter, attrgetter
from sympy.plotting impor... |
<reponame>kottmanj/z-quantum-core<filename>src/python/zquantum/core/interfaces/ansatz.py
from abc import ABC, abstractmethod
import numpy as np
import copy
import sympy
from typing import List, Optional
from overrides import EnforceOverrides
import warnings
from ..circuit import Circuit
from .ansatz_utils import ansatz... |
"""Set of tools to manipulate input and output files."""
from multiprocessing import RawArray
import h5py
import numpy as np
from scipy.io import loadmat
def load_stim(filepath, normed=True, channel='g', dataset='checkerboard'):
"""Get checkerboard stim from hdf5 file.
Read checkerboard stimulus from hdf5 f... |
<reponame>tmcclintock/PLANCK_DES_Clusters
import numpy as np
from helper_functions import *
from likelihood import *
import models
import clusterwl
#Set up the assumptions
cosmo = get_cosmo()
h = cosmo['h'] #Hubble constant
model_name = "M"
def find_best_fit(args, bfpath):
z, cosmo, k, Plin, Pnl, Rmodel, xi_mm, ... |
<gh_stars>1-10
#coding: latin1
#< show
from fractions import Fraction
def show_fractional_knapsack(x, v, w):
print('Valor total: {}.'.format(sum(x[i]*v[i] for i in range(len(x)))), end= ' ')
print('Carga total: {}.'.format(sum(x[i]*w[i] for i in range(len(x)))))
print('Detalle: {}.'.format(', '.jo... |
<reponame>akaeme/SafeCorporate<gh_stars>1-10
from pymongo import MongoClient
import sys, argparse, random
from numpy import array
from sklearn import model_selection, neural_network, svm
from sklearn.preprocessing import StandardScaler
from progressbar import *
import logging, pickle
from statistics import mean
from sk... |
# Python code for reading in the output of the IRAF ellipse task
# (stsdas.analysis.isophote package), as translated into text-file
# output by the tprint or tdump tasks, or into FITS table form by
# the tcopy task.
#
# Also include functions for plotting, using matplotlib functions.
# In addition, we include some f... |
import os, sys
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from joblib import Parallel, delayed
import scipy
import umap
import pylab
sns.set_style("whitegrid")
sns.set_context('paper')
from sklearn.preprocessing import StandardScaler
sys.path.insert(0, '../read_data/'... |
<reponame>kharrigian/pitchers-and-pianists<filename>scripts/tap_processing_stage_1.py
## In Stage 1 of proessing, we manually check time series and throw out bad data (sensor malfunction, forgetting the task)
###############################
### Imports
###############################
# Standard I/O and Data Handling... |
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
# # Otimização
# ## Introdução
#
# Problemas de otimização (POs) são encontrados em diversas situações da Engenharia, em particular na Engenharia de Produção. Em uma linha de produção, por exemplo, a otimização de custos com logística, recursos humanos, matéria-pr... |
#!/usr/bin/env python
# coding: utf-8
""" Learning Koopman Invariant Subspace
(c) <NAME>, 2017.
<EMAIL>
"""
import numpy
from scipy import linalg
from chainer import link
from chainer import Variable
from chainer import Chain
from chainer import dataset
from chainer import reporter as reporter_module
from chainer i... |
<filename>bcindex.py
'''
This script was designed by <NAME> and <NAME> to
test the consistency of a resampled Species Distribution Model using the Boyce
Continuous Index. This script was originally created on 12/13/2013.
This script was updated with the Idrisi Python framework under development (idrtools/idrpy)
and wa... |
################################################## END ########################################################
################################################### SET PATH ########################################################
# compare bowtie call SNPs VS mapper call SNPs
import glob
import os
from Bio import SeqIO... |
<reponame>i1bgv/abtools
# -*- coding: utf-8 -*-
import numpy as np
from scipy.stats.kde import gaussian_kde
def kl_divergence(a, b, normalize=True):
"""
Compute K-L divergence for two arrays of values.
At first compute probability density function with Gaussian KDE, then
apply it to linear space of ... |
import argparse
import pandas as pd
from scipy.stats import gmean
from bokeh.plotting import figure
from bokeh.io import curdoc, output_file, save
from bokeh.resources import CDN
from bokeh.embed import file_html, components
from bokeh.layouts import row
from bokeh.models import HoverTool
def parse_args():
parser... |
"""Get mean median and range for the group. Handle non-numeric characters."""
import re
import statistics as stats
import inflect
COLUMN = 'mmr'
P = inflect.engine().plural
def reconcile(group, args=None): # pylint: disable=unused-argument
"""Reconcile the data."""
values = [g for g in group]
number... |
import argparse
from pathlib import Path
import networkx as nx
import nxmetis
import torch
import torch.nn as nn
import torch.multiprocessing as mp
from torch_geometric.data import Data, DataLoader, Batch
from torch_geometric.nn import SAGEConv, GATConv, GlobalAttention, graclus, avg_pool, global_mean_pool
from tor... |
<reponame>leotappe/distributions<gh_stars>1-10
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_katex
import numpy as np
import plotly.express as px
from scipy import stats
from app import app
layout = html.Div([
dash_katex.DashKatex(... |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# LISTA - TEORIA
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from statistics import mean
lista_vazia = []
lista_com_valores = [1, 2, 3]
print(lista_com_valores)
print(lista_com_valores[0])
# como editar algum valor da lista
lista_com_v... |
import cProfile
import re
import pickle
import integration_ME as ME
import numpy as np
import cProfile,pstats
from scipy import sparse
import matplotlib.pyplot as plt
from random import choices
Nmax = 13 # Maximum number of stators
ME.Nmax = Nmax # overriding Nmax in mE module for consistenct along files
thin = 10... |
<filename>skgp/correlation_models/non_stationary.py
""" Non-stationary correlation models for Gaussian processes."""
# Author: <NAME> <<EMAIL>>
import numpy as np
from scipy.special import gamma, kv
from scipy.stats import expon, norm
from sklearn.cluster import KMeans
from .stationary import l1_cross_differences
M... |
<filename>nirspec.py
import numpy as np
import pdb as pdb
from astropy.io import fits
from astropy.table import Table
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
def divspec(datadir, srcfile, stdfile, dtau=0, dpix=0, mode=None,plot=True):
#Read in data for source and standard
hdulis... |
import os
import json
from fractions import Fraction
from .data_object import DataObject
import pandas as pd
class Ingredient(DataObject):
unit_names = ['cup','tbsp','tsp']
unit_up = [1, 16, 3]
unit_down = [1, .0625, 0.3333]
# this list matches items in the data csv files and then uses the id as th... |
from astropy.io import fits
from scipy.interpolate import interp1d
import copy
import numpy as np
from functools import partial
import crowdsource.psf as psfmod
import crowdsource.decam_proc as decam_proc
from collections import OrderedDict
import os
def write_injFiles(imfn, ivarfn, dqfn, outfn, inject, injextnamelist... |
import numpy as np
import scipy.signal
import tensorflow as tf
class RingBuffer:
def __init__(self, buffer_size, shape, dtype):
self.buffer_size = buffer_size
self.buffer = np.empty((self.buffer_size, *shape), dtype=dtype)
self.head, self.tail = 0, -1
def __len__(self):
return... |
<reponame>swederik/structurefunction
from nipype.interfaces.base import (BaseInterface, traits,
File, TraitedSpec, InputMultiPath,
isdefined)
from nipype.utils.filemanip import split_filename
import os.path as op
import numpy as np
import nibabel a... |
<filename>paintbox/operators.py
# -*- coding: utf-8 -*-
"""
Miscelaneous classes for combination and modification of other paintbox model
classes.
"""
from __future__ import print_function, division
import numpy as np
import astropy.constants as const
from scipy.ndimage import convolve1d
from spectres import spectres
... |
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import time
import yfinance as yf
import scipy.optimize as spo
pd.options.display.float_format = '{:.3f}'.format
def get_data_close(symbol):
stock = yf.Ticker(symbol)
df = stock.history(period="max")
return pd.DataFrame(df['Close'])
... |
import numpy as np
import scipy
from ... import operators
__all__ = ['ssa','kernel_ssa']
#-----------------------------------------------------------------
__EPSILON__ = 1e-4
def ssa(x, order, mode='toeplitz', lags=None, averaging=True, extrasize = False):
'''
Estimation the signal components based on... |
<filename>python/landsat8_composite_toa.py
#!/usr/bin/env python
#
# Created on 07/11/2014 <NAME> - Vightel Corporation
#
# Input: Landsat8 GeoTiffs
# Output: Composite EPSG:4326
#
import os, inspect, sys
import argparse
import numpy
import scipy
import math
from scipy import ndimage
from osgeo import gdal
from osg... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 10
@author: jaehyuk
"""
import numpy as np
import scipy.stats as ss
import scipy.optimize as sopt
import scipy.integrate as spint
from . import normal
from . import bsm
import pyfeng as pf
'''
MC model class for Beta=1
'''
class ModelBsmMC:
beta = 1.0 ... |
#!/usr/bin/env python
# coding: utf-8
# # 3D Volume Analysis Functions
# ## Introduction
# These functions were developed at **Boston University** to aid in the analysis of pre-segmented 3D reconsructed volumes. This code was originally written to segment three-phase material, but can be modified to analyze two-phase... |
from os import environ
environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
import pygame, pygame.sndarray
import numpy
import scipy.signal
import re
from note import Note
from note import basic_notes
sample_rate = 44100
sampling = 4096 # or 16384
S = 2**(1/12) # Semi-tone frequency multiplier
T = S ** 2 # Full-tone freque... |
<filename>tests/test_transformers.py
import pytest
import numpy as np
from scipy import sparse as sp
from mercari.transformers import *
@pytest.fixture()
def df():
return pd.DataFrame({
'name': ['this is a name'],
'item_description': ['This is a description'],
'item_condition_id': ['1'],
... |
<filename>test_mixed1.py<gh_stars>0
import numpy as np
#from Tkinter import *
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from scipy.stats import norm as ndist
from scipy.stats import t as tdist
import random
from selectinf.randomized.multitask_lasso import multi_task_lasso
from selectinf.t... |
<filename>evaluate_umdl_result.py
from __future__ import division, print_function, absolute_import
import os
import numpy as np
from scipy.io import loadmat
from utils.file_helper import write
def extract_info(dir_path):
infos = []
for image_name in sorted(os.listdir(dir_path)):
if '.txt' in image_... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 13 20:11:13 2019
@author: user
"""
from keras.models import load_model
import librosa
import numpy as np
import csv
from scipy.signal import medfilt, filtfilt, butter
import amfm_decompy.pYAAPT as pYAAPT
import amfm_decompy.basic_tools as basic
from madmom.features.downb... |
<gh_stars>1-10
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import os
from skimage import data
def read_data(filename):
with open(filename, 'r') as f:
lines = f.readlines()
num_points = len(lines)
dim_points = 28 * 28
data = np.empty((num_points, di... |
# file with my planet class
import os
import numpy as np
import pandas as pd
import astropy.units as u
from astropy import constants as const
import scipy.optimize as optimize
from scipy.optimize import fsolve
from platypos.lx_evo_and_flux import flux_at_planet, flux_at_planet_earth
from platypos.mass_evolution_funct... |
<reponame>dung-n-tran/sargan
import matplotlib as mpl
# mpl.use('Agg')
import matplotlib.pyplot as plt
plt.style.use("seaborn-poster") ### Use this for figures used in posters
# plt.style.use("seaborn-paper") ### Use this for figures used in paper
# plt.style.use("seaborn-talk") ### Use this for figures used in present... |
import os
import numpy as np
import numpy.testing as npt
import scipy.io as sio
import nibabel as nib
import MRS
import MRS.data as mrd
data_folder = os.path.join(os.path.join(os.path.expanduser('~'), '.mrs_data'))
file_name = os.path.join(data_folder, 'pure_gaba_P64024.nii.gz')
if not os.path.exists(file_name):
... |
import collections
import logging
import operator
import statistics
import pandas
from django.db import transaction
from django.db.models.functions import Lower
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from jcasts.podcasts.models import Catego... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.