text
string
<reponame>forkunited/ltprg<gh_stars>10-100 #!/usr/bin/python # # Usage: plot.py [input_file] [xlabel] [ylabel] [x] [y] [where] [where_values] [groupby] # # input_file: Input tsv file where the first row contains column names # xlabel: Label for plot horizontal axis # ylabel: Label for plot vertical axis # x: Name of co...
<reponame>jfmalloy1/Patents # import igraph as ig # import numpy as np import pickle import pandas as pd from tqdm import tqdm import os import heapq import scipy.stats as stats from random import sample def build_cpd_df(fp): """ Takes 29 separate compound data files and combines them into a single pandas datafra...
<gh_stars>0 # -*- coding: utf-8 -*- """RED_linear_run1.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1-WN1MY9YYluGcnigLgrndqsxcOYldbB6 """ #@title mount your Google Drive #@markdown Your work will be stored in a folder called `cs285_f2021` by d...
import numpy as np from tqdm import tqdm from scipy.sparse import csr_matrix, hstack, vstack from sklearn.neighbors import NearestNeighbors class MFKnn(object): """ Implementation of """ def __init__(self, metric, k): self.k = k self.metric = metric def fit(self, X, y): # self.X_train = X self.y_tr...
<reponame>rezarajan/sdc-capstone #!/usr/bin/env python import rospy import numpy as np from scipy.spatial import KDTree from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped from styx_msgs.msg import Lane, Waypoint import math ''' This node will publish waypoints from the car's current position to...
#MNE tutorial #Import modules import os import numpy as np import mne import re import complexity_entropy as ce #Import specific smodules for filtering from numpy.fft import fft, fftfreq from scipy import signal from mne.time_frequency.tfr import morlet from mne.viz import plot_filter, plot_ideal_filter ...
import numpy as np import scipy as sp class MahalanobisClassifier(): def __init__(self, samples, labels): self.clusters={} for lbl in np.unique(labels): self.clusters[lbl] = samples.loc[labels == lbl, :] def mahalanobis(self, x, data, cov=None): """Compute the Mahalanobis D...
<filename>figures/bothspectra.py<gh_stars>0 from astropy.io import fits import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set_style('ticks') sns.set_context('paper', font_scale=1.7) from plot_fits import get_wavelength, dopplerShift from scipy.interpolate import interp1d plt.rcParams['xtick.d...
import matplotlib.pyplot as plt import numpy as np from scipy.special import logit import pandas as pd from matplotlib.axes import Axes, Subplot from matplotlib.collections import LineCollection from matplotlib.colors import ListedColormap, BoundaryNorm SMALL = 14 SIZE = 16 plt.rc('font', size=SIZE) # controls defaul...
<filename>simulation/src/utils.py #!/usr/bin/env python3 import numpy as np import math import random import time import scipy.misc import scipy.signal import multiprocessing import json import itertools import os import pprint from collections import namedtuple from fractions import gcd from optimized import get_dist...
from enum import Enum from math import * from scipy import integrate import matplotlib.pyplot as plt from libcellml import * import lxml.etree as ET __version__ = "0.1.0" LIBCELLML_VERSION = "0.2.0" STATE_COUNT = 1 VARIABLE_COUNT = 29 class VariableType(Enum): CONSTANT = 1 COMPUTED_CONSTANT = 2 ALGEBRAI...
<gh_stars>1-10 import numpy as np import scipy as sp import pandas as pd import ast import itertools from itertools import product from collections import Counter import networkx as nx import network_utils as nu import hicode as hc import matplotlib.pyplot as plt import matplotlib.cm as cm plt.style.use('classic') ...
from typing import Any, Dict, Iterable, List, Optional, Tuple, Callable from math import pi as π from sympy import Matrix as Mat from numpy import ndarray from physical_education.links import Link3D, constrain_rel_angle from physical_education.system import System3D from physical_education.foot import add_foot, feet, ...
import os import pandas as pd from plotnine import * import plotnine from matplotlib import pyplot as plt import matplotlib from scipy.spatial.distance import pdist, squareform from skbio.stats.ordination import pcoa from skbio.diversity import beta_diversity from skbio.io import read from skbio.tree import TreeNode im...
<gh_stars>0 import cv2 import sys import numpy as np from scipy.io import loadmat def convert(): labels = loadmat('tmp/data/devkit/cars_meta.mat') car_labels = [] for label in labels['class_names'][0]: car_labels.append(label[0]) labels_file = open("tmp/data/devkit/car_labels.txt", "w") l...
<filename>tests/env/experiments_tools_2.py<gh_stars>1-10 import sys sys.path.insert(0, '..') import numpy as np import pandas as pd from itertools import combinations from scipy.stats import binom import scipy.special import matplotlib.pyplot as plt import matplotlib.patches as mpatches from IPython.display import disp...
<reponame>voreille/2d_bispectrum_cnn from pathlib import Path import numpy as np from PIL import Image, ImageSequence import matplotlib.pyplot as plt import tensorflow as tf import tensorflow_io as tfio from scipy.ndimage import rotate from src.data.monuseg import get_dataset, tf_random_rotate, tf_random_crop ds = g...
<gh_stars>0 import pybullet as p import numpy as np from icecream import ic from scipy.spatial.transform import Rotation as R from highlevel_planning_py.tools.util import ( homogenous_trafo, invert_hom_trafo, pos_and_orient_from_hom_trafo, SkillExecutionError, ) class SkillNavigate: def __init__(s...
import random, copy import cv2 as cv import numpy as np from scipy import interpolate from .augmenter import Augmenter class WhiteBalancer(Augmenter): ''' Augmenter that randomly changes the white balance of the SampleImages. ''' def __init__( self, min_red_rand, max_red_rand, min_blue_rand, ...
<filename>Graded/G3/slam/EKFSLAM.py from typing import Tuple import numpy as np from numpy import ndarray from dataclasses import dataclass, field from scipy.linalg import block_diag import scipy.linalg as la from utils import rotmat2d from JCBB import JCBB import utils import solution @dataclass class EKFSLAM: Q...
<reponame>ChunaraLab/medshifts ''' Modifed from code by <NAME> https://github.com/steverab/failing-loudly Plot test results across hospitals Usage: # region python generate_hosp_plot.py --datset eicu --path orig --test_type multiv --num_hosp 4 --random_runs 100 --min_samples 5000 --sens_attr race --group --group_typ...
import os import time import h5py import json from PIL import Image import torch from torch import nn import torchvision import torchvision.transforms as transforms import torch.optim import torch.nn.functional as F from torch.utils.data.dataset import random_split from torch.utils.data import Dataset from torch.nn....
<filename>code/preprocess/consumption/sector/tn/tn_tx.py<gh_stars>1-10 #! usr/bin/python3 import pandas as pd import re import numpy as np import os import sys from collections import OrderedDict, defaultdict import matplotlib as mpl import matplotlib.pyplot as plt # import seaborn as sns from scipy import stats, inte...
<reponame>kanishk2509/TwitterBotDetection ###################### # Loading word2vec ###################### import os from threading import Semaphore import gensim from gensim.models import KeyedVectors pathToBinVectors = '/Users/kanishksinha/Downloads/GoogleNews-vectors-negative300.bin' newFilePath = '/Users/kanishks...
<reponame>yt7589/mgs # #import scipy #from scipy import io as sio import scipy.io.wavfile from ext.spafe.utils import vis from ext.spafe.features.bfcc import bfcc class AfeBfcc: @staticmethod def extract_bfcc(wav_file): print('获取BFCC特征') num_ceps = 13 low_freq = 0 high_freq = 20...
<gh_stars>10-100 from PyQt4.QtCore import * from PyQt4.QtGui import * import sys,os,time from scipy.stats import gamma, norm, beta import matplotlib.pyplot as plt from datetime import date, timedelta import numpy as np import tkinter from os import listdir from os.path import isfile, join def sorted_values(...
<reponame>akerestely/nonlinearBestFit<filename>tools.py import numpy as np import pandas as pd np.random.seed(421) def hCG(x: np.ndarray, A: float, B: float, alpha: float): return A * np.exp(-alpha * x) + B def gen_rand_points(n: int, A: float = 1000, B: float = 3, alpha: float = 0.01, noise: float = 2, consecut...
<filename>paul_analysis/Python/labird/fieldize.py # -*- coding: utf-8 -*- """Methods for interpolating particle lists onto a grid. There are three classic methods: ngp - Nearest grid point (point interpolation) cic - Cloud in Cell (linear interpolation) tsc - Triangular Shaped Cloud (quadratic interpolation...
<filename>notebooks/working/_02_tb-Demo-visual-marginal-independence-tests.py # --- # jupyter: # jupytext: # formats: ipynb,py,md # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.4.2 # kernelspec: # display_name: Python 3 ...
# Copyright 2019 The Johns Hopkins University Applied Physics Laboratory # # 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 ...
import numpy as np import matplotlib.pyplot as plt from sklearn.manifold import Isomap from scipy.spatial.distance import pdist from sklearn.neighbors import KNeighborsClassifier from sklearn.model_selection import cross_val_score, LeaveOneOut RANDOM_STATE = 42 def calculate_pairwise_distances(df_for_Box_Plot_featu...
<gh_stars>0 import os import io import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg from matplotlib.figure import Figure from keras.applications.imagenet_utils import preprocess_input from keras.backend.tensorflow_backend import set_sessi...
import numpy as np from scipy import sparse as sp from rlscore.utilities import multiclass def load_newsgroups(): T = np.loadtxt("train.data") #map indices from 1...n to 0...n-1 rows = T[:,0] -1 cols = T[:,1] -1 vals = T[:,2] X_train = sp.coo_matrix((vals, (rows, cols))) X_train = X_train....
<reponame>worldwise001/stylometry<filename>graph/__init__.py import matplotlib matplotlib.use('Agg') import statsmodels.api as sm import statsmodels.formula.api as smf import numpy as np from scipy.stats import linregress import matplotlib.pyplot as plt from sklearn.metrics import roc_curve, auc def hist_prebin(filen...
<reponame>haloship/rec-sys-dynamics<filename>code/src/algorithm/algo.py """Recommendation Algorithm Base Class This module is a base class for algorithms using sparse matrices The required packages can be found in requirements.txt """ import pandas as pd import numpy as np from lenskit import batch, topn, util from ...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import scipy import copy def get_loss_from_z(model, z, t, reduction): if model.name_loss == 'multi-class classification': criterion = torch.nn.CrossEntropyLoss() loss = criterion(z, t.type(torch.LongTensor).to(z...
"""Sampling code for the parrot. Loads the trained model and samples. """ import numpy import os import cPickle import logging from blocks.serialization import load_parameters from blocks.model import Model from datasets import parrot_stream from model import Parrot from utils import ( attention_plot, sample_pa...
<filename>Visualizer.py import numpy as np import argparse import scipy.linalg from mpl_toolkits.mplot3d import Axes3D from skimage.draw import polygon import matplotlib.pyplot as plt import glob from sklearn import datasets, linear_model import pdb import time parser = argparse.ArgumentParser() parser.add_argument('-...
<gh_stars>1-10 from clifford import g3c import numpy as np import scipy.optimize as opt from pygacal.rotation.costfunction import restrictedImageCostFunction, restrictedMultiViewImageCostFunction from pygacal.rotation import minimizeError from pygacal.rotation.mapping import BivectorLineImageMapping, BivectorLineMapp...
""" Тесты для задания 2.4. """ from unittest import TestCase, main from fractions import Fraction from tasks import task_2_4 class TestFractionFromString(TestCase): def test_fraction_from_string__CorrectArguments__ShouldReturnCorrectResult(self): """ Проверяет работу с корректными данными. ...
<reponame>BrandonKates/open_spiel # Copyright 2019 DeepMind Technologies Ltd. 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/LICEN...
<reponame>zmlabe/StratoVari """ Calculate PDFs for polar vortex response Notes ----- Author : <NAME> Date : 25 June 2019 """ ### Import modules import numpy as np import matplotlib.pyplot as plt import datetime import read_MonthlyData as MO import calc_Utilities as UT import cmocean import scipy.stats as st...
import numpy as np import pylab as plt from scipy.integrate import simps def grid_interpolate_samples(x, y, bins=1000, return_norm=False): idx = np.argsort(x) x, y = x[idx], y[idx] x_grid = np.linspace(x[0], x[-1], bins) y_grid = np.interp(x_grid, x, y) norm = simps(y_grid, x_grid) y_grid_norm...
# -*- coding: utf-8 -*- """ Created on Thu Dec 11 11:37:39 2014 @author: sm1fg Construct the magnetic network and generate the adjustments to the non-magnetic atmosphere for mhs equilibrium. """ import os import warnings import numpy as np import astropy.units as u from scipy.interpolate import RectBivaria...
<reponame>kenneth2001/Virus import asyncio import requests from bs4 import BeautifulSoup from datetime import date, datetime import discord import numpy as np from urllib.error import HTTPError import yt_dlp as youtube_dl from discord.ext import commands import os from pytz import timezone from yt_dlp.utils import Down...
<gh_stars>0 ######################################################################## # This script contains all the data analysis functions # ######################################################################## from __future__ import division from pylab import * import scipy, scipy.stats import ta...
# -*- coding: utf-8 -*- """Script which can be used to compare the features obtained of two different influenza models Usage: get_model_statistics.py <model> [--country=<country_name>] [--no-future] [--basedir=<directory>] [--start-year=<start_year>] [--end-year=<end_year>] [--save] [--no-graph] <baseline> ...
from scipy.sparse import vstack from sklearn.metrics.pairwise import cosine_similarity import numpy as np from sisu.preprocessing.tokenizer import is_relevant_sentence, make_sentences, sanitize_text from gismo.gismo import Gismo, covering_order from gismo.common import auto_k from gismo.parameters import Parameters fr...
<filename>Data_Science/Python-Estatistica/stats-ex8.py import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit def cinematica(t,s0,v0,a): s = s0 + v0*t +(a*t*t/2.0) return s t = np.linspace(0, 5, 500) s0 = 0.5 v0 = 2.0 a = 1.5 s_noise = 0.5 * np.random.normal(size=t.size) s = cin...
""" Twiss module. Compute twiss parameters from amplitude & phase data. Twiss filtering & processing. """ import numpy import torch import pandas from scipy import odr from .util import mod, generate_pairs, generate_other from .statistics import weighted_mean, weighted_variance from .statistics import median, biwei...
import numpy as np import scipy.linalg as la from auxiliary import * a = np.matrix([ [+0.35, +0.45, -0.14, -0.17], [+0.09, +0.07, -0.54, +0.35], [-0.44, -0.33, -0.03, +0.17], [+0.25, -0.32, -0.13, +0.11], ], dtype=float) w, vl, vr = la.eig(a, left=True, right=True) vprintC('w', w) print for i in ran...
<filename>MBC_ER_status/Ulz_pipeline/downloads/run_tf_analyses_from_bam.py #!/usr/bin/env python # coding: utf-8 #AL - the above code is new for the griffin paper version #modified print commands for python3 # Analyze all possible things from BAM-file import sys import argparse from subprocess import call import num...
<filename>scripts/plot_summary_stats.py<gh_stars>1-10 #!/usr/bin/env python from pda.dataset import init_aggregate_and_appliance_dataset_figure import matplotlib.pyplot as plt from scipy.stats import * import numpy as np subplots, chan = init_aggregate_and_appliance_dataset_figure( start_date='2013/6/4 10:00', en...
<gh_stars>0 # PHS3350 # Week 2 - wave packet and RFAP - # "what I cannot create I cannot understand" - <NAME>. # <NAME>, 13/03/2021 import os from pathlib import Path import numpy as np import matplotlib import matplotlib.pyplot as plt import physunits from scipy.fft import fft, ifft plt.rcParams['figure.dpi'] = 200 ...
<reponame>majkelx/astwro #! /usr/bin/env python # coding=utf-8 from __future__ import print_function, division from scipy.stats import sigmaclip from astwro.pydaophot import daophot from astwro.pydaophot import fname from astwro.pydaophot import allstar from astwro.starlist import read_dao_file from astwro.starlist ...
import numpy as np from scipy.integrate import simps def get_wss_magnitude(wss_vector): if (wss_vector.shape[-1] != 3): return wss_vector return np.sum(wss_vector ** 2, axis=-1) ** 0.5 def get_tawss(wss, dt): x = np.arange(0, len(wss)) x = np.asarray(x) * dt wss_int = simps(wss, x, axis=...
""" Calculate the translational entropy with EW, HSM and IGM models """ import numpy as np import matplotlib.pyplot as plt from scipy import integrate plt.style.use("paper") ha2kjmol = 627.5 * 4.184 class Constants: hbar_au = 1.0 h_au = hbar_au * 2.0 * np.pi kb_au = 3.1668114E-6 # hartrees K-1 h_...
<reponame>JojoReikun/ClimbingLizardDLCAnalysis def aep_pep_test(**kwargs): """ Calculates two different things: 1.) The x and y coordinates of the AEP and PEP, relative to the coxa of a respective leg 2.) The swing phases and the stance phases, identifying on a frame by frame basis Return: results ...
<reponame>gustxsr/learning-with-assemblies<filename>testing.py import numpy as np import matplotlib.pyplot as plt from scipy.signal import convolve from matplotlib.gridspec import GridSpec import matplotlib as mpl rng = np.random.default_rng() def k_cap(input, cap_size): """ Given a vector input it ...
from collections import Counter, defaultdict from datetime import datetime from statistics import mean from dateutil.parser import parse as parse_datetime from dateutil import rrule def num_comments_by_user(comments): commenters = (comment['from']['name'] for comment in comments) counter = Counter(commenters...
<reponame>ZihaoChen0319/CMB-Segmentation import torch.nn as nn import os import torch.optim as optim from tqdm import tqdm import numpy as np import torch import torch.nn.functional as nnf import SimpleITK as sitk import json from scipy import ndimage import medpy.io as mio from Utils import find_binary_ob...
#! /usr/bin/python3 # -*- coding: utf-8 -*- import pickle import pandas as pd import xml.etree.ElementTree as ET import math import seaborn as sns import matplotlib.pyplot as plt import numpy as np import csv import glob import scikit_posthocs as sp from scipy import stats import os from scipy import stats import scik...
<gh_stars>1-10 #!/usr/bin/env python3 # Copyright 2020 Google LLC # # 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 app...
from cmath import nan from sqlite3 import DatabaseError import pandas as pd import numpy as np import json def load_from_csv(path): dt = pd.read_csv(path, sep=';', dtype={'matricule': object}) return dt.set_index('matricule') def fix_matricule(matricule): if matricule.startswith('195'): return '19...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Software License Agreement (BSD License) # # Copyright (c) 2014, Ocean Systems Laboratory, Heriot-Watt University, UK. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the follow...
import numpy as np import time import argparse import pandas as pd import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from scipy import special from tqdm import tqdm from scipy.optimize import curve_fit from utils.build_hist import build_hist class SS_Charge: """ read calibration data and ...
# python /usr/bin/env/python # /// The Exoplanet Pocketknife # /// <NAME>, The Ohio State University 2015-2017 # /// All usage must include proper citation and a link to the Github repository # /// https://github.com/ScottHull/Exoplanet-Pocketknife import os, csv, time, sys, shutil, subprocess from threading import ...
#!usr/bin/env python3 #coding:utf8 import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit from astropy.io import ascii from uncertainties import ufloat import uncertainties.unumpy as unp from modules.table import textable import scipy.constants as const import math as math from modules....
<reponame>pierfra-ro/allesfitter<filename>allesfitter/basement.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 5 00:17:06 2018 @author: Dr. <NAME> European Space Agency (ESA) European Space Research and Technology Centre (ESTEC) Keplerlaan 1, 2201 AZ Noordwijk, The Netherlands Email: <EMAIL> ...
import localmodule import datetime import h5py import math import music21 as m21 import numpy as np import os import scipy import scipy.linalg import sys import time # Parse arguments args = sys.argv[1:] composer_str = args[0] track_str = args[1] # Define constants. J_tm = 8 N = 2**10 n_octaves = 8 midi_octave_off...
<gh_stars>0 import math import sys from scipy.interpolate import interp2d from scipy.ndimage import rotate, center_of_mass from scipy.spatial import distance from skimage.feature import canny from skimage.filters import rank, gaussian from skimage.measure import subdivide_polygon from skimage.morphology import medial_...
<filename>MISC/opt_omega_ip.py #!/usr/bin/env python import os import sys sys.path.append(os.getcwd()) import abinitio_driver as driver from abinitio_driver import AUtoEV import scipy.optimize as opt from scipy.interpolate import interp1d try: import matplotlib matplotlib.use('Agg') import matplotlib.pyplot a...
<gh_stars>0 import os import datetime from collections import defaultdict import numpy as np from scipy import sparse from episim.ontology import Ontology from episim.plot.modeling import System, Accumulator from .data import State class EulerSimulator(object): """ Explicit Euler method """ def __i...
<gh_stars>1-10 from functools import wraps from typing import Iterable import numpy as np import scipy.stats as scist import matplotlib.pyplot as plt from rpy2.robjects.packages import importr from rpy2.robjects.vectors import FloatVector from phat.utils import argsetter base = importr('base') utils = importr('util...
''' Wrapper function to run PPO algorithm for training ''' import numpy as np import matplotlib.pyplot as plt import time import math import logging from scipy.optimize import minimize, LinearConstraint # custom libraries from training.PPO.run_helper import buyerPenaltiesCalculator, buyerUtilitiesCalculator, evaluati...
# This code finds the Fourier Tranform of a signal and the Nyquist frequency import matplotlib.pyplot as plt import numpy as np import librosa import librosa as lr from scipy import signal from scipy.fft import fft, ifft import math import matplotlib.pyplot as plt if __name__ == "__main__": # Read the audio ...
from numpy import * from scipy.signal import correlate2d from numpy.random import randint,choice,uniform from matplotlib.pyplot import * import matplotlib.pyplot as plt from os import system class KineticMonteCarlo(object) : def __init__( self, Model ) : # reference state ...
<reponame>kaszperro/mapel import numpy as np def clustering_v1(experiment, num_clusters=20): from scipy.cluster.hierarchy import dendrogram, linkage, fcluster import scipy.spatial.distance as ssd # skip the paths SKIP = ['UNID', 'ANID', 'STID', 'ANUN', 'STUN', 'STAN', 'Mallows', ...
#!/usr/bin/env python # Copyright (C) 2017 Udacity Inc. # # This file is part of Robotic Arm: Pick and Place project for Udacity # Robotics nano-degree program # # All Rights Reserved. # Author: <NAME> # import modules import rospy import tf from kuka_arm.srv import * from trajectory_msgs.msg import JointTrajectory,...
# cppsimdata.py # written by <NAME> # with minor modifications by <NAME> to work with both Python 2.7 and Python 3.4 # available at www.cppsim.com as part of the CppSim package # Copyright (c) 2013-2017 by <NAME> # This file is disributed under the MIT license (see Copying file) import ctypes as ct import numpy as n...
from tcga_encoder.utils.helpers import * from tcga_encoder.data.data import * #from tcga_encoder.data.pathway_data import Pathways from tcga_encoder.data.hallmark_data import Pathways from tcga_encoder.definitions.tcga import * #from tcga_encoder.definitions.nn import * from tcga_encoder.definitions.locations import * ...
import warnings import numpy as np import pandas as pd import xgboost as xgb import scipy.stats as st from sklearn.neighbors import BallTree from xgbse._base import XGBSEBaseEstimator from xgbse.converters import convert_data_to_xgb_format, convert_y from xgbse.non_parametric import ( calculate_kaplan_vectorized,...
<reponame>garrettdreyfus/HolteAndTalleyMLDPy<gh_stars>10-100 from scipy.io import loadmat import pickle mldinfo =loadmat('mldinfo.mat')["mldinfo"] out={} print(mldinfo) for i in mldinfo: line={} line["floatNumber"] = i[0] line["cycleNumber"] = i[26] line["tempMLTFIT"] = i[27] line["tempMLTFITIndex"]...
# import libraries import os, os.path import numpy as np import pandas as pd # import geopandas as gpd import sys from IPython.display import Image # from shapely.geometry import Point, Polygon from math import factorial import scipy from statsmodels.sandbox.regression.predstd import wls_prediction_std from sklearn.lin...
#!/usr/bin/python import os import sys import glob import argparse import tempfile import numpy as np from scipy.io import * from scipy import stats from subprocess import Popen, PIPE from scai_utils import * from get_qdec_info import get_qdec_info from read_xml_labels import read_xml_labels atlas_label_fn = \ "...
<reponame>dimitra-maoutsa/DeterministicParticleFlowControl # -*- coding: utf-8 -*- """ Created on Mon Jan 10 07:20:39 2022 @author: maout """ import numpy as np from scipy.spatial.distance import cdist import torch #from score_function_estimators import my_cdist from typing import Union from torch.autograd import g...
<reponame>BartSiwek/Neurotransmitter2D import string import scipy import PslgIo, ElementAwarePslg def loadEle(filename): pslg = ElementAwarePslg.ElementAwarePslg() file = open(filename, "r") try: PslgIo.readFromFile(file, pslg, filename) finally: file.close() return pslg def saveFe...
from __future__ import division from chempy.util.testing import requires from ..integrated import pseudo_irrev, pseudo_rev, binary_irrev, binary_rev import pytest try: import sympy except ImportError: sympy = None else: one = sympy.S(1) t, kf, kb, prod, major, minor = sympy.symbols( 't kf kb...
<reponame>amahoro12/anne<filename>setup.py<gh_stars>0 ## This script set up classes for 4 bus and 2 bus environment import pandapower as pp import pandapower.networks as nw import pandapower.plotting as plot import enlopy as el import numpy as np import pandas as pd import pickle import copy import math import matplotl...
<filename>datasets/kitti.py # Basic libs import os, time, glob, random, pickle, copy, torch import numpy as np import open3d from scipy.spatial.transform import Rotation # Dataset parent class from torch.utils.data import Dataset from lib.benchmark_utils import to_tsfm, to_o3d_pcd, get_correspondences class KITTIDat...
<reponame>blackyblack/symplyphysics from sympy.functions import exp from symplyphysics import ( symbols, Eq, pretty, solve, Quantity, units, S, Probability, validate_input, expr_to_quantity, convert_to ) # Description ## Ptnl (fast non-leakage factor) is the ratio of the number of fast neutrons that do not lea...
<reponame>kirk86/kaggle # import sys # sys.path.appenval.'/usr/local/lib/python2.7/site-packages') import dlib import scipy import skimage as io import numpy as np def dlib_selective_search(orig_img, img_scale, min_size, dedub_boxes=1./16): rects = [] dlib.find_candidate_object_locations(orig_img, rects, min_...
from skimage import img_as_int import cv2 import numpy as np from pylab import * import scipy.ndimage.filters as filters #img = cv2.imread('images/profile.jpg', 0) img = cv2.imread('images/moon.jpg',0) sobel_operator_v = np.array([ [-1, 0, 1], [-2, 0 ,2], [-1, 0, 1] ]) sobelX = cv2.Sobel(img, -1...
<filename>LoanPandas/code.py<gh_stars>1-10 # -------------- # 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 = 'n...
"""Official merge script for PI-SQuAD v0.1""" from __future__ import print_function import os import argparse import json import sys import shutil import scipy.sparse import scipy.sparse.linalg import numpy as np import numpy.linalg def get_q2c(dataset): q2c = {} for article in dataset: for para_idx...
<gh_stars>1-10 from imutils import face_utils from scipy.spatial import distance import cv2 import dlib import imutils import pygame import time # Initializing the alert sound pygame.mixer.init() alert_sound = pygame.mixer.Sound("alert_sound.wav") default_volume = 0.2 # Eye-Aspect-Ratio data EAR_threshhold = 0.17 # O...
<reponame>daniel-schaefer/CompEcon-python import numpy as np from scipy.sparse import csc_matrix, diags, tril from .basis import Basis __author__ = 'Randall' # TODO: complete this class # todo: compare performance of csr_matrix and csc_matrix to deal with sparse interpolation operators # fixme: interpolation is 25 slo...
"""Class with high-level methods for processing NAPS and NAPS BE datasets.""" from config import DATA_NAPS_BE_ALL from lib import partition_naps from lib import plot from lib import plot_clusters from lib import plot_clusters_with_probability from lib import plot_setup from lib import read_naps from lib import read_na...
from __future__ import division from builtins import str from builtins import range from astropy.utils.misc import isiterable from past.utils import old_div import copy import collections import numpy as np import healpy as hp import astropy.units as u import matplotlib.pyplot as plt import matplotlib as mpl from sci...
"""Model Definations for trpo.""" import gym import numpy as np import torch import time import scipy.optimize import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from distributions import DiagonalGaussian from helpers import get_flat_params, set_flat_params, get_flat_grads #from ...