text string |
|---|
<gh_stars>0
"""Functions relating to pairs of regions."""
import numpy as np
import pandas as pd
import scipy.spatial as spa
def build_get_neighbors(criteria, cutoff):
"""Build a neighbor function to check if two subunits are neighboring."""
def get_neighbors_param(df0, df1):
return get_neighbors(df... |
import time
import multiprocessing
import numpy as np
import torch
import gpytorch
from scipy.optimize import minimize
from control_objects.abstract_control_obj import BaseControllerObject
from utils.utils import save_plot_model_3d_process, save_plot_2d, create_models
# precision double tensor necessary for the gaus... |
# ********************************************************************************** #
# #
# Project: FastClassAI workbecnch #
# ... |
<gh_stars>0
""" Functions for adding calibration factors to waveform templates.
"""
import numpy as np
from scipy.interpolate import interp1d
def read_calibration_file(filename, frequency_array, number_of_response_curves, starting_index=0):
"""
Function to read the hdf5 files from the calibration group conta... |
<reponame>tandriamil/copula-shirley
"""
* Copyright <2019> <<NAME>>
* https://github.com/thierryr/dpcopula_kendall
"""
"""
privatise.py
Functions that transform histograms to be differentially private.
Enhanced Fourier Perturbation Algorithm (EFPA) technique is from
http://planete.inrialpes.fr/~ccastel/PAPERS/AcsCC1... |
import sys
import random
import traceback
import pandas as pd
import numpy as np
from loguru import logger
from scipy.stats import norm, lognorm
from rpy2.robjects.packages import STAP
from rpy2.robjects.numpy2ri import numpy2rpy
from apamix.mix_utils import *
from utils.utils import dotdict
class EM:
@staticm... |
<filename>quadpy/ncube/_dobrodeev1970.py<gh_stars>0
from sympy import Rational as frac
from sympy import sqrt
from ..helpers import article, fsd, untangle, z
from ._helpers import NCubeScheme
_citation = article(
authors=["<NAME>"],
title="Cubature formulas of the seventh order of accuracy for a hypersphere a... |
from tqdm import tqdm
import scipy.io
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from skimage import img_as_float
import numpy as np
np.set_printoptions(threshold=np.nan)
def distance(x,y):
return np.sqrt(np.sum((x-y)**2))
plt.ion()
data = scipy.io.loadmat("C:\\Users\\admin\\Dropbox\\hw3\\faceda... |
from numpy import zeros, matrix
from numpy.random import rand
from numpy import linalg as LA
from scipy import sparse
import pandas as pd
import numpy as np
import logging
logger = logging.getLogger("logger")
logger.setLevel(logging.DEBUG)
class NeighbourModel:
def __init__(self, rating_mat=None, movies=None, use... |
# encoding=utf8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
from scipy.spatial.distance import cosine
from matplotlib import pyplot as plt
def adjacent_cos_distance(memory_bank):
memory_bank = torch.squeeze(memory_bank).detach().numpy... |
<gh_stars>0
# author: <NAME>, <NAME>, <NAME>, <NAME>
# date: 2020-06-08
'''This script will read in the Tf-idf vectorizer maxtrixes and train a Classifier Chain model.
It will save the model to the specified output directory. A results table which includes
accuracies for all data and precision, recall, and f1 scores ... |
<reponame>willyspinner/High-Performance-Face-Recognition
import scipy.io as sio
import pickle
import numpy as np
import os
import scipy.io as sio
import numpy as np
from sklearn.decomposition import PCA
from scipy import spatial
class TestCosineSimilarity(object):
def __init__(self):
# self.name = "C2test_feature"... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 3 17:01:58 2020
@author: Moritz
"""
"""Figs 5 B-D
This script reproduces the plots seen in Figs 5 B-D of "The biophysical basis underlying
the maintenance of early phase long-term potentiation".
This script requires that `numpy`,`scipy.integrate`,`matplotlib` and `se... |
"""
# Name: check_answer_api/utilities/expression_checker.py
# Description:
# Created by: Unknown
# Date Created: ---
# Last Modified: Dec 1, 2016
# Modified by: <NAME>
"""
from sympy import *
from sympy.parsing.sympy_parser import parse_expr
import answer_transformer
"""
Compare 2 Latex expressio... |
<gh_stars>1-10
import csv
import multiprocessing
import os
from dataclasses import dataclass, field
from typing import Callable, Dict, List, Optional, Union
try: # python 3.8+
from typing import Literal
except ImportError:
from typing_extensions import Literal
import numpy as np
import pandas as pd
import se... |
# The specific stylometric calculations in this file are modified versions of code from here.
# We changed them to compose with our existing pipeline infrastructure.
# https://github.com/Hassaan-Elahi/Writing-Styles-Classification-Using-Stylometric-Analysis
#===========================================================... |
<gh_stars>0
from scipy.stats._continuous_distns import expon_gen, gamma_gen
class reflect():
def pdf(self, x, *args, **kwargs):
return super().pdf(-x, *args, **kwargs)
def logpdf(self, x, *args, **kwargs):
return super().logpdf(-x, *args, **kwargs)
def cdf(self, x, *args, **kwargs):
... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 12 16:51:05 2016
@author: <NAME>
"""
import numpy as np
from scipy import optimize
from scipy.stats import norm
# from ...finutils.FinMath import N, nprime
from ...finutils.FinDate import FinDate
from ...finutils.FinMath import nprime
from ...finutils.FinGlobalVariable... |
from scipy.integrate import odeint
def deriv(x, t, params):
s, e, i, r = x
u = params['u_social_distancing']
t_social_distancing = params['t_social_distancing']
beta = params['beta']
alpha = params['alpha']
gamma = params['gamma']
exposed_becoming_infected = alpha * e
infected_becoming_... |
from utils.utils import sparse_to_adjlist
from scipy.io import loadmat
"""
Read data and save the adjacency matrices to adjacency lists
Paper: Reinforced Neighborhood Selection Guided Multi-Relational Graph Neural Networks
Source: https://github.com/safe-graph/RioGNN
"""
if __name__ == "__main__":
prefix = './d... |
<gh_stars>1-10
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import special_ortho_group
def sample_task(p, beta):
# Sample random orthogonal matrix
if p > 1:
U = special_ortho_group.rvs(p)
elif p == 1:
U = np.ones((1,1))
e... |
# This file is licensed under a GPLv3 License.
#
# GPLv3 License
# Copyright (C) 2018-2019 <NAME> (<EMAIL>)
#
# This program 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
... |
import numpy
import xraylib
import scipy.constants as codata
# needed by bragg_calc
from xoppylib.crystals.bragg_preprocessor_file_io import bragg_preprocessor_file_v2_write
from dabax.common_tools import f0_xop, f0_xop_with_fractional_charge
from dabax.common_tools import bragg_metrictensor, lorentz, atomic_symbols
... |
<gh_stars>0
# %% [markdown]
# ##
import os
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from scipy.integrate import tplquad
from scipy.stats import gaussian_kde
import pymaid
from src.data... |
import numpy as np
import matplotlib.pyplot as plt
import scipy
from metamodels.impl.meta_dace import DACE
from metamodels.impl.meta_matlab import Matlab
from metamodels.impl.meta_rbf import RBF
from pymoo.operators.sampling.real_random_sampling import RealRandomSampling
from pymoo.rand import random
from pymop.griew... |
<reponame>yuchensun97/MEAM620-Advanced-Robotics<gh_stars>1-10
import contextlib
import inspect
import json
import os
from pathlib import Path
import time
import unittest
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
from scipy.spatial.distance import cdist
fro... |
import logging
import argparse
import math
import scipy.integrate as integrate
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('in module %(name)s, in func %(funcName)s, '
'%(levelname)-8s: [%(filename)s:%(lineno)d] %(message)s')
stream_h... |
import numpy as np
from scipy.linalg import expm
import matplotlib.pyplot as plt
from time import time
class SSHIniData:
def __init__(self, tau, deltau, ctrl, knum=12*6+1, dt=.1, ham_choose = 3,iniband = 'down'):
self.tau = tau
self.deltau = deltau
self.knum = knum
self.dt = dt
self.ctrl = ctrl
self... |
<filename>ex8_anomaly_dection_and_recommender_systems/recommender_systems.py
"""
author: <NAME>
time: 05/03/2017
link:
"""
import numpy as np
import seaborn as sns
import pandas as pd
import scipy.io as sio
import scipy.optimize as opt
from matplotlib import pyplot as plt
import recommender as rc
mat_data_path = '.... |
import random, re, socket, traceback, time
from math import *
from sympy.parsing.sympy_parser import parse_expr
from format import CYAN, GREY, PURPLE, WHITE
sympy_active = True
try:
from sympy import *
from sympy.parsing.sympy_parser import parse_expr, eval_expr
except:
print 'SymPy not found; ignoring'
... |
from scipy.stats import chi2
import numpy as np
def getmask(scores, spike_index, groups, mask_th):
"""
Get mask of each data
Parameters
----------
scores: list np.array(n_data, n_features, n_channels)
spike_index: np.array(n_data, 2)
groups: list (n_channels)
coreset information... |
<reponame>Zekhire/pcaflow
#! /usr/bin/env python2
from pcaflow import PCAFlow
# To read images
from scipy.misc import imread
# To display
from matplotlib import pyplot as plt
from pcaflow.utils.viz_flow import viz_flow
PATH_PC_U = 'data/PC_U.npy'
PATH_PC_V = 'data/PC_V.npy'
PATH_COV = 'data/COV_SINTEL.npy'
PATH_COV... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import everest
import exoarch
import numpy as np
from scipy.signal import savgol_filter
__all__ = ["get_light_curve"]
def sigma_clip(f, thresh=5, window=49):
"""Get a binary mask of 'good' points using sigma clipping
Args:
thr... |
<reponame>CADWRDeltaModeling/vtools3<gh_stars>1-10
import unittest,random,pdb
## Datetime import
import datetime
## vtools import.
from vtools.data.timeseries import rts,its
from vtools.data.vtime import ticks,number_intervals
from vtools.data.vtime import ticks_to_time,ticks\
,number_intervals,time_sequence,t... |
"""
Tests for :func:`acoustics.signal`
"""
from acoustics.signal import convolve as convolveLTV
from scipy.signal import convolve as convolveLTI
import numpy as np
import itertools
from acoustics.signal import * #decibel_to_neper, neper_to_decibel, ir2fr, zero_crossings
from numpy.testing import assert_almost_equal, a... |
<filename>meshparty/skeleton_quality/multicut.py
import networkx as nx
from meshparty.meshwork import Meshwork
from meshparty.trimesh_io import Mesh
import pandas as pd
import numpy as np
from scipy import sparse
def _build_multicut_graph(nrn):
G = nx.from_scipy_sparse_matrix(nrn.mesh.csgraph)
G.add_node('so... |
# RCS14_entrainment_naive.py
# Generate timeseries analysis and power estimate
# Author: maria.olaru@
import os
from matplotlib import pyplot as plt
import numpy as np
import scipy.signal as signal
import pandas as pd
def get_name(gp, out_name_full):
out_plot_dir = gp + '/' + 'plots/'
if not os.path.isd... |
from sympy import Eq
from devito.dimension import SubDimension
from devito.equation import DOMAIN, INTERIOR
from devito.ir.equations.algorithms import dimension_sort
from devito.ir.support import (IterationSpace, DataSpace, Interval, IntervalGroup,
Any, Stencil, detect_accesses, detect_o... |
"""
The following code has been translated from R package pagoda2, if you use any of these functions please cite:
<NAME>, <NAME>, <NAME> and <NAME> (2021). pagoda2: Single Cell Analysis and Differential
Expression. R package version 1.0.2.
"""
from anndata import AnnData
import pandas as pd
import numpy as np
import ... |
<reponame>ZiUNO/NLP
# -*- coding: utf-8 -*-
"""
* @Author: ziuno
* @Software: PyCharm
* @Time: 2019/7/3 10:26
"""
import os
import string
import matplotlib.pyplot as plt
import numpy as np
import scipy
import zhon.hanzi as hanzi
from nltk import pos_tag
from nltk.corpus import stopwords
from nltk.stem import WordNetL... |
<gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
import pandas as pd
from matplotlib.colors import ListedColormap,LinearSegmentedColormap
import matplotlib as mpl
from matplotlib.pyplot import MultipleLocator
# Generate fake data
df= pd.read_csv(r'datasets\pointd... |
"""
created by weiyx15 @ 2019.1.4
Cora dataset interface
"""
import random
import numpy as np
from config import get_config
from utils.construct_hypergraph import edge_to_hyperedge
import pickle as pkl
import networkx as nx
import scipy.sparse as sp
def parse_index_file(filename):
"""
Copied from gcn
Par... |
<reponame>htalebiyan/Dec2py
import pandas as pd
import pickle
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib as mplt
import numpy as np
from scipy.stats.stats import pearsonr
sns.set(context='notebook', style='darkgrid', font_scale=1.2)
plt.close('all')
FILTER_SCE = '../../data/damagedElements... |
"""
This file integrates open-source code (https://github.com/ramvasudevan/soft-robot-koopman) with Sofa.
Open-source code accompanies following papers:https://arxiv.org/abs/1902.02827 (Modeling and Control of Soft Robots
Using the Koopman... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Othala.CRR.py
Created : 2019-07-17
Last update : 2022-02-24
MIT License
Copyright (c) 2022 <NAME> (Gonzalez5487), <NAME> (SPRBiosensors), Université de Montréal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associa... |
<reponame>christopherburke/TESS-ExoClass
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 28 11:51:04 2018
Calculate the skyline histogram of cadences that contribute to all
TCEs. This is used to avoid cadences contribute strongly to detections
implying that something is wrong with this data to in... |
# -*- coding: utf-8 -*-
"""
model_functions.py
~~~~~~~~~~~~~
Functions for building a movement classification model features
"""
import numpy as np
import scipy
from scipy.signal import butter, lfilter, periodogram
from sklearn.ensemble import RandomForestClassifier
from sliding_window import sliding_window
# media... |
import itertools
import logging
import os
from typing import List, Optional
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.style
import numpy as np
import pandas as pd
import scipy
import seaborn
from ..data import (
BEDCOUNT_COLUMNS, DEPARTMENTS, DEPARTMENTS_GRAND_EST, load_all_data,
load_co... |
<reponame>NWPU-903PR/DGMP<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 17 22:27:20 2021
@author: xjy
"""
import scipy.sparse as sp
import pandas as pd
import numpy as np
import networkx as nx
import random
import os
A = pd.read_table('/home/disk1/xujingyu/DGMP/network/human.source',header = ... |
<reponame>lsstdarkmatter/ugali<filename>ugali/utils/bayesian_efficiency.py
"""
Documentation.
"""
import scipy.special
import numpy
import numpy as np
############################################################
def gammalnStirling(z):
"""
Uses Stirling's approximation for the log-gamma function suitable fo... |
import os
import sys
from random import shuffle
import numpy as np
from scipy.io import wavfile
import yaml
import librosa
from tqdm import tqdm
if __name__=='__main__':
import librosa.display
import pdb
import time
import matplotlib.pyplot as plt
# don't use librosa for reading, use s... |
#### SIMPLICIAL COMPLEX NEURAL NETWORK LEARN FUNCTIONS!
import torch
from torch.autograd import Variable
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
class SCN(torch.nn.Module):
def __init__(self, visible_num, input_dim, visible_units, depth, model=1):
super(SCN, self).... |
<reponame>BMJHayward/infusionsoft_xpmt<filename>examples/IS_sales_leadsources_2008_2015.py
import numpy as np
import scipy as sp
import pandas as pd
import matplotlib
from matplotlib import pyplot as plt
import seaborn as sbrn
import datetime
import dateutil
import sys, os
import xlrd, xlwt
dateparse = dateutil.parse... |
#!/usr/bin/python
import numpy as np
import cvxpy as cvx
import scipy.sparse as sp
import qcqp
from qcqp import utilities as u
n = 10
z = np.asmatrix(np.random.randn(n, 1))
A = np.asmatrix(np.random.randn(n, n))
A = (A+A.T)/2
b = np.asmatrix(np.random.randn(n, 1))
c = np.random.randn()
# Solve using SDP relaxation
x ... |
# --------------
# 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")
print(numerical_var)
# code ends h... |
# Import the usual libraries
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from copy import deepcopy
from scipy.interpolate import interp1d
from astropy.io import fits
# Progress bar
from tqdm.auto import tqdm, trange
import webbpsf_ext
from webbpsf_ext.image_manip import fourier_imshift, fsh... |
import glob
import os
import pytest
import sympy
from gmso.lib.potential_templates import JSON_DIR, PotentialTemplateLibrary
from gmso.tests.base_test import BaseTest
class TestPotentialTemplates(BaseTest):
@pytest.fixture
def templates(self):
return PotentialTemplateLibrary()
def test_singleto... |
<filename>unyt/unit_registry.py
"""
A registry for units that can be added to and modified.
"""
# -----------------------------------------------------------------------------
# Copyright (c) 2018, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the LICENS... |
<reponame>mfarrera/algorithm-reference-library<gh_stars>0
"""Function to manage sky components.
"""
import collections
import logging
from typing import Union, List
import astropy.units as u
import numpy
from astropy.convolution import Gaussian2DKernel
from astropy.coordinates import SkyCoord
from astropy.coordinate... |
<gh_stars>1-10
from sympy import symbols, integrate, pi, lambdify, Number, sin
from numpy.polynomial.legendre import leggauss
import scipy.sparse.linalg as sparse_la
import lega.fourier_basis as fourier
import lega.shen_basis as shen
import lega.legendre_basis as leg
from lega.common import tensor_product, function
fr... |
<gh_stars>1-10
# ===============================================================================
# Copyright 2019 ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... |
<filename>scripts/estN.py
#!/usr/bin/env python
import sys
import argparse
import pandas as pd
import numpy as np
from scipy.optimize import fsolve
def solve(n, *data): # dont know n or k, know x # of umis that collide bw genes, suppI_g support of I for the gene, suppI_c support of I for cell
x, suppI_g, suppI_c ... |
import argparse
import os
import numpy as np
import pandas as pd
import scipy.sparse as sps
import matplotlib.pyplot as plt
def main(args):
print('Loading using juicer')
chromosomes = range(1, 23) if args.chromosomes is None else args.chromosomes
dataset_path = '../../data/{}/hic_raw/'.format(args.dat... |
<filename>OoPython-ETo.py
#! /usr/bin/env python
## Soil-Plant-Atmospheric Continuum calculation emphasizing on surface energy balance
## Developed initially by Ardiansyah (UNSOED), http://ardiansyah.net
##ardiansyah@AL-FATIH-II:~/Desktop/oosheet-1.0$ oocalc OoPython-ETo.ods -accept="socket,host=localhost,port=2002;ur... |
import numpy.testing as npt
from scipy.special import hyp2f1
from pyHalo.Rendering.MassFunctions.mass_function_utilities import integrate_power_law_quad, integrate_power_law_analytic
import pytest
import numpy as np
class TestMassFunctionUtil(object):
def test_integrate_mass_function(self):
def _analyti... |
<reponame>MEscuderoVinolo/MobiNet-Video-CNN-Visualization<filename>optimize/gradient_optimizer.py
#! /usr/bin/env python
import os
import errno
import pickle
import datetime
import StringIO
from pylab import *
from scipy.ndimage.filters import gaussian_filter
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcPara... |
<filename>tsne_hsi_colors.py
"""Does the compute intensive tsne embedding for an HSI image.
"""
import numpy as np
from sklearn.manifold import TSNE
import os
import scipy.io as sio
import pdb
DATASET_PATH = os.environ['DATASET_PATH']
dataset_name, data_struct_field_name = ['Salinas_corrected.mat', 'salinas_correc... |
<gh_stars>0
# -*- coding: utf-8 -*-
# Psychopy supported Tobii controller for the new Pro SDK
# Authors: <NAME>
# Date: 8/3/2017
# Requirements: Python 2.7 32 Bit (SDK required)
# Tobii Pro SDK 1.0 for Python, and all dependencies
# Psychopy, Psychopy.iohub, and all dependencies
# numpy, scipy, and... |
<reponame>ahesford/pycwp
'''
These routines convert a segmented tissue model based on MRI data into acoustic
parameters of sound speed, attenuation and density for simulation of ultrasound
wave propagation.
'''
# Copyright (c) 2015 <NAME>. All rights reserved.
# Restrictions are listed in the LICENSE file distributed ... |
"""
Reads in and display a chunk of raw LFP synchronized on session time.
"""
# Author: <NAME>
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate
from oneibl.one import ONE
from ibllib.io import spikeglx
# === Option 1 === Download a dataset of interest
one = ONE()
# Get a specific session... |
<gh_stars>1-10
import numpy as np
from scipy.interpolate import CubicSpline
from scipy.fftpack import fft # built-in fft
# 1. Using DFT
# Return c_k series (k = 0, 1, -1, 2, -2, ..., order, -order)
def coeffs_mydft(x, order):
"""Use DFT."""
coeffs = [my_dft(x, 0)]
for k in range(1, order+1):
... |
<filename>code.py<gh_stars>0
# --------------
import pandas as pd
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import iqr
from scipy.stats import pearsonr
import statistics
def visual_summary(type_, df, col):
"""Summarize the Data using Visual Method.
This funct... |
<filename>Scripts/plot_ModelBiases_CompositeMaps_NoWindow.py
"""
Create composites of the raw data after removing the ensemble mean and then
calculating a rolling standard deviation
Reference : Barnes et al. [2020, JAMES]
Author : <NAME>
Date : 17 January 2021
"""
### Import packages
import matplotlib.pyplot... |
#!/usr/bin/env python
import scipy as sp
import trmf
Y = sp.load('datasets/electricity.npy')
#Y = Y[:-(7 * 24), :]
lag_set = sp.array(list(range(1, 25)) + list(range(7 * 24, 8 * 24)), dtype=sp.uint32)
#lag_set = sp.array(list(range(1, 7 * 24 + 1)), dtype=sp.uint32)
k = 60
lambdaI = 0.5
lambdaAR = 125
lambdaLag = 2
w... |
<reponame>juanmaro97/PID_evaporators
##### SECOND ORDER TRANSFER FUNCTION CONTROL SIMULATION #####
import numpy as np
from sklearn.metrics import mean_squared_error
import pandas as pd
from scipy import signal
import matplotlib.pyplot as plt
from scipy.integrate import odeint
from control import *
from multi_step impo... |
import h5py
import numpy as np
import matplotlib.pylab as plt
import pandas as pd
import os
from matplotlib import ticker
from heat_flux_adi import simulate_adi_temp
from scipy.signal import savgol_filter
import matplotlib as mpl
import json
import ir_thermography.thermometry as irt
import re
import shutil
import pla... |
# Refer to the following link for PyQt documentation:
# http://pyqt.sourceforge.net/Docs/PyQt4/classes.html
# Written for AMIS-30543 driver.
'''
At an RPM of 60 and an input of 200 steps in mode 1/1, takes motor 1 second to complete task
At an RPM of 120 and an input of 200 steps in mode 1/2, takes motor 1 second to c... |
import sys
import numpy as np
import matplotlib.patches as patches
import matplotlib.pyplot as plt
from scipy.interpolate import griddata
'''
usage: python wmap1.py <pmesh> <loc>
<pmesh> is the filename of pmesh file
<loc> is either 'bot' or 'top'
'''
def kart2frac(kart, latmat):
"""
convert cart coords into ... |
<gh_stars>1-10
import copy
import logging
from random import uniform
import matplotlib.pyplot as plt
import numpy as np
from morpho import BrillouinZonePath as BZPath
from morpho import SymmetryPoint as SPoint
from scipy.signal import find_peaks
from fdtd import EFieldDetector, Grid, HFieldDetector, Material
from fdt... |
<reponame>jhamrick/bayesian-quadrature<filename>bayesian_quadrature/tests/test_gauss_c.py<gh_stars>10-100
import numpy as np
import scipy.stats
import pytest
from .. import gauss_c
from .. import linalg_c as la
from . import util
import logging
logger = logging.getLogger("bayesian_quadrature")
logger.setLevel("DEBUG"... |
<filename>plots.py
import pandas as pd
from datetime import datetime
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy import stats
from sklearn.metrics import mean_squared_error
import numpy as np
from copy import deepcopy
from numpy import inf
from math import exp
from datetime import ti... |
# -*- coding: utf-8 -*-
import scipy as sp
import scipy.signal as sp_sig
from scipy.fftpack.realtransforms import dct
import pylufia.signal.spectral as sigspe
import pylufia.mir.feature as feature
def _make_mel_filterbank(n_mel_bands, fs, framesize, min_freq, max_freq):
""" Calculate mel-filterbank
... |
<reponame>anthony-walker/me499<gh_stars>10-100
#!/usr/bin/env python3
from cmath import sin
if __name__ == '__main__':
# As of Python 3, complex numbers are built in to the language. Here's how to assign them to variables.
a = 3 + 4j
b = 2j
c = complex()
d = complex(1)
e = complex(1, 2)
... |
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import Divider, Size
import pandas as pd
from scipy.optimize import curve_fit
from scipy.stats import linregress
# This script plots the in vitro data taken for purified Scarlet-His.
# Data were analyzed with SPT (... |
<reponame>loggerhead/nnOCR<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import glob
import subprocess
import config
import numpy as np
from scipy.io import loadmat as load
from PIL import Image
mat = load(config.thetas_path)
theta1 = np.asmatrix(mat['Theta1'].transpose())
theta2 = np.asmatrix(ma... |
import sympy as sym
import math
import numpy as np
from sympy import limit
from sympy import integrate
from sympy import diff
### Solving basic calculus problems using sympy
# 2
f2 = 6/(math.sqrt(6*0+4)+4)
print("Question 2: ", sym.limit(f2,0,0))
# 3
def f3(x3):
return ((x3 * -3) -18)/((x3**3) + (6 * (x3**2)))
p... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Import all needed Python packages and functions
from azureml.core import Run, Dataset, Workspace
from azureml.core.authentication import InteractiveLoginAuthentication
from azureml.core.run import _OfflineRun
impor... |
import platform
import time
import numpy as np
import scipy.sparse
from tensorpack import PredictConfig, get_model_loader, OfflinePredictor
from config import config as cfg
from tracking.argmax_tracker import PrecomputingReferenceTracker
from tracking.util import resize_and_clip_boxes, generate_colors, xyxy_to_cxcywh_... |
<filename>notebooks/118.2-BDP-forward-reverse-cascade.py
# %% [markdown]
# ## Imports
import os
import time
from itertools import chain
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import rankdata
from graspy.cluster import AutoGMM... |
# -*- coding: utf-8 -*-
"""
Created on Fri May 3 18:28:30 2019
@author: Any
"""
import pomegranate as pg
import pandas as pd
import numpy as np
from scipy.special import erfinv
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from sklearn.linear_model import LinearRegression
import statsmodels.api as sm
d... |
from polyglot.text import Text
from statistics import mean
import pandas as pd
from collections import defaultdict, Counter
import matplotlib.pyplot as plt
import numpy as np
"""
DUTCH
"""
# Prepare dictionaries
sents_sentiment = defaultdict(list)
# Read in data
tsv_file = "../data/nl/decoded_nl_greta_overview.tsv"
... |
#!/usr/bin/env python
P = [2
,3
,5
,7
,11
,13
,17
,19
,23
,29
,31
,37
,41
,43
,47
,53
,59
,61
,67
,71
,73
,79
,83
,89
,97
,101
,103
,107
,109
,113
,127
,131
,137
,139
,149
,151
,157
,163
,167
,173
,179
,181
,191
,193
,197
,199
,211
,223
,227
,229
,233
,239
,241
,251
,257
,263
,269
,271
,277
,281
,283
,293
,307
,311
,... |
"""ML-ENSEMBLE
:author: <NAME>
:copyright: 2017-2018
:licence: MIT
Correlation plots.
"""
from __future__ import division, print_function
import numpy as np
from scipy.stats import pearsonr
import warnings
try:
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from seaborn impor... |
<filename>pyclam/criterion.py
import logging
from abc import ABC, abstractmethod
from typing import Set, Tuple, List
import numpy as np
from scipy.spatial.distance import cdist
from pyclam.manifold import Cluster, Graph, Manifold
# TODO: class ChildTooSmall which checks % of parent owned by child, relative populati... |
from __future__ import print_function
import os
import numpy as np
import torch
import pickle
from datasketch import MinHashLSHForest
from datasketch import MinHash
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from scipy.spatial.distance import pdist, cdist, squareform
... |
from collections.abc import Iterable
import os
from random import randint
from astropy.io import fits
import cv2
from lacosmic import lacosmic
from matplotlib import pyplot as plt
import numpy as np
from PIL import Image
from scipy import interpolate
from skimage import filters
from skimage.morphology import disk
fro... |
import numpy as np
import scipy
import matplotlib.pyplot as plt
import statsmodels.api as sm
from matplotlib.collections import PatchCollection
from matplotlib.patches import Rectangle
import matplotlib.gridspec as gridspec
from hydroDL import utils
import string
import os
# manually add package
# os.environ[
# 'PR... |
<reponame>CogComp/EventProcessTyping<filename>run_joint/train_full_roberta_bias.py
import torch
print(torch.cuda.is_available())
from transformers import RobertaTokenizer, RobertaModel, GPT2Model, RobertaForMultipleChoice
import tqdm, sklearn
import numpy as np
import os, time, sys
import pickle
import multiproc... |
# Comparación de más de dos medias
# Vamos a comprarar los datos de ventas dependiendo de la condición meteorológica
# Importamos librerias
import os # Sistema operativo
import pandas as pd # Datasets
import numpy as np # Vectores, matrices
import matplotlib.pyplot as plt # Hacer gráficos
import scipy.stats as stats #... |
from typing import List, Tuple, Union
import re
import cmath
import operator as op
try:
from simpleeval import SimpleEval
except ImportError: # pragma: no cover
from calculate_anything.utils import StupidEval # pragma: no cover
SimpleEval = StupidEval # pragma: no cover
from calculate_anything.query.hand... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.