prompt
stringlengths
19
1.03M
completion
stringlengths
4
2.12k
api
stringlengths
8
90
# fill_missing_values.py # Input: a dataframe that may contain missing values, strategy for # filling those values, meta data for that df's columns # Output: a dataframe that fills in missing values import sys import pandas as pd import argparse import json EXEMPT_COLS = [] ID_COLS = [] def main(): parser = a...
pd.read_csv(args.data)
pandas.read_csv
#!/usr/bin/python from confluent_kafka import Consumer, KafkaError import json import re import time import datetime import calendar import shutil import gzip import os import sys import random import struct if sys.version_info > (3,): import pandas as pd from fastparquet import write as parqwrite from fa...
pd.DataFrame()
pandas.DataFrame
# -*- coding: utf-8 -*- from datetime import timedelta from distutils.version import LooseVersion import numpy as np import pytest import pandas as pd import pandas.util.testing as tm from pandas import ( DatetimeIndex, Int64Index, Series, Timedelta, TimedeltaIndex, Timestamp, date_range, timedelta_range ) f...
tm.assert_index_equal(result, expected)
pandas.util.testing.assert_index_equal
#!/usr/bin/env python # Author: <NAME> (jsh) [<EMAIL>] import joblib import logging import pathlib import shutil import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.stats as st import model_lib as ml logging.basicConfig(level=logging.INFO, format='%(asctime)s %(le...
pd.DataFrame(origmap)
pandas.DataFrame
#coding:utf-8 import os import sys import torch import torch.nn as nn from torch.utils.data import DataLoader from data import * from models import * import torchvision from torchvision import transforms, utils from tensorboardX import SummaryWriter import pandas as pd # set device device = torch.device('cuda' if ...
pd.DataFrame({'id': ids, 'label': labels})
pandas.DataFrame
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Dec 2 16:38:26 2019 @author: bruce """ import pandas as pd import numpy as np from scipy import fftpack from scipy import signal import matplotlib.pyplot as plt def correlation_matrix(corr_mx, cm_title): from matplotlib import pyplot as plt ...
pd.DataFrame(df_FFR_avg_win_sorted.iloc[528:, :])
pandas.DataFrame
import logging import os import re import warnings # import numpy as np from os import listdir from os.path import isfile, join import numpy as np import pandas as pd import sqlalchemy as sa # from odo import odo from sqlalchemy.inspection import inspect from sqlalchemy.orm import sessionmaker import spherpro.bro a...
pd.DataFrame(stackrel[modname_col])
pandas.DataFrame
# coding=utf-8 # # Copyright (c) 2010-2015 Illumina, Inc. # All rights reserved. # # This file is distributed under the simplified BSD license. # The full text can be found here (and in LICENSE.txt in the root folder of # this distribution): # # https://github.com/Illumina/licenses/blob/master/Simplified-BSD-License.tx...
pandas.DataFrame(records, columns=cols)
pandas.DataFrame
#!/usr/bin/env python # coding: utf-8 # In[24]: import numpy import pandas as pd import tensorflow as tf from PyEMD import CEEMDAN import warnings warnings.filterwarnings("ignore") ### import the libraries from tensorflow import keras from tensorflow.keras import layers from keras.models import Sequential from ke...
pd.DataFrame(dfs)
pandas.DataFrame
# pylint: disable=E1101,E1103,W0232 from datetime import datetime, timedelta from pandas.compat import range, lrange, lzip, u, zip import operator import re import nose import warnings import os import numpy as np from numpy.testing import assert_array_equal from pandas import period_range, date_range from pandas.c...
Index(['a', np.nan])
pandas.core.index.Index
# Standard Library import asyncio import logging import os from datetime import datetime # Third Party import pandas as pd from elasticsearch import AsyncElasticsearch from elasticsearch.helpers import async_streaming_bulk from masker import LogMasker from nats_wrapper import NatsWrapper logging.basicConfig(level=log...
pd.read_json(payload_data, dtype={"_id": object})
pandas.read_json
from flask import Flask, render_template, Response, request import jinja2 from flask_httpauth import HTTPBasicAuth import hashlib, os, binascii import json import numpy as np import pandas as pd from os import path import datetime app = Flask(__name__) auth = HTTPBasicAuth() users = { "yousef": "3d4dcf6<PASSWORD...
pd.DataFrame(data = data_out, columns = ['patient_id', 'BSA', 'HR', 'Aov', 'DAo', 'SVC', 'IVC', 'RPA', 'RPV', 'LPA', 'LPV', 'RUPV', 'LUPV', 'Qp', 'Qep','Qes','Qs','Qp/Qs', 'Qep/Qs','Qep/Qes'])
pandas.DataFrame
# -*- coding: utf-8 -*- # Parser for PreCo dataset # # Author: <NAME> <<EMAIL>> # # For license information, see LICENSE import gc from collections import defaultdict, namedtuple from enum import Enum from itertools import chain from multiprocessing import Pool from typing import DefaultDict, List, Tuple import numpy...
pd.read_json(full_filepath, lines=True, encoding='ascii')
pandas.read_json
import pandas as pd import numpy as np import time import collections def df_set(df_trr, df_weapondischarge, df_trrstatus, sub_weapon_refresh): """Set necessary df.""" # Set trr_trr_refresh df_trr["trr_datetime"] = pd.to_datetime(df_trr["trr_datetime"]) df_trr["beat"] = df_trr["beat"].astype(int) ...
pd.read_csv("data/data_officer.csv")
pandas.read_csv
from datetime import ( datetime, timedelta, ) import re import numpy as np import pytest from pandas._libs import iNaT from pandas.errors import InvalidIndexError import pandas.util._test_decorators as td from pandas.core.dtypes.common import is_integer import pandas as pd from pandas import ( Categoric...
tm.assert_series_equal(df["dates"], column)
pandas._testing.assert_series_equal
""" This script creates a boolean mask based on rules 1. is it boreal forest zone 2. In 2000, was there sufficent forest """ #============================================================================== __title__ = "Boreal Forest Mask" __author__ = "<NAME>" __version__ = "v1.0(19.08.2019)" __email__ = "<EMAIL>" #=...
pd.Timestamp.now()
pandas.Timestamp.now
import math import numpy as np import pandas as pd import plotly.graph_objs as go import plotly.figure_factory as ff from plotly.offline import plot import networkx as nx from parsl.monitoring.visualization.utils import timestamp_to_int, num_to_timestamp, DB_DATE_FORMAT def task_gantt_plot(df_task, df_status, time_c...
pd.Timestamp("1970-01-01")
pandas.Timestamp
# -*- coding: utf-8 -*- """ Created on Tue Feb 16 16:08:12 2021 Compute validation/test metrics for each model @author: jpeeples """ ## Python standard libraries from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import os from operator import itemgetter from sklearn.metrics impor...
pd.ExcelWriter(fig_dir+'Val_Metrics.xlsx', engine='xlsxwriter')
pandas.ExcelWriter
# predict_promoter_signal.py # given a fasta file of upstream regions for a set of # genes, run these seqs through bioprospector to search # for promoter motifs. By default, we search for motifs # of the structure: hexamer , 15-18bp spacer , hexamer # and bioprospector is run 20 times then summarized to # pick the "...
pd.concat(sub_dfs)
pandas.concat
import re from unittest.mock import Mock, call, patch import numpy as np import pandas as pd import pytest from rdt.transformers.categorical import ( CategoricalFuzzyTransformer, CategoricalTransformer, LabelEncodingTransformer, OneHotEncodingTransformer) RE_SSN = re.compile(r'\d\d\d-\d\d-\d\d\d\d') class ...
pd.Series([0.875, 0.625, 0.375, 0.125])
pandas.Series
"""This module contains auxiliary functions for RD predictions used in the main notebook.""" import json import matplotlib as plt import pandas as pd import numpy as np import statsmodels as sm from auxiliary.auxiliary_predictions import * from auxiliary.auxiliary_plots import * from auxiliary.auxiliary_tables import...
pd.DataFrame([])
pandas.DataFrame
from urllib.request import urlopen import json import pandas as pd import plotly.express as px import numpy as np import re import plotly.graph_objs as go from datetime import datetime us_state_abbrev = { 'Alabama': 'AL', 'Alaska': 'AK', 'Arizona': 'AZ', 'Arkansas': 'AR', 'California': 'CA', 'Colorado': 'CO', 'Connecti...
pd.read_csv(r'data/covid_confirmed.csv',dtype={'countyFIPS':str})
pandas.read_csv
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 16 12:49:36 2018 @author: <NAME> """ from myo_bt import Myo import collections import pandas as pd import time #from multiprocessing import Process import threading class EMGListener(Myo): def __init__(self, name, queue_size=10000): ...
pd.concat((self.df, temp_df))
pandas.concat
import re from os import path import pandas as pd from neo4j import GraphDatabase from config import proteoforms, LEVELS, proteins, genes from queries import QUERIES_PARTICIPANTS, QUERIES_COMPONENTS, get_query_participants_by_pathway, \ QUERY_GET_COMPLEXES_BY_PATHWAY_OR_REACTION def get_query_result(query): ...
pd.read_csv(filename)
pandas.read_csv
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_preprocessing ---------------------------------- Tests for `preprocessing` module. """ import pytest from sktutor.preprocessing import (GroupByImputer, MissingValueFiller, OverMissingThresholdDropper, ...
tm.assert_frame_equal(result, expected, check_dtype=False)
pandas.util.testing.assert_frame_equal
#!/usr/bin/env python """ Requirements: * Python >= 3.6.2 * Pandas * NumPy Copyright (c) 2020 <NAME> <<EMAIL>> MIT License <http://opensource.org/licenses/MIT> """ RELEASE = False __version_info__ = ( "0", "3", ) __version__ = ".".join(__version_info__) __version__ += "-dev" if not RELEASE else ...
pd.DataFrame(pvacseq_1_reader)
pandas.DataFrame
#!/usr/bin/env python3 import pandas as pd import tensorflow as tf from gpflow import default_float from mogpe.training import train_from_config_and_dataset def load_mcycle_dataset(filename='./mcycle.csv'): df = pd.read_csv(filename, sep=',') X =
pd.to_numeric(df['times'])
pandas.to_numeric
# -*- coding:utf-8 -*- # @Time : 2019-12-31 10:40 # @Author : liuqiuxi # @Email : <EMAIL> # @File : fundfeedswinddatabase.py # @Project : datafeeds # @Software: PyCharm # @Remark : This is class of fund market import datetime import copy import pandas as pd from datafeeds.winddatabasefeeds import...
pd.DataFrame()
pandas.DataFrame
""" Author: <NAME> (44287207) Date: Thu Aug 5 2020 Hyperparameter optimisation. """ import pandas as pd from matplotlib import cm import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import seaborn as sns import numpy as np from sklearn import svm from sklearn.model_selection import train_test_spl...
pd.DataFrame(regr_gs.cv_results_)
pandas.DataFrame
import os import pandas as pd import numpy as np def load_results(load_folders): rmse_loss_files = ['rmse_net_train_rmse', 'rmse_net_hold_rmse', 'rmse_net_test_rmse', 'task_net_train_rmse', 'task_net_hold_rmse', 'task_net_test_rmse'] task_loss_files = ['rmse_net_train_task', 'rmse_net_hold_task', 'rmse...
pd.DataFrame(rmse_results)
pandas.DataFrame
# %% ''' ''' ## Se importan las librerias necesarias import pandas as pd import numpy as np import datetime as dt from datetime import timedelta pd.options.display.max_columns = None pd.options.display.max_rows = None import glob as glob import datetime import re import jenkspy import tkinter as tk ...
pd.crosstab(grupo_2['sistema origen'],grupo_2['Efectivo Pago'])
pandas.crosstab
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Date: 2021/10/25 16:28 Desc: 新浪财经-所有指数-实时行情数据和历史行情数据 https://finance.sina.com.cn/realstock/company/sz399552/nc.shtml """ import datetime import re from mssdk.utils import demjson import pandas as pd import requests from py_mini_racer import py_mini_racer from tqdm impor...
pd.DataFrame()
pandas.DataFrame
import argparse from itertools import product from experiment import * import pandas as pd from params_helpers import * # Search parameters for ILP formulation def search_ilp(insdir, out, lp1, up1, lp2, up2): try: os.mkdir(out) except OSError: print("Creation of the directory failed or directo...
pd.read_pickle(f"{out}/{folder}/{f}")
pandas.read_pickle
import copy import time import calendar import netCDF4 import numpy from numpy import savez_compressed from numpy import load import pandas import tensorflow from tensorflow.keras.utils import to_categorical import scipy.ndimage import matplotlib.pyplot as pyplot import seaborn as sns import os.path # Variable names. ...
pandas.read_csv(file_name, header=0, sep=',')
pandas.read_csv
from Data import Data import itertools import joblib import numpy as np import pandas as pd import pickle import re import statsmodels.api as sm import sys from sklearn.linear_model import LinearRegression from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor from sklearn.metrics impo...
pd.Series(self.y_test.index)
pandas.Series
import numpy as np import pytest from anndata import AnnData from pandas import DataFrame from pandas.testing import assert_frame_equal from ehrapy.api.anndata_ext import ObsEmptyError, anndata_to_df, df_to_anndata class TestAnndataExt: def test_df_to_anndata_simple(self): df, col1_val, col2_val, col3_va...
DataFrame({"col1": col1_val, "col2": col2_val, "col3": col3_val})
pandas.DataFrame
import pandas as pd from xbbg import blp, pipeline, const class BloombergData: def get_hack_data(): df_IBOV = blp.bdh('BOVV11 BZ Equity', 'PX_LAST', '2017-12-29', '2021-04-30') df_SP = blp.bdh('SPXI11 BZ Equity', 'PX_LAST', '2017-12-29', '2021-04-30') df_IMAB = blp.bdh('IMAB11 BZ Equity...
pd.to_datetime(df_SP.index)
pandas.to_datetime
from typing import List, Tuple import numpy import pandas import pytest from openff.units import unit from pydantic import ValidationError from openff.evaluator.datasets import ( MeasurementSource, PhysicalPropertyDataSet, PropertyPhase, ) from openff.evaluator.datasets.curation.components.filtering impor...
pandas.DataFrame(data_rows)
pandas.DataFrame
"""apiclient.py""" from json.decoder import JSONDecodeError import sys from enum import Enum from datetime import datetime from datetime import timedelta from re import compile as re_compile import pandas as pd import numpy as np from requests import get as requests_get from requests import ConnectionError as requests...
pd.DataFrame()
pandas.DataFrame
# AutoEncoders # Importing the libraries import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.parallel import torch.optim as optim import torch.utils.data from torch.autograd import Variable #Configs train_file = '../datasets/Escamb_wtdata_train_alarm_86400.csv.gz' exclude_columns...
pd.read_csv(train_file,sep=',', compression='gzip',parse_dates=[datetime_name])
pandas.read_csv
from sqlalchemy import func import pandas as pd import numpy as np from cswd.sql.base import session_scope from cswd.sql.models import (Issue, StockDaily, Adjustment, DealDetail, SpecialTreatment, SpecialTreatmentType) DAILY_COLS = ['symbol', 'date', 'open', 'high', 'low', 'c...
pd.Timestamp(start)
pandas.Timestamp
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """ This script computes features on the GEFCom2017_D dataset. It is parameterized so that a selected set of features specified by a feature configuration list are computed and saved as csv files. """ import os from math import ceil import pandas...
pd.concat([train_base_df, train_delta_df])
pandas.concat
# -*- coding: utf-8 -*- from datetime import datetime, timedelta, date, time import numpy as np import pandas as pd import pandas.lib as lib import pandas.util.testing as tm from pandas import Index from pandas.compat import long, u, PY2 class TestInference(tm.TestCase): def test_infer_dtype_bytes(self): ...
lib.isneginf_scalar(np.inf)
pandas.lib.isneginf_scalar
import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd from pandas import ( CategoricalIndex, DataFrame, Index, NaT, Series, date_range, offsets, ) import pandas._testing as tm class TestDataFrameShift: @pytest.mark.parametrize( "input_...
DataFrame(np.nan, index=df.index, columns=[0])
pandas.DataFrame
# # 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 us...
pd.MultiIndex.from_tuples([("weight", "kg"), ("height", "m")])
pandas.MultiIndex.from_tuples
"""Test attributing simple impact.""" import numpy as np import pandas as pd import pytest from nbaspa.data.endpoints.pbp import EventTypes from nbaspa.player_rating.tasks import SimplePlayerImpact @pytest.mark.parametrize( "evt", [ EventTypes.REBOUND, EventTypes.FREE_THROW, EventTyp...
pd.Series([0.0, 0.0])
pandas.Series
''' Dataset related tests ''' __author__ = '<NAME>' import unittest import numpy as np import pandas as pd import itertools from pandas.testing import assert_frame_equal, assert_series_equal from simpleml.datasets import PandasDataset, SingleLabelPandasDataset, MultiLabelPandasDataset, NumpyDataset from simpleml.da...
assert_frame_equal(dataset.dataframe, unmodified_copy)
pandas.testing.assert_frame_equal
#!/usr/bin/env python # -*- coding: utf-8 -*- from dataIO import textfile from pathlib_mate import Path from sfm import lines_count import pandas as pd def process_rare_prefix(): nlines = lines_count.count_lines("rare-prefix.txt") * 1.0 prefix_list = list(textfile.readlines("rare-prefix.txt")) df = list() for i,...
pd.DataFrame(df, columns=["prefix", "index", "percentage"])
pandas.DataFrame
import pandas as pd import glob, os from datetime import datetime from collections import OrderedDict def display_original_bp_list(IN_FOLDER, POSE_TOOL, FILE_FORMAT): if POSE_TOOL == 'DLC': found_files = glob.glob(IN_FOLDER + '/*.' + FILE_FORMAT) # for h5 if FILE_FORMAT == 'h5': ...
pd.read_hdf(found_files[0])
pandas.read_hdf
# -*- coding: utf-8 -*- """ Created on Sun Oct 25 03:24:14 2020 @author: Alice to use on the lemon dataset: https://github.com/softwaremill/lemon-dataset/ """ import json import pandas as pd import os import cv2 from fruit_classification import * dim = 100 with open(r"./lemon-dataset/annotations/instances_default....
pd.DataFrame(data['annotations'])
pandas.DataFrame
# -*- coding: utf-8 -*- """ Created on Fri Dec 16 09:15:54 2016 @author: <NAME> """ import pandas as pd import numpy as np ###### Import packages needed for the make_vars functions from scipy.interpolate import interp1d import pywt from skimage.filters.rank import entropy from skimage.morphology import rectangle fro...
pd.DataFrame()
pandas.DataFrame
from datetime import timedelta from functools import partial from operator import attrgetter import dateutil import numpy as np import pytest import pytz from pandas._libs.tslibs import OutOfBoundsDatetime, conversion import pandas as pd from pandas import ( DatetimeIndex, Index, Timestamp, date_range, datetime,...
date_range('2014', '2015', freq='MS', tz=tz)
pandas.date_range
#!/usr/bin/env python # coding: utf-8 # In[ ]: import pysam import os #import pybedtools #not used import pandas as pd import numpy as np import time import argparse import sys from matplotlib import pyplot as plt # In[ ]: # %matplotlib inline # bam_file_name = 'MBC_1041_1_ULP' # mapable_name = 'repeat_masker.m...
pd.DataFrame()
pandas.DataFrame
# ---------------------------------------------------------------------------- # Copyright (c) 2020, <NAME>. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # -----------------------------------------------------------------------...
pd.concat(to_concat, axis=1)
pandas.concat
# Copyright 2018 <NAME> <EMAIL> # 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 ...
pd.read_csv(file_path, sep='\t', index_col=0)
pandas.read_csv
#standard python libraries import json import atexit import datetime import os import warnings import math import shutil import joblib #external libraries from binance.client import Client import numpy as np import pandas as pd import ta from sklearn import preprocessing import torch #external methods from utils impo...
pd.to_datetime(data['close_time'], unit='ms')
pandas.to_datetime
import math import itertools import logging from numba import njit import numpy as np import pandas as pd from parallelpipe import Stage import rasterio from rasterio.windows import Window logger = logging.getLogger("raster2points") def raster2csv( *files, col_names=None, separator=",", max_block_si...
pd.concat([data_frame, df[0]])
pandas.concat
""" draftsimtools.bots ~~~~~~~~~~~~~~~~~~ Machine learning based bot logic. """ from random import shuffle from copy import deepcopy import pandas as pd class Bot(object): """The bot object is used to simulate drafts. It has functions for creating new drafts, making picks, and tracking it's color com...
pd.DataFrame.from_dict(name_rating, orient="index")
pandas.DataFrame.from_dict
# # Copyright (C) 2019 Databricks, Inc. # # 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 i...
CategoricalDtype(["b", "c", "a"])
pandas.api.types.CategoricalDtype
import glob import os import os.path from pathlib import Path from lxml import etree import pandas as pd from datetime import datetime import time #never ever do this from itertools import * start = time.time() datestring = datetime.strftime(datetime.now(), '%Y%m%d_%H%M%S') list_of_attribute_value = [] Attribute_to_ex...
pd.DataFrame(list_of_attribute_value2, columns=['myocc','Attribute','Value'])
pandas.DataFrame
import copy import itertools import numpy as np import pandas as pd from scipy.special import erf from scipy import stats class JointNormal(object): """ :type labels: list :param labels: A list of string labels for the variables in this distribution :type mu: iterable of numbers or N x 1 numpy.matri...
pd.DataFrame(data)
pandas.DataFrame
# FLOWDO # FlowDo is an application created for the purpose of managing business activities like Inventory Maintenance, Billing, Sales analysis and other business functions. # Developed by: # <NAME> (@Moulishankar10) # <NAME> (@ToastCoder) # REQUIRED MODULES import numpy as np import pandas as pd from datetime impor...
pd.read_csv("data/inventory.csv")
pandas.read_csv
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_Sumstat.ipynb (unless otherwise specified). __all__ = ['p2z', 'Sumstat', 'read_sumstat', 'ss_2_vcf'] # Cell import yaml import numpy as np import pandas as pd from scipy.stats import norm from .utils import * # Cell def p2z(pval,beta,twoside=True): if twoside: ...
pd.DataFrame()
pandas.DataFrame
import pandas as pd from openpyxl import Workbook import cx_Oracle import sys from sqlalchemy import create_engine from PyQt6 import QtCore, QtGui, QtWidgets import ctypes import time import threading import qdarktheme import cgitb cgitb.enable(format = 'text') dsn_tns = cx_Oracle.makedsn('ip-banco-oracle', 'porta',...
pd.DataFrame(results, columns=['UN', 'SERIE', 'NF', 'DT_NF', 'SITUACAO'])
pandas.DataFrame
import argparse import numpy as np import tensorflow as tf import time import pickle import pandas as pd import os import math import maddpg.common.tf_util as U from maddpg.trainer.maddpg import MADDPGAgentTrainer import tensorflow.contrib.layers as layers def parse_args(): parser = argparse.ArgumentParser("Reinf...
pd.DataFrame(final_lose)
pandas.DataFrame
""" Provide the groupby split-apply-combine paradigm. Define the GroupBy class providing the base-class of operations. The SeriesGroupBy and DataFrameGroupBy sub-class (defined in pandas.core.groupby.generic) expose these user-facing objects to provide specific functionality. """ from contextlib import contextmanager...
notna(x.array)
pandas.core.dtypes.missing.notna
import pandas as pd import numpy as np import sys import logging import os from pathlib import Path class MSRawData: """ A class to describe raw data obtained from the MS machine Args: filePath (str): file path of the input MRM transition name file logger (object): logger object created by...
pd.isna(self.RawData.iloc[0,0])
pandas.isna
from PIL import ImageGrab import win32gui from sentiment import face_sentiment import numpy as np import pandas as pd import matplotlib matplotlib.use('TkAgg') import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk from matplotlib.fig...
pd.DataFrame(data, columns=['Emotions', 'Values'])
pandas.DataFrame
from sklearn.base import TransformerMixin, BaseEstimator import pandas as pd class BaseTransformer(BaseEstimator, TransformerMixin): def fit(self, X, y=None, **fit_params): return self def transform(self, X, **transform_params): return self class ColumnSelector(BaseTransformer): """Sele...
pd.concat(transform_results, axis=1)
pandas.concat
# Copyright 2020 trueto # 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_pickle(input_file)
pandas.read_pickle
# Copyright (c) 2019-2021 - for information on the respective copyright owner # see the NOTICE file and/or the repository # https://github.com/boschresearch/pylife # # 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 co...
pd.testing.assert_series_equal(transformed_back, wc_50)
pandas.testing.assert_series_equal
# -*- coding: utf-8 -*- """ @author: <NAME> - https://www.linkedin.com/in/adamrvfisher/ """ #BTC strategy model with brute force optimization, need BTC data set to run #BTC/USD time series can be found for free on Investing.com #Import modules import numpy as np import random as rand import pandas as p...
pd.to_numeric(df['Low'], errors='coerce')
pandas.to_numeric
from airflow import DAG from airflow.operators.dummy_operator import DummyOperator from airflow.operators.python_operator import PythonOperator from airflow.utils import timezone import pandas default_args = { 'owner': 'ODDS', } dag = DAG('product_price_pipeline', default_args=default_args, sta...
pandas.read_csv('products-lookup-table.csv', header=1)
pandas.read_csv
#! /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...
pd.concat([subject_data, buf])
pandas.concat
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # This file contains dummy data for the model unit tests import numpy as np import pandas as pd AIR_FCST_LINEAR_95 = pd.DataFrame( { ...
pd.Timestamp("2013-05-30 00:00:00")
pandas.Timestamp
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import copy import torch import numpy as np import pandas as pd from qlib.data.dataset import DatasetH device = "cuda" if torch.cuda.is_available() else "cpu" def _to_tensor(x): if not isinstance(x, torch.Tensor): return torch.te...
pd.Timestamp(x)
pandas.Timestamp
import biom import skbio import numpy as np import pandas as pd from deicode.matrix_completion import MatrixCompletion from deicode.preprocessing import rclr from deicode._rpca_defaults import (DEFAULT_RANK, DEFAULT_MSC, DEFAULT_MFC, DEFAULT_ITERATIONS) from scipy.linalg import svd ...
pd.DataFrame(v, index=table.columns, columns=rename_cols)
pandas.DataFrame
import numpy as np import pytest import pandas as pd from pandas import ( CategoricalDtype, CategoricalIndex, DataFrame, Index, IntervalIndex, MultiIndex, Series, Timestamp, ) import pandas._testing as tm class TestDataFrameSortIndex: def test_sort_index_and_reconstruction_doc_exa...
tm.assert_frame_equal(sorted_df, expected)
pandas._testing.assert_frame_equal
"""Functions for pulling data primarily from the EIA's Form 860.""" import logging import pandas as pd import sqlalchemy as sa import pudl from pudl.metadata.fields import apply_pudl_dtypes logger = logging.getLogger(__name__) def utilities_eia860(pudl_engine, start_date=None, end_date=None): """Pull all fiel...
pd.to_datetime(end_date)
pandas.to_datetime
from __future__ import absolute_import, division, print_function import datetime import pandas as pd from config import * def _drop_in_time_slice(m2m, m2b, m5cb, time_slice, to_drop): """Drops certain members from data structures, only in a given time slice. This can be useful for removing people who weren't...
pd.to_datetime(participation_dates['end_date'])
pandas.to_datetime
import requests from bs4 import BeautifulSoup import pandas as pd import numpy as np from datetime import date import time def add(): try: df = pd.read_csv('data pool/raw_ios.csv', index_col=0) except: df = pd.DataFrame() to_add = dict() month = input('Month: ') with open('names_urls.txt', 'r', encoding='...
pd.DataFrame()
pandas.DataFrame
import numpy as np import pandas as pd import argparse from astropy.io import fits from fiery_llama.matched_filters import PointFilter, cubeify parser = argparse.ArgumentParser() help_data = "Must be .h5 or .fits file type." parser.add_argument("data", help=help_data) table_help = "if .h5 file provide table name" pa...
pd.read_hdf(args.data, args.data_table)
pandas.read_hdf
# # Copyright 2018 Analytics Zoo 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...
pd.Timestamp(start_time)
pandas.Timestamp
import pandas as pd file_unitedstates = open("./data/unitedstates.csv", "r") file_russia = open("./data/russia.csv", "r") file_japan = open("./data/japan.csv", "r") unitedstates = file_unitedstates.read() russia = file_russia.read() japan = file_japan.read() the_set = [] df_us =
pd.read_csv("./data/unitedstates.csv", sep=",")
pandas.read_csv
import logging from typing import Any, Dict, Union from starlette.exceptions import HTTPException from .runner import ModelServingRunner from .serving import ModelServing try: import modin.pandas as pandas import numpy except ImportError: try: import pandas import numpy except ImportE...
pandas.DataFrame(value)
pandas.DataFrame
from pytorch_lightning.callbacks import ModelCheckpoint from test_tube import Experiment from pytorch_lightning import Trainer import argparse import logging import torch import scipy import os import pickle as pkl import pandas as pd from torch.utils.data import DataLoader from src.configs.configs import TGCN as TGCN...
pd.DataFrame.from_dict(speed_tile)
pandas.DataFrame.from_dict
import os import random import math import numpy as np import pandas as pd import itertools from functools import lru_cache ########################## ## Compliance functions ## ########################## def delayed_ramp_fun(Nc_old, Nc_new, t, tau_days, l, t_start): """ t : timestamp current date ...
pd.Timedelta(5, unit='D')
pandas.Timedelta
#!/usr/bin/env python # coding: utf-8 # In[1]: # import warnings # warnings.filterwarnings('ignore') # In[2]: # import libraries import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from scipy import sparse get_ipython().run_line_magic('matplotlib', 'inline') from sklearn...
pd.read_csv('data/test.csv')
pandas.read_csv
# Make a datafile with the wastewater data from Biobot and COVID-19 disease outcomes for # those areas and dates. Put into a format that is good for creating a Flourish chart. import pandas as pd from urllib import request BIOBOT_DOWNLOAD = "https://github.com/biobotanalytics/covid19-wastewater-data/raw/master/was...
pd.read_csv(BIOBOT_LOCAL, sep=',', header='infer', dtype=str)
pandas.read_csv
""" Collection of functions used for the stitching. IMPORTANT: The identification of the organization of the fovs in the composite image can be simplified if the (0,0) coords of the stage/camera will be set to the same position for all machine used in the analysis. In our case we started running experiments with the...
pd.read_parquet(ref_counts_fpath)
pandas.read_parquet
# The analyser import pandas as pd import matplotlib.pyplot as plt import dill import os import numpy as np from funcs import store_namespace from funcs import load_namespace import datetime from matplotlib.font_manager import FontProperties from matplotlib import rc community = 'ResidentialCommunity' sim_ids = ['M...
pd.to_datetime(emutemps_df1.index)
pandas.to_datetime
# -*- coding: utf-8 -*- ''' データの読み込みと確認 ''' # ライブラリのインポート import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns # ランダムシードの設定 import random np.random.seed(1234) random.seed(1234) # データの読み込み train = pd.read_csv('./data/train.tsv', sep='\t') test = pd.read_csv(...
pd.DataFrame(X_train_std)
pandas.DataFrame
import os import numpy as np import pandas as pd to_clean = ["old_mturk_first_person", "remaining_first_person"] dir = "data_to_curate" delta = 0.21 dfs = [] all_scenarios = [] all_labels = [] for c in to_clean: file = os.path.join(dir, c + ".tsv") df =
pd.read_csv(file, sep="\t", header=None)
pandas.read_csv
from datetime import datetime from enum import Enum from typing import List, Union, Dict import numpy as np import pandas as pd from dataclasses import dataclass from sklearn.base import BaseEstimator from sklearn.pipeline import Pipeline from ira.analysis.commissions import TransactionCostsCalculator, ZeroTCC from i...
pd.DatetimeIndex([last_idx])
pandas.DatetimeIndex
#!/usr/bin/env python import os,sys import pandas as pd import argparse daismdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0,daismdir) import daism.modules.simulation as simulation import daism.modules.training as training import daism.modules.prediction as prediction #-----------...
pd.read_csv(inputArgs.celltype,sep='\t')
pandas.read_csv
#!/usr/bin/python """ Copyright 2013 <NAME> (aka Daniel) 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 applic...
pd.date_range('2013-01-01 00:50', periods=N, freq='H')
pandas.date_range
from datetime import datetime import pytest from pytz import utc import pandas._testing as tm from pandas.tseries.holiday import ( MO, SA, AbstractHolidayCalendar, DateOffset, EasterMonday, GoodFriday, Holiday, HolidayCalendarFactory, Timestamp, USColumbusDay,...
Timestamp(x)
pandas.tseries.holiday.Timestamp
# Imports: standard library import os import re import logging from abc import ABC from typing import Any, Set, Dict, List, Tuple, Optional from datetime import datetime # Imports: third party import h5py import numpy as np import pandas as pd import unidecode # Imports: first party from ml4c3.utils import get_unix_t...
pd.to_datetime(time_stamps)
pandas.to_datetime
from datetime import datetime, timedelta from pandas import json from api.decorators import api_post, api_get from api.helper import json_response, json_error_response from api.utils import int_or_none from broker.models import BrokerVehicle, Broker from fms.decorators import authenticated_user from fms.views import ...
json.loads(request.body)
pandas.json.loads
from datetime import datetime from datetime import timedelta from datetime import date from collections import namedtuple import pytz from dateutil.rrule import * import requests import pandas as pd # TODO: pull in 120 days of data from tingo --> date, close, open, high, low, vols # TODO: calculate vols_adj, yc, yc...
pd.DataFrame(records)
pandas.DataFrame