text string |
|---|
# Description: Functions to manipulate ROMS fileds.
# Author: <NAME>
# E-mail: <EMAIL>
__all__ = ['energy_diagnostics',
'vel_ke',
'pe',
'time_avgstd',
'make_flat_ini']
import numpy as np
from scipy.interpolate import interp1d
try:
from seawater import pres
from seawater import pden
fr... |
import math
import scipy.sparse as sp
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch_sparse
class SparseDropout(nn.Module):
def __init__(self, p):
super().__init__()
self.p = p
def forward(self, input):
value_dropped = F.dropout(input.storage.value(), ... |
import scipy
import SloppyCell
# We've had yet more trouble running in parallel, but these errors were actually
# killing the job without raising any error. So let's just only even try
# importing if we're the master node.
if SloppyCell.my_rank != 0:
raise ImportError
try:
from pylab import *
rc('lines',... |
import numpy as np
import pandas as pd
from scipy.spatial.distance import cdist
from .base import Sampler
class VoxelgridSampler(Sampler):
def __init__(self, *, pyntcloud, voxelgrid_id):
super().__init__(pyntcloud=pyntcloud)
self.voxelgrid_id = voxelgrid_id
def extract_info(self):
s... |
<filename>Python Files/Modify.py
import sys
#sys.getdefaulencoding()
import pylatex
import numpy as np
from sympy.matrices import Matrix
from sympy import *
from PyQt5 import QtGui as qtg
from PyQt5 import QtCore as qtc
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from PyQt5 import QtCore, QtGui, QtWidgets
f... |
import sys
import time
import logging
import threading
import GPy
import numpy as np
import matplotlib.pyplot as plt
import pdb
from GPhelpers import *
from IPython.display import display
from poap.strategy import FixedSampleStrategy
from poap.strategy import InputStrategy
from poap.tcpserve import ThreadedTCPServer
fr... |
<reponame>chrstrom/TTK4250
"""
Notation:
----------
x is generally used for either the state or the mean of a gaussian. It should be clear from context which it is.
P is used about the state covariance
z is a single measurement
Z are multiple measurements so that z = Z[k] at a given time step k
v is the innovation z - ... |
import wx
import cmath
from ComplexPoint import ComplexPoint
class ZeroPoleFrame(wx.Frame):
def __init__(self, parent, title = "", size = (800,600), pos = (0,0), isReal = True, data = None):
wx.Frame.__init__(self, parent, -1, title = title, size=size, pos=pos)
panel = wx.Panel(self)
panel.Bind(wx.EVT_PA... |
# Authors: <NAME> <<EMAIL>>
# License: MIT
import csv
import gc
from sklearn import preprocessing
from random import randint
from scipy import stats
from dateutil.parser import parse
# Two fundamental problems with determining whether 1st row is header:
# 1.) If all elements (including the header) are numbers, cod... |
from scipy.stats import norm
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
import pandas as pd
import numpy as np
import shutil
import os
input_folders = ["directory_1/",
"directory_2/",
"directory_3/",
"directory_4/"
]
output_folder = "Experiment_X-description/raw_data/" ### Change ... |
import csv
import glob
import random
import numpy as np
import scipy as sp
import scipy.signal
import pretty_midi
import tensorflow as tf
import sympy
seed = 4
FP_SF2_PATH = "/usr/share/soundfonts/freepats-general-midi.sf2"
vilulia = "./shapenote_midi/312b.mid"
with open('freepats_instruments.csv', newline='') as csv... |
import operator as op
from fractions import Fraction
from functools import reduce
lst_a = list(range(1,11))
lst_b = ['张三','李四','王五']
print(lst_a)
print(lst_b)
a=reduce(op.add,lst_a,0)
b=reduce(op.add,lst_b,'')
print(a)
print(b)
a=sum(lst_a)
print(a)
# b=sum(lst_b)
# print(b)
lst_a = [1,2,3,4,5]
a=reduce(op.mul,lst... |
<gh_stars>1-10
"""""
Old BRL UTIL code. Temporary Trash codes.
"""""
import sys
sys.path.insert(0,'/usr/local/lib/python2.7/site-packages')
import matplotlib.pyplot as plt
#from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from scipy.stats import norm
import pdb
from matplotlib import cm
from operator impor... |
<reponame>xuehaouwa/moviepy-make-video
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 21 09:46:26 2017
@author: 21992674
"""
from moviepy.editor import VideoClip
import cv2
import numpy as np
from moviepy.editor import VideoFileClip, concatenate_videoclips
from scipy.spatial import distance
from sklearn.c... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 01 10:00:58 2021
@author: <NAME>
"""
#------------------------------------------------------------------#
# # # # # Imports # # # # #
#------------------------------------------------------------------#
import numpy as np
import pan... |
"""
This script gets the statistics of the results and plot the result figures.
Example:
$ python stats.py --mode all_speedup
Modes:
* all_speedup: Bar plot of speedups of the optimized graphs
* equivalent: Get number of equivalent graphs explored
* optimizer: Bar plot of the optimizer time
* mult... |
<filename>ObsDist/Observed.py
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 29 10:02:43 2016
@author: <EMAIL>
"""
import numpy as np
import scipy.interpolate as interpolate
import scipy.integrate as integrate
import ObsDist.Population as Population
class Observed(object):
"""This class contains all the methods ... |
<filename>massage/resynth/util.py
import json
import os
from random import choice
import jams
import librosa
import numpy as np
import scipy
from massage import SF_PATH, ACOUSTIC_SF_MFCC
def compute_avg_mfcc(fpath=None, y=None, sr=None):
""" Compute the average mfcc of a signal y
Parameters
----------
... |
"""
@author: Shy118
@IP: GlobalFoundries Singapore
"""
import warnings
warnings.filterwarnings("ignore")
import traceback, sys, os
from PyQt5 import QtWidgets as qtw
from PyQt5 import QtCore, QtGui
from PyQt5 import QtWebEngineWidgets
from PyQt5.QtGui import QColor, QIcon, QPixmap, QImage, QFont
from PyQt5... |
"""Chapterisation module"""
__all__ = ['Chapter', 'Chapters', 'OGMChapters', 'MatroskaXMLChapters',
'MplsChapters', 'MplsReader',
'IfoChapters', 'IfoReader']
import os
import random
from abc import ABC, abstractmethod
from fractions import Fraction
from pprint import pformat
from typing import L... |
<filename>system_desing.py
# -- --------------------------------------------------------------------------------------------------- -- #
# -- project: A python project for algorithmic trading in FXCM -- #
# -- -------------------------------------------------------------------... |
from psola import pitch_marking, divide_into_segments, change_pitch, psola
import librosa
from yin_algorithm import yin_pitchtracker, median_filter, pitch_to_samples
from scipy.io.wavfile import write
import numpy as np
import statistics as st
import matplotlib.pyplot as plt
import warnings
warnings.filterwarni... |
<reponame>bogdanvbalan/Behavioral-Cloning<filename>model.py
import csv
import cv2
import numpy as np
from keras.models import Sequential, Model
from keras.layers import Flatten, Dense, Conv2D, MaxPooling2D, Lambda, Cropping2D, Dropout
from scipy import ndimage
import os
from sklearn.model_selection import train_test_sp... |
import numpy as np
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from scipy.cluster.vq import kmeans2
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from tensorflow.train import AdamOptimizer
import sys
sys.path.append('../..')
from dgps_pepmcm.gp_network import GPNetwork
def bimodal... |
<reponame>bopopescu/django-with-kafka
import requests
import json
from scipy.io import wavfile
class audio:
def __init__(self):
print("\nKafkaCore...")
## Fs X
def readAudioFsX(self, filename):
print("\nreadAudio...")
print(filename)
fs, x = wavfile.read(filename)
... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy.fft import fft, fftfreq
# Optional package import
try:
import pytest
except ImportError:
raise RuntimeError(
"In order to perform the tests you need the 'pytest' package.")
try:
from SciDataTool import DataLinspace, DataTime
except ImportError:... |
r"""
===============================================================================
Submodule -- diffusive_conductance
===============================================================================
"""
import scipy as sp
def conduit_conductance(physics, phase, network, throat_conductance,
... |
<reponame>matiasleize/fR-MCMC
import sympy as sym
from sympy.utilities.lambdify import lambdify
import numpy as np
import math
from scipy.constants import c as c_luz #metros/segundos
c_luz_norm=c_luz/1000;
import sys
import os
from os.path import join as osjoin
from pc_path import definir_path
path_git, path_datos_glo... |
<filename>Fit.py
# -*- coding: utf-8 -*-
"""
Created on Jan - 2021
@author: <NAME>
"""
###############################################################################
import numpy as np
from scipy.optimize import curve_fit
import warnings
import pickle
from sklearn.metrics import mean_squared_error, r2_score
import... |
<filename>tests/unit/lib/test_scaling.py
"""Unit tests for scaling.py."""
import os
from statistics import mean
from sbws.lib import scaling
from sbws.lib.resultdump import load_result_file, ResultSuccess
def test_bw_filt():
bw_measurements = [
96700.00922329757, 70311.63051659254, 45531.743347556374,
... |
import csv
import os
import time
import numpy as np
import scipy.io
def _load_class_names(file_name):
"""Load the class names."""
# Open the TSV file and skip its header.
with open(file_name, "rt") as f:
csv_reader = csv.reader(f, delimiter="\t")
next(csv_reader)
# The class nam... |
# coding: utf-8
# **Chapter 9 – Up and running with TensorFlow**
# _This notebook contains all the sample code and solutions to the exercises in chapter 9._
# # Setup
# First, let's make sure this notebook works well in both python 2 and 3, import a few common modules, ensure MatplotLib plots figures inline and pr... |
<reponame>Xen0byte/growthbook
from abc import ABC, abstractmethod
from warnings import warn
import numpy as np
from scipy.stats import beta, norm, rv_continuous
from scipy.special import digamma, polygamma, roots_hermitenorm
from .orthogonal import roots_sh_jacobi
EPSILON = 1e-04
class BayesABDist(ABC):
dist: rv... |
<reponame>dr1315/Collocation_v2<gh_stars>0
import os
import sys
import numpy as np
import pandas as pd
from pysolar.solar import get_altitude_fast
from pyorbital.orbital import get_observer_look
from pyorbital.astronomy import get_alt_az
import datetime as dt
from datetime import timezone
sys.path.append("/g/d... |
"""
Class representing a Truncated Normal distribution, with a=0 and b-> inf,
allowing us to sample from it, and compute the expectation and the variance.
truncnorm: a, b = (myclip_a - my_mean) / my_std, (myclip_b - my_mean) / my_std
loc, scale = mu, sigma
We get efficient draws using the libra... |
import os
import pathlib
import h5py
import numpy as np
from scipy.constants import c, e
from scipy.stats import linregress
from scipy.signal import hilbert
from LHC import LHC
from PyHEADTAIL.particles.slicing import UniformBinSlicer
from PyHEADTAIL.impedances.wakes import WakeTable, WakeField
from PyHEADTAIL.feedba... |
<filename>samfp/old/wcal.py
#!/usr/bin/env python2
# -*- coding: utf8 -*-
"""
Wavelength Calibration
This script calculates the wavelength calibration using a Terminal Interface
with the User.
"""
from __future__ import division, print_function
import argparse
import astropy.io.fits as pyfits
import loggi... |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 9 20:51:36 2019
@author: jasonmeverett
"""
from numpy import *
from ananke.util import unit
from scipy.linalg import norm
from scipy.spatial.transform import Rotation as R
def calc_o_odot(a,e,nu,mu,degrees=False):
if degrees:
... |
from matplotlib.colors import Normalize
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import pandas as pd
import numpy as np
from math import pi, log
from scipy.stats import rankdata
# === setup problem space, either real or Karpathy toy problem for... |
<filename>analysis/pokemon_normal_dist_and_actual_vals.py
import numpy as np
import scipy.stats
import loaddata
separator = '---------------------------------------------------------------'
tab: str = "\t"
def less_than_high(stat_values, mean, std_dev, test_high, set_name, stat_name, set_type, unit=''):
# how ma... |
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import json
import torch.utils.data as data
import torch
from scipy.spatial import distance
from utils import ioa_with_anchors, iou_with_anchors
def load_json(file):
with open(file) as json_file:
json_data = json.load(json_file)
return... |
import numpy as np
from numpy.core.defchararray import upper
import pandas as pd
from scipy.optimize import minimize
import warnings
from . import utility_functions as utility_functions
import cvxpy as cp
class ConvexOptimiser:
def __init__(self, n, tickers, weight_bounds=(0, 1)) -> None:
self.n = n
... |
<filename>1400OS_05_Codes/PosTagFreqVectorizer.py
import re
import scipy.sparse as sp
import nltk
from operator import itemgetter
from collections import Mapping
from sklearn.base import BaseEstimator
from sklearn.feature_extraction.text import strip_accents_ascii, strip_accents_unicode
from collections import Counter
... |
<filename>tests/test_PVDER_ThreePhase.py
from __future__ import division
import sys
import os
import argparse
import logging
import unittest
import math
import cmath
import matplotlib.pyplot as plt
from pvder.DER_components_three_phase import SolarPVDERThreePhase
from pvder.grid_components import Grid
from pvder.dyn... |
<filename>get_results.py
from sklearn.metrics import roc_auc_score
import numpy as np
from scipy.stats import rankdata
import sys
def compute_auc(groups, true, false, rank = False):
aucs = []
y_ranks = []
for group in groups:
y_pred = np.concatenate((true[group], false[group]))
y_true = np.... |
"""
Module with reading functionalities for isochrones.
"""
import configparser
import os
import warnings
from typing import Optional, Tuple
import h5py
import numpy as np
from typeguard import typechecked
from scipy.interpolate import griddata
from species.core import box
from species.read import read_model
cla... |
"""
Compute pattern correlation between images
Reference : Kay et al. (2015, BAMS)
Author : <NAME>
Date : 24 November 2020
"""
### Import modules
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap, addcyclic, shiftgrid
import cmocean
import palettable.cubehelix as cm
i... |
<reponame>kentlingcampbell/CU_HIN
# IP-to-IP matrix for CU HIN project
# import libraries
import argparse
import pandas as pd
import scipy.sparse as sp
import time
def checkPrune(IPD):
# dict1 = {'a': 1, 'b': 2, 'c': 3, 'd': 4}
# key_to_lookup = 'a'
# if key_to_lookup in dict1:
# print("Key exists")... |
import argparse
import os
import IPython
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import torch
from context import utils
from utils.misc import get_equal_dicts
parser = argparse.ArgumentParser(description='Monitorer')
parser.add_argument('-d', type=str, default=None, metavar='--director... |
'''
Authors: Dr. <NAME> and Dr. <NAME>
Required packages: numpy, scipy, scikit-learn
The primary purpose of this module is to remove and load the ground. The function removeGround() uses the TreePointCloud()
class to remove the ground from the input pointcloud, and save the ground as a mesh (plyfile). ... |
<filename>pyNA/src/aircraft.py
import pdb
import json
import numpy as np
import pandas as pd
from dataclasses import dataclass
from pyNA.src.settings import Settings
from scipy import interpolate
@dataclass
class Aircraft:
"""
Aircraft class containing vehicle constants and aerodynamics data.
"""
# V... |
import Fourier
import time
import numpy as np
from numpy import random
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
Error=[]
MeanSquareError=[]
TransformedDataDFT=[]
TransformedDataFFT=[]
Sampels=[]
TimeBeforeFFT=[]
TimeAfterFFT=[]
TimeDifferenceFFT=[]
TimeBeforeDFT=[]
TimeAfterDFT=[]
TimeDiff... |
<filename>egg/zoo/color_signaling/tools.py<gh_stars>1-10
import logging
import os
from urllib.request import urlretrieve
import numpy as np
from scipy.special import logsumexp
from skimage import color
PRECISION = 1e-16
def get_logger(logger_name):
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Thur Oct 22 09:20:17 2020
@author: <NAME> and <NAME>
"""
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import warnings
import random
import math
import torch
from sklearn import neighbors
from sklearn import metrics
... |
<gh_stars>10-100
import math
from scipy.stats import binom
def ncr(n,r):
f = math.factorial
return f(n) / f(r) / f(n-r)
# setting the values
# of n and p
beta = 10
p = 1.0/(4.3*30*24)#-math.exp(-1/(4.3))
print p
# obtaining the mean and variance
mean, var = binom.stats(beta, p)
# list of pmf values
#... |
import numbers
from dataclasses import dataclass
from enum import auto, Enum
from typing import Union
import numpy as np
from mlib.boot import log
from mlib.boot.lang import isstr
from mlib.boot.mlog import err, progress
from mlib.boot.stream import append, arr, arrayfun, bitwise_and, invert, isnan, itr, listfilt, nd... |
import argparse
import os
import traceback
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
import scipy.io
import scipy.misc
import numpy as np
import pandas as pd
import PIL
import time
import tensorflow as tf
from keras import backend as K
from flask import Flask, Response
from kafka import Kafka... |
"""
Finding the best straight line through a set of points
"""
import numpy as np
import math
from pylab import *
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
class ImportTest:
def data(filename):
file_object = (open(filename, 'r')).readlines()
xdata = []
ydat... |
<reponame>chipmuenk/python_snippets<filename>dsp_fpga/06_FIL/FIL_BPSK_Frame.py
# -*- coding: utf-8 -*-
#!/usr/bin/python
# BPSK digital modulation: modified example
# by <NAME>
from scipy import *
from math import sqrt, ceil # scalar calls are faster
from scipy.special import erfc
import matplotlib.pyplot as ... |
from collections import defaultdict
from scipy.special import expit
import numpy as np
import pandas as pd
import torch
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
import seaborn as sns
def average(vals):
return sum(vals) / len(vals)
def std(vals, mu):
var = sum([((x - mu) ** 2) for x in ... |
<reponame>simonverret/deep_continuation<gh_stars>0
#%% modules
import numpy as np
from numpy.linalg import norm, pinv
import matplotlib.pyplot as plt
#%% Simple ill-conditionned matrix
def eps_matrix(eps, dim1, dim2):
return (np.ones((dim1,dim2)) + np.vstack([eps*np.eye(dim2)]+[np.zeros(dim2) for i in range(dim1-... |
<reponame>Ulti-Dreisteine/data-information-measurement
# -*- coding: utf-8 -*-
"""
Created on 2021/12/20 15:02:34
@File -> knn_entropy.py
@Author: luolei
@Email: <EMAIL>
@Describe: 基于K近邻估计的信息熵
"""
__doc__ = """
本代码用于对一维和多维离散或连续变量数据的信息熵和互信息进行计算.
连续变量信息熵使用Kraskov和Lombardi等人的方法计算, Lord等人文献可作为入门;离散变量信息熵则直接进行计算... |
import pickle as pkl
import numpy as np
import scipy.sparse as sp
import torch
import networkx as nx
from sklearn.metrics import roc_auc_score, average_precision_score, accuracy_score, f1_score, log_loss
import matplotlib.pyplot as plt
## Miscellaneous useful functions ##
def load_graph_to_numpy(path_to_edgelist):
... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import least_squares, curve_fit
def steady_state_potential(xdata,HistBins=100):
"""
Calculates the steady state potential.
Parameters
----------
xdata : ndarray
Position data for a degree of freedom
HistBins : int... |
from numbers import Rational
from hypothesis import given, strategies as st
from hypothesis.strategies import data, composite
from hypothesis.extra.numpy import (
array_shapes,
basic_indices,
broadcastable_shapes,
mutually_broadcastable_shapes,
)
import numpy as np
import sparse
import scipy.sparse
fro... |
import numpy as np
from baselines import util
import os
import copy
import nltk
#import crf
import scipy.special
import sklearn
class HMM:
"""
Hidden Markov Model
"""
def __init__(self, n, m):
"""
fix n, m
:param n: number of states
:param m: number of observations
... |
"""Tools for topological associated domain analysis."""
from typing import Union, Tuple
import numpy as np
from scipy import sparse
from .utils.numtools import mask_array, get_diag, cumsum2d
from .utils.utils import suppress_warning
@suppress_warning
def di_score(matrix: Union[np.ndarray, sparse.csr_matrix],
... |
<gh_stars>0
import numpy as np
from scipy import interpolate as ip
import forward_model as fmodel
import time as tm
import scipy.optimize as opt
import matplotlib.pyplot as plt
from configparser import ConfigParser as scp
from matplotlib.font_manager import FontProperties
Nfeval = 1 #number of epochs in optimization c... |
<reponame>stylekilla/syncmrt
import numpy as np
from scipy import ndimage
import logging
def optimiseFiducials(pts,data,extent,markersize,threshold):
'''
Optimise fiducials will take an ROI around a point and re-center it based on the pixel values.
- Requires points in mm (x-horizontal then y-vertical)
- requires ... |
# Math and data related packages
import numpy as np
from numpy import inf, log, log10, absolute, angle, sqrt
import pandas as pd
from math import pi
from scipy.optimize import minimize, Bounds
import matplotlib.pyplot as plt
# DRTtools related package
import general_fun as gf
import Bayes_HT as BHT
from hmc_e... |
#!/usr/bin/python
########Description of the program############
###This program is the recopilation of all the useful funtions
from __future__ import division
import math
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from scipy.misc import*
from numpy import*
import numpy as np #This for a confution b... |
<gh_stars>1-10
"""
Routines to estimate reconstruction efficiency:
- :class:`MeshFFTCorrelation`: correlation
- :class:`MeshFFTTransfer`: transfer
- :class:`MeshFFTPropagator`: propagator
This requires the following packages:
- pmesh
- pypower, see https://github.com/adematti/pypower
"""
import os
import... |
# (c) <NAME> & <NAME>
# routines for fitting histograms
import numpy as np
import scipy.special as sps
MAX_NEWTON_ITERATIONS = 1000
def gauss_fit(data, binwidth=None):
"""
Fits a Gaussian pdf to a set of independent values (data) using
maximum likelihood estimators. If fitting to a histogram, the
re... |
<filename>scripts/amd-throughput.py
#!/usr/bin/python3
import subprocess
import re
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
import csv
import commons
import statistics
from matplotlib.patches import Patch
fname_throughput = "data/amd-throughput.csv"
csvf = open(fname_t... |
#!/usr/bin/env python
# pipescaler/core/misc.py
#
# Copyright (C) 2020-2021 <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license.
from __future__ import annotations
from os import listdir
from os.path import basename, splitext
from typing import... |
'''
Run Deconvolution
=================
This script will run the deconvolution on every exponential sweep in the
dataset to produce the impulse response of every source location recorded.
Author: 2018 (c) <NAME>
License: MIT License
'''
import sys, argparse, os
from scipy.io import wavfile
import numpy as np
sys.pat... |
<reponame>TUCMath/optimal-predictor<filename>shape_optimizer.py
from numpy import load, array, zeros, reshape, cos, pi, arange, append, ones, random
from numpy import matmul, diag, piecewise, sum, ravel, save, meshgrid
from numpy.linalg import norm
from numpy.random import rand
from tensorflow.keras.models import load_... |
#!/usr/bin/env python
# coding: utf-8
# In[21]:
#https://stackoverflow.com/questions/10884668/two-sample-kolmogorov-smirnov-test-in-python-scipy
#https://www.machinelearningplus.com/machine-learning/evaluation-metrics-classification-models-r/
# Essentials
import pandas as pd
import numpy as np
import time
import sy... |
<gh_stars>1-10
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib
import pandas as pd
pi=math.pi
#df = pd.read_csv('../Data/magnetic_WDs.csv')
#print df.shape[0]
#print df.columns
df = pd.read_csv('./gaiadr2_maincuts_wds.csv')
print(df.shape[0])
print(df.column... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import kde
#
def kernel(ax,
X,
Y,
):
"""
Draws in a subplot the 2d kernel of a set of points.
:param ax: The ax to fill
:param X: X-coordinates of the points
:param Y: Y-coordina... |
import numpy as np
import pandas
import random
import re
import sys
from scipy.stats import pearsonr, spearmanr
def computeProjectSet(list, splitRule, categories):
resulting_set = set()
base_link = "https://gitlab.com"
for name in list:
if splitRule != "":
splittedName = name.split(sp... |
<reponame>cvxgrp/qcml<gh_stars>10-100
from .. import codes
from .. codes.encoders import toPython
import scipy.sparse as sp
import numpy as np
import itertools
# TODO: add test cases for C + Matlab here
"""
CVXOPT data structures....
python_objects = [
(ConstantCoeff(3.2), '3.2'),
(OnesCoeff(3, ConstantCoeff(... |
<gh_stars>1-10
import doseresponse as dr
import argparse
import numpy as np
import sys
import numpy.random as npr
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import scipy.stats as st
import itertools as it
import multiprocessing as mp
import time
#import warnings
#warnings.filterwarnings("er... |
""" Implementation of TopicRank """
from itertools import chain, combinations, product
import networkx as nx
import numpy as np
from scipy.cluster.hierarchy import linkage, fcluster
from scipy.spatial.distance import pdist
from ._phrase_constructor import PhraseConstructor
__all__ = 'TopicRank'
class TopicRank:
... |
import matplotlib
matplotlib.use('Agg')
import glob
import matplotlib.pyplot as plt
from PIL import Image, ImageOps
#Autograd
import autograd.numpy as np
from autograd import grad, jacobian, hessian
from autograd.scipy.stats import norm
from scipy.optimize import minimize
def load_image(fname):
img = Image.op... |
<filename>scripts/sources/S_HFPquantileFPdependence.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# ... |
<filename>exec/10-1-5.py
# ウサギとカメ(識別可能性に関する例)
import numpy as np
import seaborn as sns
import pandas
import matplotlib.pyplot as plt
import mcmc_tools
from scipy.stats import norm
from sklearn.linear_model import LinearRegression
import time
# usagitokame
# Lower: 1カメ、2ウサギ
# Winner: 1カメ、2ウサギ
usagitokame = pandas.read_... |
import os
import numpy as np
from IPython.display import IFrame
from matplotlib import pyplot as plt
from scipy.io import loadmat
from scipy.ndimage.filters import median_filter
from config import BASE_DIR, SHAPENET_IM
from utils import mkdir_p
from uuid import uuid4
with open(os.path.join(BASE_DIR, 'pyntcloud.js'), ... |
<reponame>jselvan/simianpy<filename>simianpy/analysis/bursting/poisson_burst_detection.py
import numpy as np
import scipy.stats
def drop_overlapping(bursts):
bursts_filtered = []
if bursts:
bursts_filtered.append(bursts.pop(0))
while bursts:
next_burst = bursts.pop(0)
if... |
<gh_stars>1-10
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lic... |
<gh_stars>1-10
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QPushButton, QVBoxLayout, QFileDialog , QMessageBox
from PyQt5.uic.properties import QtCore
from PyQt5.QtCore import pyqtSignal
from PyQt5 import QtWidgets, uic
import mplwidget
import matplotlib.pyplot as plt
from scipy import signal
impor... |
<reponame>MITIBMxGraph/SALIENT_artifact
import argparse
from argparse import Namespace
import os
import statistics
import prettytable
import operator
parser = argparse.ArgumentParser(description="Parse SALIENT experiment logs")
parser.add_argument(
"directory", help="Name of directory containing tests to parse."... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import tensorflow as tf
import numpy as np
import scipy.io
import user_config
import os
FLAGS = tf.app.flags.FLAGS
def init_data(num_of_imgs):
input_images = [None]*num_of_imgs
gt = [None]*num_of_imgs
return input_images, gt
def get_data(ind, set_name):
if set_name == 'val':
flags_dict = {'input': FLAGS.... |
<reponame>rafaie/interpolation
"""
interpolator.py: a class to study different Univariate interpolation¶
on a given dataset in CSV format
"""
import pandas as pd
import numpy as np
from datetime import datetime
from scipy import interpolate
import argparse
import os
import math
import csv
def int... |
<reponame>denisuzhva/ML_task2
import numpy as np
import scipy.sparse as sp
import csv
import os
KINO_NUM = 193609
USR_NUM = 610
RATE_NUM = 100836
if __name__ == '__main__':
dataset_ind_path = '../../RawData/ml-latest-small/'
dataset_ind = np.zeros((RATE_NUM, 2), dtype=np.int)
target_data = np.zeros(... |
<filename>src/HafrenHaver/map_app.py<gh_stars>1-10
#! /usr/bin/env python3
import cartopy.crs as ccrs
import cartopy
projections_db = ( # https://scitools.org.uk/cartopy/docs/latest/crs/projections.html
lambda lon, lat: ccrs.PlateCarree (central_longitude=lon),
lambda lon, lat: ccrs.AlbersEqualArea ... |
"""Extract cross sections of detected objects along their main axis through their origin."""
from typing import Tuple
import numpy as np
from scipy import ndimage
import cv2
from sklearn.decomposition import PCA
def denoise(binary_image: np.ndarray) -> np.ndarray:
"""
Denoise a binary image by closing and op... |
<reponame>zfang-slim/PysitForPython3
# Std import block
import time
import numpy as np
import matplotlib.pyplot as plt
import math
import os
from shutil import copy2
import sys
import scipy.io as sio
from pysit import *
from pysit.gallery import horizontal_reflector
from pysit.util.io import *
from pysit.util.paral... |
<gh_stars>1-10
'''
Essential functions and classes for calibration. See, in particular:
- `OPT_BOUNDS`, which has lower and upper bounds on calibration parameters
**You must create a configuration JSON file before calibrating L4C.** There
is a template available in the directory:
pyl4c/data/fixtures/files
The o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.