prompt
stringlengths
19
1.03M
completion
stringlengths
4
2.12k
api
stringlengths
8
90
import pytest import numpy as np import pandas as pd from dask.array import from_array, Array from dask.delayed import Delayed from dask.dataframe import from_pandas, Series, to_numeric @pytest.mark.parametrize("arg", ["5", 5, "5 "]) def test_to_numeric_on_scalars(arg): output = to_numeric(arg) assert isinst...
pd.Series(["1.0", "2", -3, -5.1])
pandas.Series
import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import itertools from sklearn.metrics import accuracy_score from scipy.optimize import curve_fit from sklearn.metrics import r2_score from matplotlib.patches import Rectangle def objective(x, a, b, c): return a * np.exp(...
pd.read_pickle(dataset_pkl)
pandas.read_pickle
import matplotlib.pyplot as plt import cartopy.crs as ccrs import cartopy.io.shapereader as shpreader from matplotlib import cm from matplotlib import colors import monet as m import numpy as np import pandas as pd import wrf as wrfpy import xarray as xr def get_proj(ds): """ Extracts information about the CM...
pd.Timestamp(f'{date} 00')
pandas.Timestamp
""" generic """ from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import numpy as np import pandas as pd from sklearn.ensemble import ExtraTreesRegressor, GradientBoostingRegressor from scipy import stats from ..util import timeout, TimeoutError ...
pd.Series(index=X.columns, name=y.name)
pandas.Series
# coding=utf-8 # pylint: disable-msg=E1101,W0612 from datetime import datetime, timedelta import operator from itertools import product, starmap from numpy import nan, inf import numpy as np import pandas as pd from pandas import (Index, Series, DataFrame, isnull, bdate_range, NaT, date_range, ti...
pd.offsets.Second(5)
pandas.offsets.Second
import re from datetime import datetime, timedelta import numpy as np import pandas.compat as compat import pandas as pd from pandas.compat import u, StringIO from pandas.core.base import FrozenList, FrozenNDArray, DatetimeIndexOpsMixin from pandas.util.testing import assertRaisesRegexp, assert_isinstance from pandas i...
tm.assert_series_equal(result, expected_s)
pandas.util.testing.assert_series_equal
#!/usr/bin/env python # coding: utf-8 # # Experiments @Fischer in Montebelluna 28.02.20 # We had the oppurtunity to use the Flexometer for ski boots of Fischer with their help at Montebelluna. The idea is to validate our system acquiring simultaneously data by our sensor setup and the one from their machine. With the...
pd.DataFrame(f[0],columns=['force [N]'])
pandas.DataFrame
# Place this file in src/ of the DIPS folder preprocessed as in # https://github.com/amorehead/DIPS-Plus up to and including the step prune_pairs.py (but not beyond that step). import logging import os import random from pathlib import Path import atom3.pair as pa import click import pandas as pd from atom3 import da...
pd.read_csv(pairs_postprocessed_txt, header=None)
pandas.read_csv
import pandas as pd import numpy as np import json import pycountry_convert as pc from ai4netmon.Analysis.aggregate_data import data_collectors as dc from ai4netmon.Analysis.aggregate_data import graph_methods as gm FILES_LOCATION = 'https://raw.githubusercontent.com/sermpezis/ai4netmon/main/data/misc/' PATH_AS_RANK ...
pd.isna(cc)
pandas.isna
# -*- coding: utf-8 -*- """ Created on Sun Apr 1 00:49:21 2018 @author: teo """ # -*- coding: utf-8 -*- """ Created on Thu Mar 8 10:32:18 2018 @author: teo """ import pandas as pd from plotly import tools import numpy as np import matplotlib.pyplot as plt import plotly.plotly as py import...
pd.DataFrame({'email':df_plot_helper_department2.index, 'list':df_plot_helper_department2.values})
pandas.DataFrame
''' Copyright 2022 Airbus SAS 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 applicable law or agreed to in writing, software dis...
pd.DataFrame({'years':years, 'share_investment': share_invest})
pandas.DataFrame
#===============================================================================# # PyGrouper - <NAME> from __future__ import print_function import re, os, sys, time import itertools import json import logging from time import sleep from collections import defaultdict from functools import partial from math import cei...
pd.merge(genes_df, gpgs, on='GeneID', how='left')
pandas.merge
# -*- coding: utf-8 -*- # Loading libraries import os import sys import time from networkx.algorithms.centrality import group import pandas as pd import re import csv from swmmtoolbox import swmmtoolbox as swmm from datetime import datetime from os import listdir from concurrent import futures from sqlalchemy import cr...
pd.DataFrame()
pandas.DataFrame
import pandas as pd import numpy as np import os import datetime import requests from tqdm import tqdm from collections import Counter import joblib import os # TODO: re-implement sucking data from the internet by checking for all days # and sucking only what it needs and put that in the load_data module # so it a...
pd.DatetimeIndex(deaths_series.index)
pandas.DatetimeIndex
import pandas as pd import numpy as np import pandas import csv import ast from sklearn.tree import DecisionTreeClassifier from sklearn.neural_network import MLPClassifier from sklearn.linear_model import LogisticRegression from sklearn import svm from sklearn.metrics import f1_score,confusion_matrix from sklearn.metri...
pd.merge(df_prob_synt,df_train,on=["ProblemID"])
pandas.merge
import sys import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy as sp import pylab from matplotlib import colors, colorbar from scipy import cluster #import rpy2 #import rpy2.robjects as robjects #from rpy2.robjects.packages import importr from tqdm import tqdm #from rpy2.robjec...
pd.pivot_table(at, index="cellBC", columns="intBC", values="UMI", aggfunc="count")
pandas.pivot_table
import inspect import os import datetime from collections import OrderedDict import numpy as np from numpy import nan, array import pandas as pd import pytest from pandas.util.testing import assert_series_equal, assert_frame_equal from numpy.testing import assert_allclose from pvlib import tmy from pvlib import pvsy...
pd.Series([10])
pandas.Series
import datetime from collections import OrderedDict import warnings import numpy as np from numpy import array, nan import pandas as pd import pytest from numpy.testing import assert_almost_equal, assert_allclose from conftest import assert_frame_equal, assert_series_equal from pvlib import irradiance from conftes...
pd.Series([0, .5], index=times)
pandas.Series
# Import 311 CARE/CARE+ Requests and clean import numpy as np import pandas as pd import geopandas as gpd import intake from shapely.geometry import Point import boto3 catalog = intake.open_catalog('./catalogs/*.yml') bucket_name = 's3://public-health-dashboard/' s3 = boto3.client('s3') df = catalog.car...
pd.to_datetime(df[col])
pandas.to_datetime
""" A module for parsing information from various files. """ import os import re from typing import Dict, List, Match, Optional, Tuple, Union import numpy as np import pandas as pd import qcelemental as qcel from arkane.exceptions import LogError from arkane.ess import ess_factory, GaussianLog, MolproLog, OrcaLog, Q...
pd.DataFrame.from_dict(ic_dict)
pandas.DataFrame.from_dict
"""Module to run a basic decision tree model Author(s): <NAME> (<EMAIL>) """ import pandas as pd import numpy as np import logging from sklearn import preprocessing from primrose.base.transformer import AbstractTransformer class ExplicitCategoricalTransform(AbstractTransformer): DEFAULT_NUMERIC = -9999 ...
pd.to_numeric(data[name])
pandas.to_numeric
#!/usr/bin/env python3 """Pastrami - Population scale haplotype copying script""" __author__ = "<NAME>, <NAME>" __copyright__ = "Copyright 2021, <NAME>, <NAME>" __credits__ = ["<NAME>", "<NAME>", "<NAME>", "<NAME>"] __license__ = "GPL" __version__ = "0.3" __maintainer__ = "<NAME>, <NAME>" __email__ = "<EMAIL>; <EMAIL>...
pd.read_table(self.reference_tfam_file, index_col=None, header=None, sep=' ')
pandas.read_table
import os from functools import reduce import pandas as pd import numpy as np from . import settings def get_data(cryptocurrency, fillna=0): crypto_path = os.path.join(settings.RESOURCES_DIR, cryptocurrency) # Currency related data frames price_df = _read_csv(os.path.join(crypto_path, 'price.csv')) ...
pd.to_datetime(topic_df['date'])
pandas.to_datetime
import pandas as pd c1 = pd.read_csv('machine/Calling/Sensors_1.csv') c2 = pd.read_csv('machine/Calling/Sensors_2.csv') c3 = pd.read_csv('machine/Calling/Sensors_3.csv') c4 = pd.read_csv('machine/Calling/Sensors_4.csv') c5 = pd.read_csv('machine/Calling/Sensors_5.csv') c6 = pd.read_csv('machine/Calling/Sensors_6.csv')...
pd.read_csv('machine/Texting/Sensors_8.csv')
pandas.read_csv
import os import minerva as mine import pandas as pd import random import re def sentence_to_conll_string( sentence: mine.Sentence, entity_name: str, conflate: bool = False ) -> str: words = [t.text for t in sentence] annos = sentence.get_annotation(entity_name) labels = ["O"] * len(words) if ann...
pd.read_excel(XLSX_PATH, sheet_name=sheet + "_Identified")
pandas.read_excel
import numpy as np import pandas as pd def set_order(df, row): if pd.isnull(row['order']): if pd.notnull(row['family']): row['order'] = df[(pd.notnull(df['order']) & df['family']== row['family'])]['order'].head(1) elif pd.notnull(row['genus']): ...
pd.notnull(df['order'])
pandas.notnull
# Copyright (c) 2017, Intel Research and Development Ireland Ltd. # # 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...
pandas.DataFrame()
pandas.DataFrame
import numpy as np import pandas as pd import os, errno import datetime import uuid import itertools import yaml import subprocess import scipy.sparse as sp from scipy.spatial.distance import squareform from sklearn.decomposition.nmf import non_negative_factorization from sklearn.cluster import KMeans from sklearn.me...
pd.Series(gene_counts_var/gene_counts_mean)
pandas.Series
import numpy as np import pandas as pd import matplotlib.pyplot as plt import warnings import calendar import seaborn as sns sns.set(style='white', palette='deep') plt.style.use('grayscale') warnings.filterwarnings('ignore') width = 0.35 # Funções def autolabel(rects,ax, df): #autolabel for rect in rects: ...
pd.cut(df_compra['hora'], bins)
pandas.cut
from strategy.rebalance import get_relative_to_expiry_rebalance_dates, \ get_fixed_frequency_rebalance_dates, \ get_relative_to_expiry_instrument_weights from strategy.calendar import get_mtm_dates import pandas as pd import pytest from pandas.util.testing import assert_index_equal, assert_frame_equal def ass...
pd.Timestamp("2015-03-17")
pandas.Timestamp
#################################################################################################### # EXPERIMENT TRACKING ROUTINES #################################################################################################### import numpy as np import imageio from matplotlib import pyplot as plt from ma...
pd.read_json(path + '\\' + df_name + '.json')
pandas.read_json
#!/usr/bin/env python3 import ccxt from configparser import ConfigParser import json import os import pickle import redis import socket import tempfile import time import threading import zlib import numpy as np import talib.abstract as ta from pandas import DataFrame, Series from requests_futures.sessions import Futu...
Series(index=series1.index, data=series2)
pandas.Series
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/03_key_driver_analysis.ipynb (unless otherwise specified). __all__ = ['KeyDriverAnalysis'] # Cell import numpy as np import pandas as pd pd.set_option('display.max_columns', 500) import time from sklearn.model_selection import train_test_split from sklearn.ensemble impo...
pd.Series(rf.feature_importances_, index=driverNames)
pandas.Series
# coding=utf-8 from hielen2.source import CloudSource, ActionSchema, GeoInfoSchema from hielen2.utils import LocalFile, ColorMap, Style, FTPPath from hielen2.ext.source_rawsource import Source as RawSource import hielen2.api.features as featman from hielen2.mapmanager import Multiraster from hielen2.cloudmanager impo...
read_csv(points_file,sep=";",index_col=0,header=None)
pandas.read_csv
import numpy as np from pandas import Categorical, Series import pandas._testing as tm class TestUnique: def test_unique_data_ownership(self): # it works! GH#1807 Series(Series(["a", "c", "b"]).unique()).sort_values() def test_unique(self): # GH#714 also, dtype=float ser = Se...
tm.assert_categorical_equal(result, cat)
pandas._testing.assert_categorical_equal
import numpy as np import pandas as pd MONTHS_IN_QUARTER = 3 MONTHS_IN_YEAR = 12 CONVERSION_YIELD = 0.06 CONVERSION_FV = 1.03 GLOBEX_CODES = ("ZN", "ZB", "UB", "ZT", "TN", "Z3N", "ZF") def _n_and_v(globex_code, year_fraction): mask = np.in1d(globex_code, ("ZN", "ZB", "UB", "TN")) n = mask * np.nan v = m...
pd.concat(deliverables)
pandas.concat
import os from matplotlib import use use('Agg') from matplotlib import pyplot as plt from matplotlib.cm import get_cmap plt.switch_backend('agg') import cartopy.crs as ccrs import numpy as np from blackswan.utils import get_time from blackswan import templating from blackswan.utils import prepare_static_folder i...
pd.DataFrame()
pandas.DataFrame
import re import pandas as pd # Dataframe cleaning from qutil.format.number import fmtl, fmtn, fmtpx def clean_column_names(df, inplace=True): clean_cols = df.columns.str.lower().str.replace(' ', '_') clean_cols = [re.sub(r'\W+', '', x) for x in clean_cols] clean_cols = [re.sub('__', '_', x) for x in cle...
pd.to_datetime(df[key])
pandas.to_datetime
import datetime from collections import OrderedDict import numpy as np import pandas as pd import pytest from numpy.testing import assert_almost_equal, assert_allclose from pandas.util.testing import assert_frame_equal, assert_series_equal from pvlib.location import Location from pvlib import clearsky from pvlib im...
pd.Series([80, 100, 85, 70, 85])
pandas.Series
import os import pandas as pd import json from cloud_pricing.data.interface import FixedInstance class AWSProcessor(FixedInstance): aws_gpu_ram = { 'p3': ('V100', 16), 'p2': ('K80', 12), 'g4': ('T4', 16), 'g3': ('M60', 8) } aws_pricing_index_ohio_url = "https://pricing.us...
pd.DataFrame(pricing_data)
pandas.DataFrame
import json import pandas as pd def get_char_lines(script): dialog_json = script["dialog"] dialog = json_normalize(dialog_json) return dialog def get_char_names(script): char_names = script["characters"] return char_names def get_char_lines(char_names, dialog): char_lines = list(...
pd.concat(char_lines, axis=0)
pandas.concat
from __future__ import division import numpy as np import os.path import sys import pandas as pd from base.uber_model import UberModel, ModelSharedInputs from .therps_functions import TherpsFunctions import time from functools import wraps def timefn(fn): @wraps(fn) def measure_time(*args, **kwargs): ...
pd.Series([], dtype='float', name="out_eec_arq_herp_hm")
pandas.Series
import re from copy import copy from typing import Iterable, Optional, Union import pandas as pd import requests from bs4 import BeautifulSoup from pvoutput.consts import ( MAP_URL, PV_OUTPUT_COUNTRY_CODES, PV_OUTPUT_MAP_COLUMN_NAMES, REGIONS_URL, ) _MAX_NUM_PAGES = 1024 def get_pv_systems_for_coun...
pd.DataFrame(metadata)
pandas.DataFrame
# -*- coding: utf-8 -*- """ Created on Sun Mar 29 11:21:50 2020 @author: kaisa """ import os import pandas as pd import matplotlib.pyplot as plt from matplotlib import cm import matplotlib.dates as mdates import seaborn as sns from datetime import datetime, timedelta import numpy as np from bokeh.plotting import Col...
pd.Series(covid_conf[c], name='Cases')
pandas.Series
# Mar21, 2022 ## #--------------------------------------------------------------------- # SERVER only input all files (.bam and .fa) output MeH matrix in .csv # August 3, 2021 clean # FINAL github #--------------------------------------------------------------------- import random import math import pysam import csv ...
pd.read_csv(tomerge_dir)
pandas.read_csv
from distutils.version import LooseVersion from warnings import catch_warnings import numpy as np import pytest from pandas._libs.tslibs import Timestamp import pandas as pd from pandas import ( DataFrame, HDFStore, Index, MultiIndex, Series, _testing as tm, bdate_range, concat, d...
tm.assert_frame_equal(expected, result)
pandas._testing.assert_frame_equal
# -*- coding: utf-8 -*- # This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt) # <NAME> (<EMAIL>), Blue Yonder Gmbh, 2016 import pandas as pd import numpy as np from tests.fixtures import DataTestCase import mock from tsfresh.transformers.relevant_feature_augmenter im...
pd.DataFrame(index=[10, 500])
pandas.DataFrame
import pandas as pd import numpy as np import datetime import pickle from mlxtend.preprocessing import TransactionEncoder from mlxtend.frequent_patterns import apriori from mlxtend.frequent_patterns import association_rules with open("top_n-20m.pickle", "rb") as fp: top_n = pickle.load(fp) top_n_items = [ [x[0] fo...
pd.DataFrame.sparse.from_spmatrix(te_ary, columns=te.columns_)
pandas.DataFrame.sparse.from_spmatrix
import numpy as np import os import pandas as pd ######## feature template ######## def get_bs_cat(df_policy, idx_df, col): ''' In: DataFrame(df_policy), Any(idx_df), str(col), Out: Series(cat_), Description: get category directly from df_policy ''' df = ...
pd.isnull(real_mc_mean)
pandas.isnull
"""Plotting Utils.""" import altair as alt import numpy as np import pandas as pd def similarity_heatmaps(sim_of_sim, labels_dict, axis_title='', width=300, columns=2, min_step=1): plot_data = pd.DataFrame() for key in sim_of_sim: # Compute x^2 + y^2 across a 2D grid labels = labels_dict[key] or rang...
pd.DataFrame()
pandas.DataFrame
import re import numpy as np import pandas as pd import itertools from collections import OrderedDict from tqdm.auto import tqdm import datetime from sklearn.model_selection import KFold, StratifiedKFold from sklearn.feature_extraction.text import CountVectorizer from logging import getLogger logger = getLogger("splt...
pd.read_csv("../data/merge_A1-uid.csv")
pandas.read_csv
from IMLearn.utils import split_train_test from IMLearn.learners.regressors import LinearRegression from typing import NoReturn import numpy as np import pandas as pd import plotly.graph_objects as go import plotly.express as px import plotly.io as pio pio.templates.default = "simple_white" def load_data(filename: ...
pd.concat([floors, data[features], zipcodes], axis=1)
pandas.concat
#----------------------------------------------------------------- #-- Master Thesis - Model-Based Predictive Maintenance on FPGA #-- #-- File : prediction.py #-- Description : Model analysis module on test data #-- #-- Author : <NAME> #-- Master : MSE Mechatronics #-- Date : 14.01.2022 #-------------------------------...
DataFrame()
pandas.DataFrame
""" Tests for simulation of time series Author: <NAME> License: Simplified-BSD """ import numpy as np import pandas as pd from numpy.testing import assert_, assert_allclose, assert_equal import pytest from scipy.signal import lfilter from .test_impulse_responses import TVSS from statsmodels.tools.sm_exceptions impor...
pd.date_range(start='2000', periods=2, freq='M')
pandas.date_range
import os import pandas as pd import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from typing import Union, Optional, List, Dict from tqdm import tqdm from .basic_predictor import BasicPredictor from .utils import inverse_preprocess_data from common_utils_dev import to_parquet, to_abs_...
pd.DataFrame(abs_bins)
pandas.DataFrame
""" oil price data source: https://www.ppac.gov.in/WriteReadData/userfiles/file/PP_9_a_DailyPriceMSHSD_Metro.pdf """ import pandas as pd import numpy as np import tabula import requests import plotly.express as px import plotly.graph_objects as go import time from pandas.tseries.offsets import MonthEnd import re impor...
pd.melt(consumption_df, id_vars = 'products',var_name='month',value_name='average_cons')
pandas.melt
#!/usr/bin/env python import click import numpy as np import os import pandas as pd import re import torch from tqdm import tqdm bar_format = "{percentage:3.0f}%|{bar:20}{r_bar}" # Local imports from architectures import PWM, get_metrics from train import _get_seqs_labels_ids, _get_data_loader from utils import get_f...
pd.DataFrame(aucs, columns=["PWM"]+[m for m in metrics])
pandas.DataFrame
#! python3 #import os #os.environ["R_HOME"] = r"" #os.environ["path"] = r"C:\Users\localadmin\Anaconda3;C:\Users\localadmin\Anaconda3\Scripts;C:\Users\localadmin\Anaconda3\Library\bin;C:\Users\localadmin\Anaconda3\Library\mingw-w64\lib;C:\Users\localadmin\Anaconda3\Library\mingw-w64\bin;" + os.environ["path"] import o...
pd.read_csv(r["ion"])
pandas.read_csv
# -*- coding: utf-8 -*- import pytest import numpy as np from pandas.compat import range import pandas as pd import pandas.util.testing as tm # ------------------------------------------------------------------- # Comparisons class TestFrameComparisons(object): def test_df_boolean_comparison_error(self): ...
pd.DataFrame(np.nan, index=df.index, columns=df.columns)
pandas.DataFrame
#!/usr/bin/env python # coding: utf-8 # ------------------------------------------------------------------- # **TD DSA 2021 de <NAME> - rapport de <NAME>** # ------------------------- ------------------------------------- # # Analyse descriptive # ## Setup # In[5]: get_ipython().system('pip install textbl...
pd.Series(positive_text_prepro)
pandas.Series
#from subprocess import Popen, check_call #import os import pandas as pd import numpy as np import math import PySimpleGUI as sg import webbrowser # Read Data csv_path1 = "output/final_data.csv" prop_df = pd.read_csv(csv_path1) n = prop_df.shape[0] prop_df.sort_values(by=["PRICE"],ascending=True,inplace=True) prop...
pd.isnull(prop_df["ZESTIMATE"][i])
pandas.isnull
import os import zipfile as zp import pandas as pd import numpy as np import core import requests class Labels: init_cols = [ 'station_id', 'station_name', 'riv_or_lake', 'hydroy', 'hydrom', 'day', 'lvl', 'flow', 'temp', 'month'] trans_cols = [ 'date', 'year', 'month', 'day', 'hydroy', 'hydrom', 'station_id'...
pd.to_datetime(trans_df[['year', 'month', 'day']])
pandas.to_datetime
# -*- coding: utf-8 -*- # e_bb_retriever # <NAME> version = 'e_bb_retriever.v.9.0.0' # Python modules import os import pickle as pic import argparse # External modules import pandas as pd # Local modules from classes.libdesign import LibDesign from classes.logger import Logger if __name__ == '__mai...
pd.concat(int_dfs)
pandas.concat
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 9 13:55:53 2021 @author: Clement """ import pandas import geopandas as gpd import numpy import os import sys import datetime sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from gen_fct import file_fct from gen_fct im...
pandas.DataFrame(index=db_daily.index, columns=['date', 'delta_day'])
pandas.DataFrame
from tracemalloc import Statistic from turtle import color from unittest import result import pandas as pd import numpy as np import scipy from scipy.stats import norm from scipy.optimize import minimize import ipywidgets as widgets from IPython.display import display def drawdown(return_series: pd.Series, amount: fl...
pd.DataFrame()
pandas.DataFrame
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. from datetime import datetime, timedelta import numpy as np import pytest from pandas.errors import ( NullFrequencyError, OutOfBoundsDatetime, PerformanceWarning) import pandas as pd from pandas import ( DataFrame, ...
pd.DataFrame([1, 2, 3], index=tdi)
pandas.DataFrame
#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause-Clear # Copyright (c) 2019, The Numerical Algorithms Group, Ltd. All rights reserved. """Shared routines for different Metric Sets """ from warnings import warn import numpy import pandas from ..trace import Trace from ..traceset import TraceSet from .....
pandas.Series(data=[0.0], index=[idxkey])
pandas.Series
from IMLearn.utils import split_train_test from IMLearn.learners.regressors import LinearRegression from typing import NoReturn import numpy as np import pandas as pd import plotly.graph_objects as go import plotly.express as px import plotly.io as pio pio.templates.default = "simple_white" def load_data(filename: ...
pd.DatetimeIndex(df['date'])
pandas.DatetimeIndex
import matplotlib.pyplot as plt import os import numpy as np import pandas as pd from matplotlib import cm # import matplotlib from adjustText import adjust_text import re import matplotlib.patheffects as pe import scipy.stats as st # deprecated def plot_hist_exp_1(results, household_size, pool_size, prevalence): ...
pd.read_csv(filename)
pandas.read_csv
import os import sys import xarray as xr import numpy as np import pandas as pd from datetime import datetime from dateutil.relativedelta import relativedelta pkg_dir = os.path.join(os.path.dirname(__file__),'..') sys.path.append(pkg_dir) from silverpieces.functions import * def fill_time_index(nd_array): td = ...
pd.to_datetime('2009-12-31')
pandas.to_datetime
# coding: utf-8 # In[2]: get_ipython().magic('matplotlib inline') import matplotlib.pyplot as plt from keras.layers import Bidirectional, Input, LSTM, Dense, Activation, Conv1D, Flatten, Embedding, MaxPooling1D, Dropout #from keras.layers.embeddings import Embedding from keras.preprocessing.sequence import pad_seq...
pd.concat([X_train_toxic, X_train_severe_toxic, X_train_obscene, X_train_threat, X_train_insult, X_train_identity_hate, X_train_rest])
pandas.concat
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
pd.Series.unique(series)
pandas.Series.unique
import math import matplotlib.pyplot as plt import numpy as np import pandas as pd import os from pandas.core.frame import DataFrame from torch.utils.data import Dataset, DataLoader import torch import pickle import datetime class data_loader(Dataset): def __init__(self, df_feature, df_label, df_label_reg, t=No...
pd.to_datetime(end_date)
pandas.to_datetime
import pandas as pd from src.utility.file_utility import get_directory_files, create_directory, copy_file from src.utility.system_utility import progress_bar from src.utility.image_utility import load_image, crop_roi, save_image from sklearn.model_selection import train_test_split def get_labels(n_labels, as_string=T...
pd.read_csv(data_frame_path, sep=sep)
pandas.read_csv
from __future__ import print_function from datetime import datetime, timedelta import numpy as np import pandas as pd from pandas import (Series, Index, Int64Index, Timestamp, Period, DatetimeIndex, PeriodIndex, TimedeltaIndex, Timedelta, timedelta_range, date_range, Float64Index...
tm.assert_index_equal(res, exp)
pandas.util.testing.assert_index_equal
# Copyright 2021 VicEdTools 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 applicable law or agreed to in writi...
pd.read_csv(student_details_file, dtype=np.str)
pandas.read_csv
# -*- coding: utf-8 -*- import torch from pytorch_fid import fid_score import pandas as pd from glob import glob import os, argparse import numpy as np # %% device = torch.device('cuda' if (torch.cuda.is_available()) else 'cpu') batch_size = 50 dim = 2048 #path1 = './Datasets/Zurich_patches/fold2/patch...
pd.DataFrame(columns=header)
pandas.DataFrame
import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') target = 'scale' # IP plot_mode = 'all_in_one' obj = 'occ' # Port flow_dir = 'all' port_dir = 'sys' user_plot_pr = ['TCP'] user_plot_pr = ['UDP'] port_hist = pd.DataFrame({'A' : []}) user_port_hist = pd.DataFrame({'A' : []...
pd.read_csv("./postprocessed_data/%s/day2_90user.csv" % files[data_idx])
pandas.read_csv
#!/usr/bin/env python """ DataExplore Application based on pandastable. Created January 2014 Copyright (C) <NAME> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either versio...
pd.read_excel(filename,sheetname=None)
pandas.read_excel
import glob import pandas as pd import numpy as np import config from lcoc import afdc import warnings warnings.simplefilter(action='ignore', category=FutureWarning) ##### Functions ##### ################### ### Residential ### ################### def res_rates_to_utils(scenario = 'baseline', ...
pd.read_csv(urdb_rates_files[prof], low_memory=False)
pandas.read_csv
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Distance Measurement Calculation.py: This file uses the Mahalanobis Distance distance-based # # matching technique to match donors and recipients # # ...
pd.DataFrame()
pandas.DataFrame
from package import dataHandler as dh from package import featureHandler as fh from sklearn.model_selection import KFold from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC from sklearn.naive_bayes import GaussianNB from sklearn.neighbors import KNeighborsClassifier from sklearn.tree import ...
pd.DataFrame(columns=['Possible PD matches','How many'])
pandas.DataFrame
# coding: utf-8 import pandas as pd from pandas import Series,DataFrame import numpy as np import itertools import matplotlib.pyplot as plt get_ipython().magic('matplotlib inline') from collections import Counter import re import datetime as dt from datetime import date from datetime import datetime i...
pd.to_datetime(tweets.date)
pandas.to_datetime
import pytest import os from mapping import util from pandas.util.testing import assert_frame_equal, assert_series_equal import pandas as pd from pandas import Timestamp as TS import numpy as np @pytest.fixture def price_files(): cdir = os.path.dirname(__file__) path = os.path.join(cdir, 'data/') files = ...
TS('2015-01-03')
pandas.Timestamp
import numpy as np import pandas as pd from datetime import date ### Settings all_persons = [ 101, 102, 103, 104, 105, 106, 107, 211, 212, 213, 214, 215, 216, 217 ] persons_no_task = [0, 0, 0, 0, 0] nr_of_tasks = 10 nr_of_weeks_new = 54 nr_of_monthly_tasks = 4 hallways = 5 #task number of hallways...
pd.DataFrame({'Day': datevector_str})
pandas.DataFrame
import subprocess import numpy as np import pandas as pd from nicenumber import __version__, getlog from nicenumber import nicenumber as nn from pytest import raises def test_init(): """Test main package __init__.py""" # test getlog function works to create logger log = getlog(__name__) assert log.n...
pd.isnull(expected_result)
pandas.isnull
import nltk from nltk.corpus import stopwords import pandas as pd import string from collections import Counter from keras.preprocessing.text import Tokenizer from keras.models import Sequential from keras.layers import Dense, Dropout import random from numpy import array from pandas import DataFrame from matplotlib im...
pd.get_dummies(data['season'])
pandas.get_dummies
""" I/O functions of the aecg package: tools for annotated ECG HL7 XML files This module implements helper functions to parse and read annotated electrocardiogram (ECG) stored in XML files following HL7 specification. See authors, license and disclaimer at the top level directory of this project. """ # Imports ====...
pd.DataFrame([valrow2], columns=VALICOLS)
pandas.DataFrame
import os import sqlite3 import numpy as np import scipy.special as ss import pylab as pl import pandas as pd from astropy.io import fits import om10_lensing_equations as ole __all__ = ['LensedHostGenerator', 'generate_lensed_host', 'lensed_sersic_2d', 'random_location'] def boundary_max(data): ny, nx...
pd.merge(host_df, lens_df, on='lens_cat_sys_id', how='inner')
pandas.merge
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import datetime from reda.importers.eit_version_2010 import _average_swapped_current_injections def _extract_adc_data(mat, **kwargs): """Extract adc-channel related data (i.e., data that is captured for all 48 channels of the 40-channel medusa sys...
pd.to_datetime(df['datetime'])
pandas.to_datetime
import requests import pandas as pd _MACHINE_SCHEDULE_RDB_URL='http://rdb.pri.diamond.ac.uk/php/opr/cs_oprgetjsonyearcal.php' class MachineScheduleItem: def __init__(self, item: dict): self._item = item @staticmethod def _str_to_datetime(dt_str: str): return pd.to_datetime(dt_str, utc=Tr...
pd.Series([r.duration for r in run])
pandas.Series
import os import sys import math from neuralprophet.df_utils import join_dataframes import numpy as np import pandas as pd import torch from collections import OrderedDict from neuralprophet import hdays as hdays_part2 import holidays as pyholidays import warnings import logging log = logging.getLogger("NP.utils") d...
pd.DataFrame()
pandas.DataFrame
import numpy as np import pandas as pd import matplotlib.pyplot as plt import json import warnings import sys import absl.logging absl.logging.set_verbosity(absl.logging.ERROR) import argparse import logging import os """Silence every warning of notice from tensorflow.""" logging.getLogger('tensorflow').setLevel(logg...
pd.read_csv(self.test_path)
pandas.read_csv
import numpy as np import pandas as pd import json from mplsoccer.pitch import Pitch, VerticalPitch path = "C:/Users/brand/desktop/events/events_England.json" with open(path) as f: data = json.load(f) train = pd.DataFrame(data) path2 = "C:/Users/brand/desktop/players.json" with open(path...
pd.DataFrame(columns=["Goal","X","Y"], dtype=object)
pandas.DataFrame
import unittest import platform import random import string import platform import pandas as pd import numpy as np import numba import hpat from hpat.tests.test_utils import (count_array_REPs, count_parfor_REPs, count_parfor_OneDs, count_array_OneDs, dist_IR_contains, get_start_end) ...
pd.DataFrame({'A': ['aa', 'b', None, 'ccc']})
pandas.DataFrame
from collections import OrderedDict from datetime import timedelta import numpy as np import pytest from pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype import pandas as pd from pandas import ( Categorical, DataFrame, Series, Timedelta, Timestamp, _np_version_under1p14, ...
Timestamp("2013-01-01 00:00:00-0500", tz="US/Eastern")
pandas.Timestamp
from datetime import datetime, timedelta from typing import Any import weakref import numpy as np from pandas._libs import index as libindex from pandas._libs.lib import no_default from pandas._libs.tslibs import frequencies as libfrequencies, resolution from pandas._libs.tslibs.parsing import parse_time_string from ...
PeriodArray(rawarr, freq=self.freq)
pandas.core.arrays.period.PeriodArray
""" This library contains a set of functions that help you detect similar images in your archive. It will detect the 'best' image per group using a high-pass filter and copy these to another folder. Thus, you do not have to pre-select images for your photo show yourself (content itself is not considered a qua...
pd.Series(image)
pandas.Series
import datetime import logging from pathlib import Path import numpy as np import pandas as pd import plotly.graph_objs as go from numpy.linalg import inv from scipy.linalg import sqrtm from sklearn import covariance from sklearn.base import BaseEstimator from sklearn.covariance import EmpiricalCovariance from sklearn...
pd.Series(self.global_sharpe, index=sigma.index)
pandas.Series
# -*- coding: utf-8 -*- """ Created on Tue Sep 14 10:59:05 2021 @author: franc """ import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from pathlib import Path import json from collections import Counter, OrderedDict import math import torchtext from torchtext.data import get_tokenizer ...
pd.DataFrame({'spanish': ["bonito"], 'english': ["atlantic_bonito"]})
pandas.DataFrame