text string |
|---|
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
import os, sys, shutil, copy
import cPickle as pickle
from filelock import filelock
# TODO: don't overwrite other core_names
# ---------------------... |
import numpy as np
nax = np.newaxis
import scipy.special
import ibp
import observations
from utils import distributions, gaussians, psd_matrices
def poisson(k, lam):
return -lam * k * np.log(lam) - scipy.special.gammaln(k+1)
def evidence(model, data, state):
K, D = state.Z.shape[1], state.X.shape[1]
Lam... |
from scipy.io import loadmat
import torch
import os
# from glob import glob
import torch.utils.data as data
import numpy as np
# import torch.nn.functional as F
import matplotlib.pyplot as plt
import torch.nn as nn
# torch.manual_seed(0)
# from torchvision import transforms
plt.rcParams['figure.figsize'] = (10.0, 8.0) ... |
<gh_stars>100-1000
import os
import glob
import nibabel as nib
import numpy as np
import shutil
from nipype.interfaces.ants import N4BiasFieldCorrection
from sklearn.feature_extraction.image import extract_patches as sk_extract_patches
from sklearn.utils import shuffle
import scipy.misc
num_mod = 2
def get_filename(s... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... |
'''
This is the script that gets called from the C++ KiT-RT method MLOptimizer.cpp
It initializes and loads a neural Closure
The call method performs a prediction
Author: <NAME>
Version: 0.0
Date 29.10.2020
'''
### imports ###
# internal modules
import numpy as np
from src.neuralClosures.configModel import initNeural... |
<filename>code/configure.py
# -*- coding: utf-8 -*-
"""
Created on 2020/2/4
Python 3.6
@author: <NAME>
@e-mail: <EMAIL>
"""
import os
import time
import pandas as pd
import numpy as np
import networkx as nx
from scipy import stats
import statsmodels.api as sm
from statsmodels.stats.outliers_influence import variance... |
import random
import numpy as np
from Fei_dataset import *
from six.moves import xrange
from scipy.misc import imsave as ims
from HSICSupport import *
from ops import *
from Utlis2 import *
import gzip
import cv2
import keras as keras
def load_mnist(dataset_name):
data_dir = os.path.join("./data", dat... |
<reponame>NickAlger/TensorTrainHigherDerivatives
import numpy as np
from fenics import *
import scipy.sparse.linalg as spla
from scipy.special import *
from matrix_free_matrix_square_root import make_matrix_square_root_applier
from fenics_helper_functions import fenics_to_scipy_matrix_conversion, random_function
from h... |
# -*- coding: tf-8 -*-
"""
Script for running null (spatial permutation) models for correlation matrices
derived from NeuroSynth data. Saves out null distribution for each parcel /
resolution / spin method and prints out the number of correlations that survive
FWE correction.
"""
import os
from pathlib import Path
im... |
<reponame>hfekrmandi/Autonomous-GNC-MAS
#!/usr/bin/env python2
from __future__ import print_function
import copy
import roslib
import sys
import rospy
import numpy as np
import datetime
import time
from geometry_msgs.msg import Twist
from dse_msgs.msg import PoseMarkers
from std_msgs.msg import Float64MultiArray
from... |
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import argrelextrema
T = 5 # Right border of the observed interval, [0, T]
delta = 0.01 # Step
N = round(T / delta) + 1 # Amount of observations
f_vals = [] # Input data observations that will be read from file
freq = 1 / T
hz = (N-1) * T / 100 # Fre... |
<filename>code/utils.py<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""Utilities for reproducing Harrold et al 2015 on SDSS J160036.83+272117.8.
"""
# Import standard packages.
from __future__ import absolute_import, division, print_function
import collections
import copy
import pdb
import re
import wa... |
from eats_worm import *
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial.distance import pdist, squareform
from fastcluster import linkage
# load an extractor
args_6 = {
"root": "/Users/stevenban/Desktop/20191104_KP_FC083_worm6_gcamp6s_1/",
"numz": 10,
"frames": [0, 1, 2, 3, 4, 5], ... |
<reponame>CGATOxford/Optic
##########################################################################
#
# MRC FGU Computational Genomics Group
#
# $Id$
#
# Copyright (C) 2009 <NAME>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
... |
<reponame>jrmxn/py_eegepe
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from . import sp
from . import data_specific
from . import inputparser as ip
from . import paradigm
import numpy as np
from scipy import signal
from datetime import datetime
import pickle
try:
from noisyopt import minimizeCompass, minimizeSPSA... |
<reponame>BiCroLab/WSI-analysis<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import sys
sys.path.insert(0, '../py')
from graviti import *
from numpy.linalg import norm
import numpy as np
import os
import os.path
from os import path
import sys
import glob
import h5py
import seaborn as sns
import matpl... |
# MIT License - Copyright <NAME> and contributors
# See the LICENSE.md file included in this source code package
"""A mixture distribution that has no analytical expression for MI."""
from ennemi import estimate_mi
from scipy.integrate import dblquad
from scipy.stats import norm, multivariate_normal as mvnorm
import ... |
from numpy import array as ary; from numpy import log as ln
from numpy import cos, sin, pi, sqrt, exp, arccos;
tau = 2*pi
import numpy as np;
from matplotlib import pyplot as plt
from scipy.ndimage import convolve
import seaborn as sns
from skimage.feature.blob import blob_dog, blob_doh, blob_log, peak_local_max
from s... |
<gh_stars>1-10
"""
--------------------------------------------------------------------------------
Description:
Datastructure describing the various attributes of a Genetic Circuit
Written by <NAME>, <NAME>, <NAME>
--------------------------------------------------------------------------------
"""
from collections i... |
<gh_stars>10-100
"""
Processing module
"""
import numpy as np
import numpy.ma as ma
import pandas as pd
from pandas_flavor import register_dataframe_method, register_series_method
def _rolling_window(data, block):
"""
http://stackoverflow.com/questions/4936620/
Using strides for an efficient moving avera... |
#!/usr/bin/env python3
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
def loadVectorize(file, vectorizer=None):
print('Import data and compute features')
import csv, numpy, flair, nltk
glove_embedding = flair.embeddings.WordEmbeddings('glove')
document_embeddings = flair.embeddings.DocumentPoolEmbeddings([gl... |
name = input("Write your name: ")
print("Hello", name, "!")
hours = int(input("Enter Hours: "))
rate = float(input("Enter Rate: "))
salary = hours * rate
print("Pay: {0:.2f}".format(salary))
width = 17
height = 12.0
print(width/2)
print(type(width/2))
print(width/2.0)
print(type(width/2.0))
print(height/3)
print(typ... |
__author__ = 'bptripp'
from os import listdir, makedirs
from os.path import join, isfile, basename, exists
import numpy as np
from scipy import misc
import string
import matplotlib
import matplotlib.pyplot as plt
def get_image_file_list(source_path, extension, with_path=False):
if with_path:
result = [jo... |
import numpy as np
from auxiliary.dataset import load_ucr
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
import pathlib as path
def transform(y: np.array, n: int):
# print(y.shape)
n1 = np.random.randint(int(n / 3))
n2 = np.random.randint(n - n1)
n3 = n - n1 - n2
i1 = [np.ra... |
import numpy as np
import tensorflow as tf
import multiprocessing as mp
from multiprocessing import Process, Manager
#import ray
import time
#import rfpimp as rfp
from tqdm import tqdm
from scipy.linalg import solve_triangular, sqrtm
from .models import BnnBase, BnnBinaryClassifier
from .projections import Covariance... |
<filename>parsec_airfoil.py<gh_stars>1-10
from math import sqrt, tan, pi
import numpy as np
import scipy.optimize
def get_coef(xte, yte, rle, x_ctrl, y_ctrl, d2ydx2_ctrl, th_ctrl, surface):
"""
evaluate the PARSEC coefficients
Assuming leading edge is at (x,y)=(0,0), and sharp trailing edge at (xte, yte)
... |
<gh_stars>1-10
#!/usr/bin/env python
import os
import sys
import argparse
import traceback
from numpy import linspace
from input_handling import parseLines,findFloat
if __name__ == "__main__":
# set up command line args
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,\
... |
<reponame>cgiovanetti/DarkHistory
""" Physics functions as well as constants.
Throughout DarkHistory, we choose cm, s and eV as our system of units. Masses and temperatures are also given in eV. Particle Data Group central values [1]_ are used for constants, while cosmological parameters are set to the central values ... |
import numpy as np
from cffi import FFI
from scipy.spatial.distance import cdist
from _cityblock.lib import cbdm
def ccityblock(x, y):
"""Python wrapper for the cbdm C function
Input:
x: (N, m) numpy array
y: (N, m) numpy array
Ouput:
(N, N) Cityblock distance matrix:
r_ij = abs(x_ij... |
<gh_stars>0
'''Fairly basic set of tools for realtime data augmentation on image data.
Can easily be extended to include new transformations,
new preprocessing methods, etc...
'''
from __future__ import absolute_import
import numpy as np
import re
from scipy import linalg
import scipy.ndimage as ndi
from six.moves imp... |
<reponame>LJJ12/Deep-Learning-for-SVD-and-Hybrid-Beamforming
# Hybrid BF based on DNN for rank-k approximation for 4-by-4 mmW system with geometric channel model
# Quantization approach 1 in which combination of step and piecec-wise linear functions are used.
# Author: <NAME>
import numpy as np
import scipy.io
from ke... |
<filename>misc/adv_vs_non-adv_start.py
import numpy as np
from scipy.misc import imread
from scipy.stats import entropy
import matplotlib as mpl
#mpl.use('pdf')
import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "Times New Roman"
mpl.rcParams['xtick.direction'] = 'in'
mpl.rcParams['ytick.direction'... |
<gh_stars>0
import numpy as np
import numpy.testing as npt
import properscoring
import pytest
import xarray as xr
from dask import is_dask_collection
from scipy.stats import norm
from sklearn.calibration import calibration_curve
from sklearn.metrics import roc_auc_score, roc_curve
from xarray.tests import assert_allclo... |
mport os
import copy
import sys
import pyarrow as pa
from pyarrow import csv
import pandas as pd
import pyarrow.feather as feather
from rdkit.Chem import rdMolDescriptors
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit import DataStructs
import numpy as np
from datetime import timedelta
from timeit imp... |
# -*- coding: utf-8 -*-
"""
author: <NAME> (github Boyne272)
Last updated on Tue Aug 27 18:23:14 2019
"""
import numpy as np
import matplotlib.pyplot as plt
import scipy.linalg as la
from ..tools import progress_bar
class AGNES():
"""
Clusters the given feature vectors by the AGNES algorithm
... |
from ase import Atoms
from ase.io import read
import numpy as np
from matplotlib import pyplot as plt
import time
from scipy.interpolate import interp1d
import seaborn as sns
import pickle
import numpy as np
from itertools import groupby
from collections import namedtuple
from scipy.ndimage import gaussian_filter1d
imp... |
import os
from functools import wraps
import sys
import string
import argparse
import json
import pickle
import yaml
import re
import time
import random
import itertools
import importlib
import numpy as np
import scipy.signal as sig
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
def convert_t... |
"""
"""
from __future__ import absolute_import, print_function
# C:\home\ej\wrk\scipy\weave\examples>python vq.py
# vq with 1000 observation, 10 features and 30 codes fo 100 iterations
# speed in python: 0.150119999647
# [25 29] [ 2.49147266 3.83021032]
# speed in standard c: 0.00710999965668
# [25 29] [ 2.49147266... |
<filename>Python27/ORCSim/Cycle.py<gh_stars>10-100
from __future__ import division
import sys, copy
from Expander import ExpanderClass
from PHEX_ASME2015 import PHEHXClass
from LineSet import LineSetClass
from Pump import PumpClass
from Pump_Centrifugal_Kortrijk import PumpCentrifugalClass
from LiquidReceiver import... |
import os
import csv
import numpy as np
import pandas as pd
from lightfm import LightFM
from lightfm.evaluation import precision_at_k
from lightfm.evaluation import auc_score
import scipy.sparse
import warnings
from scipy.sparse import SparseEfficiencyWarning
from sklearn.metrics import label_ranking_average_precision_... |
<gh_stars>10-100
import h5py
import torch.utils.data as data
import pickle
import PIL
import numpy as np
import torch
import string
from scipy import misc
import os
import os.path
import sys
import math, random
import skimage
from skimage import io
from skimage.transform import resize
from skimage.transform import re... |
<reponame>jamshaidsohail5/stattests
from typing import Tuple, Dict, Optional, Set, List
import imageio
import numpy as np
import scipy.stats
import seaborn as sns
from IPython.core.display import HTML
from matplotlib import pyplot as plt
from matplotlib.axes import Axes
from stattests.data import rpv
from stattests.g... |
<filename>new_variant_estimate.py
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import colors
from matplotlib.ticker import MaxNLocator
import matplotlib.ticker as ticker
import matplotlib.dates as mdates
from matplotlib import rc, rcParams
from matplo... |
<filename>scratchpad/energy_qiskit_test.py
import time
import os
import numpy as np
from scipy.optimize import minimize
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from qiskit import IBMQ
from qiskit import Aer
from qiskit.visualization import plot_histogram
import qiskit
import random
import net... |
<reponame>williamrobotma/DTI<filename>inspire_encoder.py
import torch
from torch.autograd import Variable
import torch.nn.functional as F
from torch.utils import data
from torch.utils.data import SequentialSampler
from torch import nn
from tqdm import tqdm
import matplotlib.pyplot as plt
import numpy as np
import pan... |
# Copyright (c) 2021 ING Wholesale Banking Advanced Analytics
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, mo... |
<filename>prune.py
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torchvision.transforms as T
import torchvision.datasets as datasets
from torch.utils.data import DataLoader
from models import WRN_McDonnell, WRN_McDonnell_Eval
def create_dataset(train):
transform = ... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Author
------
<NAME>
Email
-----
<EMAIL>
Created on
----------
- Tue Jun 20 10:00:00 2017
Modifications
-------------
- Tue Jun 20 10:00:00 2017
Aims
----
- error analysis
"""
import numpy as np
from lmfit.models import GaussianModel
from matplotlib import pyplot as plt... |
<filename>sandbox/randomized_tests/test_greedy_step.py
"""
These tests exposes lower level functions than needed -- see tests_multiple_queries for simpler constructions
using glm_target
"""
import numpy as np
from scipy.stats import norm as ndist
import regreg.api as rr
from ...tests.flags import SMALL_SAMPLES, SET_S... |
<reponame>gpleiss/falkon
import numpy as np
from scipy.spatial.distance import cdist
__all__ = ("naive_gaussian_kernel", "naive_sigmoid_kernel", "naive_laplacian_kernel",
"naive_linear_kernel", "naive_polynomial_kernel")
def naive_gaussian_kernel(X1, X2, sigma):
pairwise_dists = cdist(X1, X2, 'sqeucli... |
<filename>pciSeq/src/preprocess/tile.py<gh_stars>1-10
import numpy as np
from pciSeq.src.preprocess.utils import split_label_img
from scipy.sparse import coo_matrix
from multiprocessing.dummy import Pool as ThreadPool
from multiprocessing import cpu_count
from scipy.sparse import load_npz
import logging
logging.basicC... |
# encoding: utf-8
from __future__ import (absolute_import, division, print_function, unicode_literals)
import numpy as np
import sys
import os
from tqdm import trange
import pickle
from astropy.table import Table
from astropy.constants import c
from scipy.optimize import curve_fit
from collections import OrderedDic... |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 29 10:35:45 2021
@author: maple
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import scipy.interpolate
font = {'family' : 'serif',
'size' : 18}
mpl.rc('font', **font)
# %%
case = 1
basedata = np.load('.... |
import torch
import scipy.spatial
from torch_geometric.utils import to_undirected
class KNNGraph(object):
def __init__(self, k=6):
self.k = k
def __call__(self, data):
pos = data.pos
assert not pos.is_cuda
row = torch.arange(pos.size(0), dtype=torch.long)
row = row.vi... |
<gh_stars>1-10
''' Communications Discpline for CADRE '''
import numpy as np
import scipy.sparse
import MBI
import os
from openmdao.lib.datatypes.api import Float, Array
from openmdao.main.api import Component
from CADRE.kinematics import fixangles, computepositionspherical, \
computepositionsphericaljacobian, co... |
from openmdao.drivers.scipy_optimizer import ScipyOptimizeDriver
# from openmdao.drivers.genetic_algorithm_driver import SimpleGADriver # version 2.5.0 has bug see Issue #874
from topfarm.drivers.genetic_algorithm_driver import SimpleGADriver
from topfarm.drivers.random_search_driver import RandomSearchDriver
import s... |
# -*- coding: UTF-8 -*-
"""Definitions for `Ensembler` class."""
import gc
import sys
import time
import numpy as np
import scipy
from astrocats.catalog.model import MODEL
from astrocats.catalog.quantity import QUANTITY
from emcee.autocorr import AutocorrError
from mosfit.mossampler import MOSSampler
from mosfit.samp... |
from psisim import spectrum
import numpy as np
import scipy.interpolate as si
import scipy.integrate as integrate
import astropy.units as u
from scipy.ndimage import gaussian_filter
import copy
import matplotlib.pyplot as plt
import warnings
def simulate_observation(telescope,instrument,planet_table_entry,planet_spect... |
<filename>src/app_helper.py<gh_stars>100-1000
import time
from absl import app, logging
import cv2
import numpy as np
import tensorflow.compat.v1 as tf
from flask import Flask, request, Response, jsonify, send_from_directory, abort
import os
from .config import shooting_result
import sys
from sys import platform
import... |
<reponame>ratschlab/spladder
import pysam
import re
import numpy as np
import scipy.sparse
import copy
import time
import h5py
import uuid
if __package__ is None:
__package__ = 'modules'
from .utils import *
from .init import *
def get_reads(fname, chr_name, start, stop, strand=None, filter=None, mapped=True, sp... |
<reponame>V1ct0reo/lightning-fast-hydra
import argparse
import numpy
import cv2
import scipy
from scipy import ndimage
from random import randint
import random
import os
import shutil
from PIL import Image
from PIL import ImageEnhance
from PIL import ExifTags
from PIL import ImageFilter
# crop a random sized (60-100... |
<filename>experiments/perturbseq_experiments/plot_gene_set_bfs.py
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
from scipy.stats import pearsonr
import matplotlib
font = {"size": 30}
matplotlib.rc("font", **font)
matplotlib.rcParams["text.usetex"] = True
NUM_SETS_TO_PLO... |
import neurokit as nk
import numpy as np
import pandas as pd
import scipy
#df = nk.read_acqknowledge("abnormal_ECG.acq")
#df['ECG, X, RSPEC-R'].plot()
#events = nk.find_events(df["Photosensor"], cut="lower")
#df = nk.create_epochs(df, events["onsets"], duration=events["durations"])[0]
#df["Photosensor"].plot()
#df... |
import math
from collections import deque
from typing import List
import cv2
import numpy as np
from scipy.spatial.distance import cdist
from gym_gathering.maze_generators.maze_generator import InstanceGenerator
class Node(np.ndarray):
"""
Helper class to store graph information for the RTTGenerator.
""... |
""" Intelligent energy component contains the IEC class, that includes several algorithms
for predicting consumption of a house, given historical data. It also contains an IECTester
class that can be used to test and provide results on multiple IEC runs """
from __future__ import absolute_import, division, ... |
<reponame>StanBarmentloo/J1407_transit_search_activity
import matplotlib.pyplot as plt
import numpy as np
from astropy.timeseries import LombScargle
from scipy.optimize import curve_fit
#Generating noise and fake data
def noise_generator(times, std):
return np.random.randn(times.size)*std #Generating Gaussian nois... |
<gh_stars>0
from sympy.polys.rings import ring
from sympy.polys.domains import ZZ
from sympy.polys.heuristicgcd import heugcd
def test_heugcd_univariate_integers():
R, x = ring("x", ZZ)
f = x**4 + 8*x**3 + 21*x**2 + 22*x + 8
g = x**3 + 6*x**2 + 11*x + 6
h = x**2 + 3*x + 2
cff = x**2 ... |
<reponame>okadalabipr/cancer_signaling
import numpy as np
from scipy.integrate import odeint
from .name2idx import C, V
from .set_model import diffeq, param_values, initial_values
class Simulation(object):
t_start = 0
t_end = 300
h = 1000
t = np.linspace(t_start,t_end,h)
conditions = 5
pE... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Hierarchical clustering
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Mall_Customers.csv')
X = dataset.iloc[:,[3,4]].values
# Using the dendrogram to find the optimal nu... |
#****************************************************#
# This file is part of OPTALG. #
# #
# Copyright (c) 2019, <NAME>. #
# #
# OPTALG is released under the BSD 2-clause license. #
#*****... |
import numba
import numpy as np
import torch
import scipy.sparse as sp
import random
@numba.njit(cache=True, parallel=True)
def random_walk(start, length, indptr, indices):
"""
Parameters:
start : np.array(dtype=np.int32)
length : int
indptr : np.array(dtype=np.int32)
indices :... |
<filename>src/control/zero_wrt_speed.py
#!/usr/bin/env python
# This script calculates the zeros of the steer torque to steer and roll angle
# tranfer functions as a function of the canonical matrix entries given in
# Meijaard2007.
# Warning! This script does not work if there are complex zeros, as I haven't
# figure... |
#!/usr/bin/python3
# ros
from scipy.ndimage.measurements import label
import rospy
import ros_numpy
import message_filters
from sensor_msgs.msg import Image, PointCloud2
from cv_bridge import CvBridge, CvBridgeError
from std_msgs.msg import Float32MultiArray, MultiArrayLayout, MultiArrayDimension
from SegmentationMa... |
import sympy
import numpy as np
from qibo import K, matrices, hamiltonians, symbols
import matplotlib.pyplot as plt
def read_file(file_name, instance):
"""Collect data from .txt file that characterizes the problem instance.
Args:
file_name (str): name of the file that contains the instance information... |
# -*- coding: utf-8 -*-
"""
Created on 07-05-2015
@author: <NAME>
TODO:
"""
import numpy as np
import matplotlib.pyplot as plt
import os
def convertIndexToBin(clusts=None,n_clusts=None,N=None):
"""
Converts partition in list of arrays (one array per cluster) format to binary matrix.
"""
# clusts i... |
<reponame>KamyarNazeri/sznajd-model<filename>src/plots.py
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
path = 'results\\'
# Domain = 30, TMAX = 10000, sims: 200
def show_yes_fraction_2d():
data0 = np.loadtxt(path + 'yes_fraction\\sm2d_yes_0.dat')
data03 = np.loadtxt(path + 'yes... |
<gh_stars>1-10
from django.shortcuts import render
from django.template import RequestContext
from django.shortcuts import render_to_response
from pupil.forms import User_infoForm,LoginForm
from pupil.models import User_info,Questions,User_data,FeedBack,SessionData
from django.http import HttpResponseRedirect
from date... |
<filename>Application3.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 15 09:43:50 2021
@author: dariograna
Reference: Grana and de Figueiredo, 2021, SeReMpy
"""
from scipy.io import loadmat
import scipy.spatial.distance
import matplotlib.pyplot as plt
import numpy as np
from Geostats import... |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, 2017 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software wi... |
#!/usr/bin/env python
"""Optimizes coordinate path
Use a nearest neighbor algorithm, a simple TSP solution"""
import sys
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial.distance import cdist
opt_compare = False
def closest_node(node, nodes):
""""Return node index and node in list with
... |
<reponame>apmcleod/harmonic-inference<gh_stars>0
"""Utility functions for getting rhythmic or metrical information from the corpus DataFrames."""
from fractions import Fraction
from typing import Tuple
import pandas as pd
from harmonic_inference.data.corpus_constants import MEASURE_OFFSET, NOTE_ONSET_BEAT
def get_r... |
import math
from sympy import *
init_printing()
x = symbols("x")
y = E**-x + x**2 - 2
print("Function: ")
pprint(y)
print("1st derivative: ")
pprint(diff(y))
print("2nd derivative: ")
pprint(diff(y, x, 2))
plot(y, (x, -2, 2))
x_0 = float(input("Enter x_0: "))
epsilon = float(input("Choose precision: "))
f = lamb... |
<filename>dataPresentation.py
import numpy as np
from scipy.stats import norm
import matplotlib.pyplot as plt
#showing a single graph on some axis
plt.xlabel("Incomes")
plt.ylabel("No of values")
x= np. arange(-3, 3, 0.001)
plt.plot(x,norm.pdf(x))
plt.show()
#multiple plots on the same graph
plt.xlabel("Incomes")
pl... |
import logging
import numpy as np
import pandas as pd
import sympy as sp
class CausalEstimator:
"""Base class for an estimator of causal effect.
Subclasses implement different estimation methods. All estimation methods are in the package "dowhy.causal_estimators"
"""
def __init__(self, data, ident... |
import tensorflow as tf
import numpy as np
import scipy.sparse as sp
import time
import math
def embed_init(mat_x, mat_y, name, method='glorot_uniform_initializer', data_type=tf.float64):
if method == 'glorot_uniform_initializer':
print("init embeddings using", "glorot_uniform_initializer", "with dim of",... |
<filename>learn_parameters.py<gh_stars>0
# additional libs
import six; from six.moves import cPickle
import argparse
import os
import pdb
# import libs for numerical ops
import numpy as np
import scipy.stats as stats
# optimizer for neural net
from keras.optimizers import Adadelta
# custom libs
import callbacks
imp... |
# To import required modules:
import numpy as np
import time
import os
import sys
import matplotlib
import matplotlib.cm as cm #for color maps
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec #for specifying plot attributes
from matplotlib import ticker #for setting contour plots to log scale
fr... |
"""
Tests the higher level functions in bet_sizing.py.
"""
import unittest
from unittest.mock import patch
import datetime as dt
import numpy as np
import pandas as pd
from scipy.stats import norm, moment
from mlfinlab.bet_sizing.bet_sizing import (bet_size_probability, bet_size_dynamic, bet_size_budget, b... |
import logging, os, sys, time, requests, json
from datetime import datetime
from multiprocessing import Process, Queue
import pandas as pd
import sqlalchemy as s
from workers.worker_base import Worker
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import C... |
<reponame>AndrewGYork/relaxation_sensors
#!/usr/bin/python
# Dependencies from the python standard library:
from pathlib import Path
import shutil # For copying files
import subprocess # For calling ffmpeg to make animations
import urllib.request # For downloading raw data
import zipfile # For unzipping do... |
<gh_stars>100-1000
#!/usr/bin/env python
# encoding=gbk
import os
import os.path
import re
import logging
import logging.config
import skimage.io as sk
import numpy as np
import setting
import spaceNet.image_util as img_util
import scipy.io as sio
def process():
"""docstring for process"""
img_name = '0130... |
<reponame>efemeryds/semantic_space_navigation
from sklearn.model_selection import LeaveOneOut
import sklearn.linear_model
from load_models import load_model
from utils import load_data, load_vecs, results_to_file, merge_wi_dicts, check_results
from utils import to_np_array
import numpy as np
from scipy.sparse import cs... |
<reponame>Sk7w4tch3r/autism-screening<gh_stars>0
from sklearn.naive_bayes import GaussianNB
from sklearn import svm
from sklearn.neighbors import NearestNeighbors
from scipy.stats import pearsonr
import numpy as np
import pandas as pd
import bct
def correlation(df):
dataf = df.corr(method='pearson')
... |
<reponame>brandherd/PyParadise<gh_stars>1-10
import numpy as np
from scipy import special
from scipy import linalg
from scipy import optimize
from copy import deepcopy
from multiprocessing import cpu_count
from multiprocessing import Pool
from time import sleep
from matplotlib import pyplot as plt
import signal
def i... |
<filename>libs/utils.py
#!/usr/bin/env python3
import os
import re
import numpy as np
import bottleneck as bn
import pandas as pd
from scipy.special import gamma, binom
from scipy.stats import chi2
from scipy.spatial.distance import pdist, squareform
from sklearn.metrics import adjusted_rand_score
from sklearn.metrics... |
import numpy as np
import numpy.linalg as la
import skimage
import PIL
from PIL import Image as PILImage
import TimestampedPacketMotionData_pb2
import PoseSequenceLabel_pb2
import TimestampedImage_pb2
import Vector3dStamped_pb2
import argparse
import os
import google.protobuf.json_format
import Pose3d_pb2
import cv2
im... |
from Bezier import CubicBezier, QuadBezier, Point
import matplotlib.pyplot as plt
from scipy.optimize import minimize, rosen, rosen_der, Bounds
import copy
import math
import random
def check_obst(x1, y1, x2, y2, ox, oy):
"""Check the distance of intersection between a line from (x1,y1) to (x2,y2) and a ... |
<reponame>karng87/nasm_game<filename>python/matplotlib/electric_filed.py
import numpy as np
import scipy as sp
from scipy.integrate import quad
import matplotlib
matplotlib.rcParams['text.usetex'] = True
import matplotlib.pyplot as plt
import sympy as sp
import plotly.graph_objects as go
#from Ipython.display import HT... |
<filename>photutils/detection/core.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions for detecting sources in an astronomical image."""
import warnings
import numpy as np
from astropy.stats import sigma_clipped_stats
from astropy.table import Table
from astropy.utils.exceptions import (A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.