prompt
stringlengths
19
1.03M
completion
stringlengths
4
2.12k
api
stringlengths
8
90
"""NEDSS data duplicate person-record detector. This program automates the process of identifying potential duplicate person-records in NEDSS data. The program takes two command line arguments (1) the filepath for NEDSS data; (2) the Identifier of the first person-record considered new. This application will then comp...
pd.read_excel(path)
pandas.read_excel
import pandas as pd import numpy as np import os from sklearn.metrics import roc_auc_score, accuracy_score from sklearn import metrics from scipy.stats import rankdata import math import argparse def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("--enspath", type=str, default="./da...
pd.read_csv(data_path + csv)
pandas.read_csv
import pandas as pd from autox.autox_competition.util import log def fe_time(df, time_col): log('[+] fe_time') result = pd.DataFrame() prefix = time_col + "_" df[time_col] =
pd.to_datetime(df[time_col])
pandas.to_datetime
''' MIT License Copyright (c) 2020 Minciencia Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, di...
pd.read_csv('../input/Vacunacion/vacunacion_region.csv')
pandas.read_csv
import matplotlib.pyplot as plt import pandas as pd class ProvData: def __init__(self, prov): self.prov = prov self.price_list = [] self.quality_list = [] self.size_list = [] self.size_frac_list = [] self.pop_funds_list = [] self.mk_funds_list = [] ...
pd.DataFrame(self.pop_ipc_list)
pandas.DataFrame
import pandas as pd ratings = pd.read_csv('dataset/ratings.csv') movies = pd.read_csv('dataset/movies.csv') all_movie = movies['title'].values new_movie = [] for movie in all_movie: split_movie = movie.split() split_movie.pop() string = ' '.join(split_movie) new_movie.append(string) movies['movie'] ...
pd.merge(movies,ratings)
pandas.merge
#%% from pymaid_creds import url, name, password, token from data_settings import pairs_path, data_date import pymaid rm = pymaid.CatmaidInstance(url, token, name, password) import matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd import cmasher as cmr from contools import Cascade...
pd.DataFrame([i_left, b_left, c_left, c_right, b_right, i_right], index = ['Ipsi(L)', 'Bilateral(L)', 'Contra(L)', 'Contra(R)', 'Bilateral(R)', 'Ipsi(R)'])
pandas.DataFrame
import datetime import os import pandas as pd import pygsheets import telegram TELEGRAM_API_TOKEN = os.environ["TELEGRAM_API_TOKEN_MARATHON"] bot = telegram.Bot(token=TELEGRAM_API_TOKEN) chat_id = -408362490 def authenticate_google_sheets(): client = pygsheets.authorize(service_account_file="servic...
pd.to_datetime(workout_df.index, format="%d %b %Y")
pandas.to_datetime
import warnings import numpy as np from pandas import Categorical, DataFrame, Series from .pandas_vb_common import tm class Construction: params = ["str", "string"] param_names = ["dtype"] def setup(self, dtype): self.series_arr = tm.rands_array(nchars=10, size=10 ** 5) self.frame_arr...
DataFrame(self.frame_cat_arr, dtype=dtype)
pandas.DataFrame
#!/usr/bin/env python # -*- coding: utf-8 -*- import pandas as pd from covsirphy.util.error import UnExecutedError from covsirphy.cleaning.term import Term from covsirphy.ode.mbase import ModelBase from covsirphy.simulation.estimator import Estimator from covsirphy.simulation.simulator import ODESimulator class Phas...
pd.DataFrame.from_dict(summary_dict, orient="index")
pandas.DataFrame.from_dict
# -*- coding: utf-8 -*- """ Created on Mon Jun 1 10:59:51 2020 Modified on ... look at git commit log, you lazy bum @author: <NAME>, Assistant Research Professor, CEE WSU @author: <NAME>, Ecoinformaticist, USDA-ARS contact: <EMAIL> Library of functions for the Azure Data Lake download codeset; see the readme within th...
pd.isna(df)
pandas.isna
# Copyright 2018-2019 QuantumBlack Visual Analytics Limited # # 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 # # THE SOFTWARE IS PROVIDED "AS IS"...
pd.DataFrame(search_cv.cv_results_)
pandas.DataFrame
import logging import numpy as np import pandas as pd from pytest import approx from lenskit.metrics.topn import recall from lenskit.util.test import demo_recs from lenskit import topn _log = logging.getLogger(__name__) def _test_recall(items, rel, **kwargs): recs = pd.DataFrame({'item': items}) truth = pd...
pd.Series([1, 3])
pandas.Series
#!/usr/bin/env python from __future__ import division import numpy as np import pandas as pd import warnings from .helpers import * def analyze_chunk(data, subjgroup=None, subjname='Subject', listgroup=None, listname='List', analysis=None, analysis_type=None, pass_features=False, **kwargs): """ Private functio...
pd.concat(analyzed_data)
pandas.concat
""" Fetch meteorological data from the SMEAR website and bind them as a CSV table. Hyytiälä COS campaign, April-November 2016 (c) 2016-2017 <NAME> <<EMAIL>> """ import io import argparse import copy import datetime import requests import numpy as np import pandas as pd import preproc_config def timestamp_parser(*a...
pd.Timestamp('%d-01-01' % start_year)
pandas.Timestamp
import argparse import collections import pandas import numpy as np import os import gym from keras.models import Sequential from keras.layers import Dense, Activation, Flatten import tensorflow as tf from rl.agents.cem import CEMAgent from rl.memory import EpisodeParameterMemory from noise_estimator import CartpoleP...
pandas.DataFrame(history_noisy.history)
pandas.DataFrame
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 01 10:00:58 2021 @author: <NAME> """ #------------------------------------------------------------------# # # # # # Imports # # # # # #------------------------------------------------------------------# from math import e import numpy as np import...
pd.DataFrame(data={'ismatched': ismatched, 'idx': idx, 'd2d': d2d})
pandas.DataFrame
""" Copyright 2019 <NAME>. 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 distribut...
pd.DataFrame(response)
pandas.DataFrame
from pathlib import Path import os import pandas as pd import numpy as np def get_country_geolocation(): dir_path = os.path.dirname(os.path.realpath(__file__)) country_mapping = pd.read_csv( dir_path + '/data_files/country_centroids_az8.csv', dtype=str) country_mapping = country_mapping.iloc[:, [...
pd.read_csv(csv_file)
pandas.read_csv
# -*- coding: utf-8 -*- """ SCRIPT # 3 Created on Fri Jul 31 01:40:28 2020 @author: omid """ import numpy as np import pandas as pd import glob from khayyam import * allStocks = pd.read_pickle("./allStocks.pkl") bookvalues = pd.read_pickle("./bookvalues.pkl") ############################ compute a retur...
pd.DataFrame(columns = [1,2,3,4,5,6], index = allStocks.index)
pandas.DataFrame
# Modified the provided preprocessing code # @author <NAME> # Original license # Copyright 2020 (c) Cognizant Digital Business, Evolutionary AI. All rights reserved. Issued under the Apache 2.0 License. import os # noinspection PyPep8Naming import numpy as np import pandas as pd import tensorflow as tf from .xpriz...
pd.read_csv(ADDITIONAL_BRAZIL_CONTEXT)
pandas.read_csv
# Control de datos from io import BytesIO from dateutil import tz from pathlib import Path from zipfile import ZipFile from json import loads as loads_json from datetime import datetime, timedelta from requests import get as get_request # Ingeniería de variables from geopandas import read_file from pandas import DataF...
concat([acum, new], ignore_index=True)
pandas.concat
from typing import Any, Literal from pandas import DataFrame, concat from weaverbird.backends.pandas_executor.types import DomainRetriever, PipelineExecutor from weaverbird.pipeline.steps import AggregateStep AggregateFn = Literal[ 'avg', 'sum', 'min', 'max', 'count', 'count distinct', 'f...
concat(aggregated_cols, axis=1)
pandas.concat
from slytherin.hash import hash_object from slytherin.functions import get_function_arguments from ravenclaw.preprocessing import Polynomial, Normalizer from sklearn.linear_model import LinearRegression from sklearn.ensemble import RandomForestClassifier from pandas import DataFrame, concat from random import randint...
DataFrame.from_records([x])
pandas.DataFrame.from_records
import itertools import json import os import csv import errno import random from random import shuffle from typing import List import spacy from tqdm import tqdm import pandas as pd import codecs import nltk import glob import xml.etree.ElementTree as ET from datasets import load_dataset import statistics import json ...
pd.read_json(filename)
pandas.read_json
import sys import os import numpy as np from tqdm import tqdm import json import time as timemodu from numba import jit, prange import h5py import fnmatch import pandas as pd import astropy import astropy as ap from astropy.io import fits from astropy.coordinates import SkyCoord from astropy.io import fits impor...
pd.read_csv(path)
pandas.read_csv
import difflib import glob import json import os import numpy as np import pandas as pd from daps.utils.extra import levenshtein_distance ACTIVITYNET_ANNOTATION_FILE = 'activity_net.v1-2.gt.json' ANET_SIMILAR_CLASS_IDS_WITH_THUMOS14 = [159, 82, 233, 224, 195, 116, 80, 106, 169...
pd.read_csv(i, header=None, sep=' ')
pandas.read_csv
import numpy as np import pandas as pd from collections import namedtuple from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D import pickle import config as cf EpisodeStats = namedtuple("EpisodeStats",["episode_lengths", "episode_rewards", "episode_runtime"]) TimeStats = namedtuple("TimeStats"...
pd.Series(stats2.episode_rewards)
pandas.Series
"""Unit tests for the :mod:`pudl.helpers` module.""" import pandas as pd from pandas.testing import assert_frame_equal from pudl.helpers import (convert_df_to_excel_file, convert_to_date, fix_eia_na, fix_leading_zero_gen_ids) def test_convert_to_date(): """Test automated cleanup of EIA...
assert_frame_equal(out_df, expected_df)
pandas.testing.assert_frame_equal
""" Script to plot the time series data for solar data starting with the data found in 1601_18.46_-66.11_2016.csv hatfieldm links: - https://openei.org/datasets/dataset?sectors=buildings&tags=renewable+energy - https://openei.org/datasets/dataset/rooftop-solar-challenge-rsc-database/resource/2a27dca6-5d04-48...
pd.read_csv(data_file, header=2)
pandas.read_csv
# Copyright 2019, 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 applicable law or agreed to in writing...
pd.Series(series_data)
pandas.Series
import os,sys from pathlib import Path sys.path.append(str(Path(os.path.realpath(__file__)).parent.parent.absolute())) #https://stackoverflow.com/questions/19451767/datetime-between-statement-not-working-in-sql-server from sqlalchemy import create_engine import time import pandas as pd import datetime as dt nw = dt....
pd.to_datetime(x[k])
pandas.to_datetime
""" 30 May 2020 Author: <NAME> After we have cleaned all the datasets, we will now combine everything into a single dataframe. Saving it as csv for the moment as we are still trying to figure out how we can best share this data. """ import pandas as pd #Simple calling of all the cleaned csv files with the file pa...
pd.read_csv(r"file_path\API_Pahang_2018_cleaned.csv")
pandas.read_csv
# util.py (lciafmt) # !/usr/bin/env python3 # coding=utf-8 """ This module contains common functions for processing LCIA methods """ import uuid import os from os.path import join import lciafmt import logging as log import pandas as pd import numpy as np import yaml import pkg_resources import subprocess from esupy.pr...
pd.read_csv(datapath+"/"+source+"_"+name+".csv")
pandas.read_csv
import numpy as np import scipy as sp import pandas as pd import ast import gensim from gensim.corpora import Dictionary import networkx as nx import network_utils as nu import matplotlib.pyplot as plt import matplotlib.cm as cm # -------------------------------------------------------------------------------------...
pd.read_csv('../data/sessionData.csv')
pandas.read_csv
#! /usr/bin/env python import os import tempfile import shutil import warnings warnings.filterwarnings("ignore") from unittest import TestCase from pandashells.lib import plot_lib, arg_lib import argparse from mock import patch, MagicMock import matplotlib as mpl import pylab as pl import pandas as pd from dateutil.par...
pd.DataFrame([[1, 1], [2, 2]], columns=['x', 'y'])
pandas.DataFrame
import pandas as pd import numpy as np import random from sklearn.metrics.pairwise import cosine_similarity from sklearn.feature_extraction.text import TfidfVectorizer import sklearn.preprocessing as pp from datetime import datetime from sklearn.linear_model import SGDClassifier from sklearn.preprocessing import Standa...
pd.Series(99.0, index=[text_id])
pandas.Series
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_utils.ipynb (unless otherwise specified). __all__ = ['logger', 'set_seed', 'set_session_options', 'setup_logging', 'setup_parser', 'timecode', 'print_device_info', 'dump_tensors', 'Monitor', 'show_gpu', 'round_t', 'merge_dicts', 'display_all', 'unpac...
pd.read_csv(path, nrows=1)
pandas.read_csv
# import libraries import pandas as pd import numpy as np import seaborn as sns import matplotlib.pylab as plt def load_and_process(zomato_file_path, forex_file_path, countrycode_file_path): """ This method takes the loads, processes, and formats the zomato.csv file to be returned as a dataframe. Argu...
pd.read_excel(countrycode_file_path)
pandas.read_excel
import pandas as pd import numpy as np import os from datetime import datetime from IPython.display import IFrame,clear_output # for PDF reading import textract import re import sys import docx from difflib import SequenceMatcher ##################################################################################...
pd.to_timedelta('1 day')
pandas.to_timedelta
import pytest import pandas as pd from pandas.testing import assert_frame_equal from pathlib import Path from data_check.sql import DataCheckSql, LoadMode # noqa E402 from data_check.config import DataCheckConfig # noqa E402 @pytest.fixture(scope="module", params=["csv", "xlsx"]) def file_type(request): retur...
assert_frame_equal(data, df)
pandas.testing.assert_frame_equal
import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, Index, Series, ) import pandas._testing as tm dt_data = [ pd.Timestamp("2011-01-01"), pd.Timestamp("2011-01-02"), pd.Timestamp("2011-01-03"), ] tz_data = [ pd.Timestamp("2011-01-01", tz="U...
pd.concat([s1, s2], ignore_index=True)
pandas.concat
from datetime import datetime from io import StringIO import itertools import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Period, Series, Timedelta, date_range, ) import pandas._testing as tm ...
Series([1.0, 50.0, 100.0])
pandas.Series
import json import os import pandas as pd from .utils import list_to_md_table SCHEMA_TO_PANDAS_TYPES = { "integer": "int64", "number": "float", "string": "string", "any": "object", "boolean": "bool", } FORMAT_TO_REGEX = { # https://emailregex.com/ "email": r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-...
pd.DataFrame(config["resources"])
pandas.DataFrame
#!/usr/bin/env python import requests import os import string import random import json import datetime import pandas as pd import numpy as np import moment from operator import itemgetter class IdsrAppServer: def __init__(self): self.dataStore = "ugxzr_idsr_app" self.period = "LAST_7_DAYS" self.ALPHABET = '0...
pd.DataFrame()
pandas.DataFrame
import os import copy import time import numpy as np import pandas as pd import torch from tqdm import tqdm import typing as Dict def init_log_loss(last_log_loss_csv, num_models=None): last_best_avg_loss_all = np.inf if last_log_loss_csv is None: if num_models is None: raise ValueError('Mi...
pd.read_csv(last_log_loss_csv)
pandas.read_csv
# <NAME> # Last Modified: 5/22/2020 # Verify fluid properties for Flinak # Reference: "Annals of Nuclear Energy", Romatoski and Hu # Note: #Temperature is in Kelvin import os import sys sys.path.insert(0,'..') #This adds the ability to call flinak prop from the main folder sys.path.insert(0,'./Flinak') #Looking for ...
pd.DataFrame(viscositydataframes)
pandas.DataFrame
# -*- coding: utf-8 -*- """ Results, graphs @author: a.stratigakos """ import numpy as np import matplotlib.pyplot as plt import pandas as pd import os, sys import pickle from sklearn.ensemble import RandomForestRegressor from scipy import interpolate, stats import cvxpy as cp import matplotlib.patches as patches # ...
pd.read_csv(directory+'\\load_scenarios.csv', index_col=0)
pandas.read_csv
import requests import pandas as pd import re from bs4 import BeautifulSoup url=requests.get("http://www.worldometers.info/world-population/india-population/") t=url.text so=BeautifulSoup(t,'html.parser') all_t=so.findAll('table', class_="table table-striped table-bordered table-hover table-condensed table-list"...
pd.Series.tolist(bv[0:7][4])
pandas.Series.tolist
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import matplotlib.pyplot as plt from sklearn import preprocessing, model_selection, metrics import lightgbm as lgb pd.options.mode.chained_assignment = None pd.options.display.max_columns = 999 train_df = pd.read_csv("C:\\Users\\jowet\\Downloads\...
pd.read_csv("C:\\Users\\jowet\\Downloads\\kaggle\\avito\\test.csv", parse_dates=["activation_date"])
pandas.read_csv
# pylint: disable-msg=E1101,W0612 import pytest import numpy as np import pandas as pd import pandas.util.testing as tm from pandas.core.sparse.api import SparseDtype class TestSparseSeriesIndexing(object): def setup_method(self, method): self.orig = pd.Series([1, np.nan, np.nan, 3, np.nan]) sel...
tm.assert_sp_series_equal(s.iloc[indexer], exp)
pandas.util.testing.assert_sp_series_equal
import json import pandas as pd from sklearn.model_selection._search import ParameterGrid from logging_ import Logger from adv_lib.attacks import fmn, alma, apgd from adv_lib.attacks.auto_pgd import minimal_apgd #from robustbench.utils import load_model from tracking import PyTorchModelTracker from torchvision import t...
pd.read_csv(path)
pandas.read_csv
def calculateAnyProfile(profileType, df_labs, df_meds, df_procedures, df_diagnoses, df_phenotypes): """Calculate a single profile based on the type provided and data cleaned from getSubdemographicsTables Arguments: profileType -- which individual profile type you would like generated, this will be the ...
pd.to_datetime(x.ADMIT_DATE)
pandas.to_datetime
# -*- coding: utf-8 -*- """ Created on Sun May 21 13:13:26 2017 @author: ning """ import pandas as pd import os import numpy as np import matplotlib.pyplot as plt import pickle try: function_dir = 'D:\\NING - spindle\\Spindle_by_Graphical_Features' os.chdir(function_dir) except: function_dir = 'C:\\Users\...
pd.concat(df_graph)
pandas.concat
"""Extended DataFrame functionality.""" from typing import Any, Iterator, Optional, Sequence, Text, Tuple, Union, cast import numpy as np import pandas as pd from snmp_fetch.utils import cuint8_to_int from .types import ip_address as ip def column_names( n: Optional[int] = None, alphabet: Sequence[Text] = ...
pd.api.extensions.register_dataframe_accessor('inet')
pandas.api.extensions.register_dataframe_accessor
# -*- coding: utf-8 -*- """ Created on Thu Feb 10 00:10:23 2022 @author: <NAME> Adapted from <NAME> """ r""" Forward Model """ # Standard Library imports import gzip import numpy as np import pandas as pd import xarray as xr # Third party imports from collections import OrderedDict # Semi-...
pd.Series(chi0_0.iloc[-1], index=timestamps)
pandas.Series
import pandas as pd from business_rules.operators import (DataframeType, StringType, NumericType, BooleanType, SelectType, SelectMultipleType, GenericType) from . import TestCase from decimal import Decimal import sys import pandas class Str...
pandas.Series([True, False, False])
pandas.Series
from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd # plt.close("all") CURRENT_DIRECTORY = Path(__file__).parent def plot_01(): ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000)) ts = ts.cumsum() ts.plot() # Display plo...
pd.date_range('1/1/2000', periods=1000)
pandas.date_range
#!/usr/bin/env python # coding: utf-8 # In[4]: # -*- coding: utf-8 -*- """ Created on Tue May 4 17:39:59 2021 Collection of custom evaluation functions for embedding @author: marathomas """ import numpy as np import pandas as pd from sklearn.neighbors import NearestNeighbors from sklearn.metrics import silhouett...
pd.DataFrame(stats_tab)
pandas.DataFrame
#!/usr/bin/env python # stdlib imports import os.path import argparse from collections import OrderedDict import sys import warnings import textwrap import logging # third party imports import pandas as pd # local imports from gmprocess.io.read import _get_format, read_data from gmprocess.utils.args import add_share...
pd.set_option('display.max_columns', 10000)
pandas.set_option
# -*- coding: utf-8 -*- """ Created on Sun Dec 2 21:53:00 2018 @author: RomanGutin """ import numpy as np import pandas as pd plot_data={} #####AM_Tuning With Wavelet def AM_W(x,first,last,steps): sweep = list(np.linspace(first,last,(last-first)/steps)) #the first amino acid for acid in count_df.index: ...
pd.DataFrame([sweep,CrossValidation_Scores])
pandas.DataFrame
# -*- coding: utf-8 -*- from __future__ import print_function from datetime import datetime, timedelta import functools import itertools import numpy as np import numpy.ma as ma import numpy.ma.mrecords as mrecords from numpy.random import randn import pytest from pandas.compat import ( PY3, PY36, OrderedDict, ...
tm.assert_frame_equal(result, expected)
pandas.util.testing.assert_frame_equal
from collections import abc, deque from decimal import Decimal from io import StringIO from warnings import catch_warnings import numpy as np from numpy.random import randn import pytest from pandas.core.dtypes.dtypes import CategoricalDtype import pandas as pd from pandas import ( Categorical, DataFrame, ...
tm.assert_frame_equal(res, exp)
pandas._testing.assert_frame_equal
"""figures of merit is a collection of financial calculations for energy. This module contains financial calculations based on solar power and batteries in a given network. The networks used are defined as network objects (see evolve parsers). TODO: Add inverters: Inverters are not considered at the momen...
pd.concat([solar_power, meas_dict[key][meas].iloc[:,column]])
pandas.concat
# Licensed to Modin Development Team under one or more contributor license agreements. # See the NOTICE file distributed with this work for additional information regarding # copyright ownership. The Modin Development Team licenses this file to you under the # Apache License, Version 2.0 (the "License"); you may not u...
is_list_like(by)
pandas.core.dtypes.common.is_list_like
import tensorflow as tf from tensorflow import keras import matplotlib.pyplot as plt import pandas as pd import numpy as np import os import time # prepare data (X_train_full, y_train_full),(X_test, y_test) = keras.datasets.fashion_mnist.load_data() num_valid = 5000 X_valid = X_train_full[:num_valid] / 255. X_train = ...
pd.DataFrame(history.history)
pandas.DataFrame
# -*- coding: utf-8 -*- import yfinance as yf import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler import pandas as pd import os import math import matplotlib.pylab as plt import matplotlib from Machine_Learning_for_Asset_Managers import ch2_fitKDE_find_best_bandwidth as best_bandwidth...
pd.Series(pho[-50:])
pandas.Series
import pandas as pd import config import numpy as np import os import datetime class AttendanceMarker: def __init__(self): # current datetime to put attendance now = datetime.datetime.now() self.time = now.strftime(config.DATE_TIME_FORMAT) def _create_new_csv(self): names = o...
pd.DataFrame(data=names,columns=[config.CSV_COL_NAME])
pandas.DataFrame
# Import required Libraries import csv from bs4 import BeautifulSoup from selenium import webdriver from openpyxl import Workbook import pandas as pd # Function to get the search term def get_url(search_term): """Generate a URL from search term""" template = 'https://www.amazon.com/s?k={}' search_term = se...
pd.DataFrame({'Product Name':records})
pandas.DataFrame
from __future__ import absolute_import # PopulationSim # See full license in LICENSE.txt. from builtins import object import logging import os import numpy as np import pandas as pd from activitysim.core.config import setting from .lp import get_single_integerizer from .lp import STATUS_SUCCESS from .lp import STAT...
pd.Series(relaxed_control_totals, index=incidence_table.columns.values)
pandas.Series
from rest_framework import permissions, status from rest_framework.decorators import api_view, authentication_classes, permission_classes from rest_framework.response import Response from rest_framework.views import APIView from datetime import date, datetime, timedelta from django.forms.models import model_to_dict fro...
pd.DataFrame(web_activity_data)
pandas.DataFrame
#!/usr/bin/env python3 """ Gaussian mixture fitting with Nested Sampling. This module was tested in the main `nestfit` repo on bare arrays and Gaussian components -- without a spectral axis, units, or other necessary complications. The `.wrapped` references a Cython implementation of the Gaussian model class. """ imp...
pd.DataFrame(margs)
pandas.DataFrame
import pandas as pd import bentoml from bentoml.artifact import PickleArtifact from bentoml.handlers import DataframeHandler from data_preprocess import Posts from word_embedding_vectorizer import WordEmbeddingVectorizer from gensim.models import Word2Vec @bentoml.artifacts([PickleArtifact('word_vectorizer'), ...
pd.DataFrame({'text': series, 'confidence_score': confidence_score, 'labels': pred_labels})
pandas.DataFrame
#!/usr/bin/env python3 import websocket import config import json import pandas as pd import numpy as np from src.data_methods import get_gestures from src.leap_methods import collect_frame import src.features as features import random import time import argparse parser = argparse.ArgumentParser() parser.add_argumen...
pd.DataFrame(frames)
pandas.DataFrame
# Author: <NAME> # Email: <EMAIL> import numpy as np import pandas as pd pd.options.mode.chained_assignment = None # default='warn' import matplotlib.pyplot as plt import logging class TrajDataset: def __init__(self): """ data might include the following columns: "scene_id", "frame_id", "...
pd.unique(self.data["frame_id"])
pandas.unique
import pandas as pd def generate_train(playlists): # define category range cates = {'cat1': (10, 50), 'cat2': (10, 78), 'cat3': (10, 100), 'cat4': (40, 100), 'cat5': (40, 100), 'cat6': (40, 100),'cat7': (101, 250), 'cat8': (101, 250), 'cat9': (150, 250), 'cat10': (150, 250)} cat_pids = {} ...
pd.merge(df_eval_itr, df, on='tid')
pandas.merge
#!/usr/bin/env python # coding: utf-8 # In[66]: #置入所需套件 import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn.decomposition import PCA # Load in the data df =
pd.read_csv("InterestsSurvey.csv")
pandas.read_csv
import time import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib import cm as cm import seaborn as sns sns.set_style("whitegrid") import sys import os from pathlib import Path from sklearn import metrics from sklearn.preprocessing import StandardScaler from sklearn.model_selection i...
pd.Series(train_scores_std, name='training_score_std')
pandas.Series
# encoding: utf-8 ''' 组合策略测试 ''' import sys sys.path.append('../../') from vnpy.app.cta_strategy.strategies.strategyMulti import MultiStrategy import argparse import pandas as pd import numpy as np from datetime import datetime from setup_logger import setup_logger setup_logger(filename='logsBackTest/vnpy_{0}.log'.fo...
pd.DataFrame([i.__dict__ for i in engine.history_data])
pandas.DataFrame
import numpy as np import pytest from pandas import Categorical, Series import pandas._testing as tm @pytest.mark.parametrize( "keep, expected", [ ("first", Series([False, False, False, False, True, True, False])), ("last", Series([False, True, True, False, False, False, False])), (Fa...
tm.assert_series_equal(sc, tc[~expected])
pandas._testing.assert_series_equal
# External Libraries from datetime import date import pandas as pd pd.options.mode.chained_assignment = None import os from pathlib import Path import logging, coloredlogs # Internal Libraries import dicts_and_lists as dal import Helper # ------ Logger ------- # logger = logging.getLogger('get_past_datasets.py') color...
pd.read_html(url, match='Basic')
pandas.read_html
""" Name: foneutil Version: 0.4.4 Info: Python based script in order to record customer interactions, allowing the user to record relevant information from customer interaction. The script allows for the user to edit already entered in real time. Requirements: Pandas, pyfiglet and termcolor modules Created ...
pd.read_csv(filename)
pandas.read_csv
import matplotlib.pyplot as pl import numpy as np import pandas as pd from pyitab.analysis.results.base import filter_dataframe from pyitab.analysis.results.dataframe import apply_function import seaborn as sns from matplotlib.colors import LinearSegmentedColormap def find_distance_boundaries(data): scene_center ...
pd.concat(full_dataset)
pandas.concat
# -*- coding: utf-8 -*- #%% from datetime import datetime startTime =datetime.now() import pandas as pd """ import numpy as np import glob import matplotlib.pyplot as plt import sys import time import datetime from datetime import timedelta import matplotlib.gridspec as gridspec import matplotlib.cm...
pd.concat([d1,d2,d3,d4,d5,d6,d7,d8,d9,d10])
pandas.concat
""" This is used for visualizing -- not really needed otherwise """ import os os.environ["DISPLAY"] = "" import argparse import h5py import seaborn as sns import matplotlib.pyplot as plt from tqdm import tqdm import numpy as np import json import pandas as pd from matplotlib.animation import FuncAnimation COLORS = n...
pd.DataFrame(df)
pandas.DataFrame
from sklearn.metrics import pairwise_distances import pandas as pd import geopandas as gpd import lib.helpers as helpers def zone_distances(zones): """ :param zones GeoDataFrame [*index, zone, geometry] Must be in a CRS of unit: metre """ for ax in zones.crs.axis_info: assert ax.unit_n...
pd.Timedelta(timethreshold_hours, "hours")
pandas.Timedelta
__version__ = '0.1.3' __maintainer__ = '<NAME> 31.12.2019' __contributors__ = '<NAME>, <NAME>' __email__ = '<EMAIL>' __birthdate__ = '31.12.2019' __status__ = 'dev' # options are: dev, test, prod #----- imports & packages ------ if __package__ is None or __package__ == '': import sys from os import path ...
pd.to_datetime(self.data['tripEndClock'], format='%H:%M')
pandas.to_datetime
import pandas as pd from datetime import datetime as dt # Here we should fetch our data from the Twitter API but since now we have to # apply for getting API's credentials we pass this step for the sake of the tutorial. # We use data.csv as source of tweets. LOCAL_DIR = '/tmp/' def main(): # Create the datafram...
pd.read_csv('~/airflow/dags/data/data.csv', encoding='latin1')
pandas.read_csv
import pandas as pd import numpy as np index =
pd.date_range('1/1/2000', periods=8)
pandas.date_range
import os from pathlib import Path import json import pandas as pd from google.cloud import bigquery from datetime import datetime, timedelta, timezone JST = timezone(timedelta(hours=+9), 'JST') class Database: def __init__(self): super().__init__() self._usr_table = pd.DataFrame() ...
pd.DataFrame({'uid': uid_list, 'uname': uname_list})
pandas.DataFrame
import warnings from typing import Union import re import pandas as pd import numpy as np from sklearn.pipeline import Pipeline from sklearn.compose import ColumnTransformer, make_column_selector from sklearn import metrics from feature_engine.imputation import ( CategoricalImputer, AddMissingIndicator, Mea...
pd.concat([df, nan_num_ind])
pandas.concat
# -*- coding:utf-8 -*- ############################################################## # Created Date: Wednesday, September 2nd 2020 # Contact Info: <EMAIL> # Author/Copyright: Mr. <NAME> ############################################################## import random, urllib3, json, requests, math, plotly import pandas a...
pd.to_timedelta(Line_Curr_CV_Time*60, unit='s')
pandas.to_timedelta
import csv import math from absl import app, flags import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt import numpy as np from pylot_utils import ProfileEvent, ProfileEvents, fix_pylot_profile from utils import setup_plot import pandas as pd import seaborn as sns from utils import * from p...
pd.concat(runtimes_dfs)
pandas.concat
# Created on 2020/7/16 # This module is for functions generating random time series. # Standard library imports from datetime import datetime from typing import Union # Third party imports import numpy as np import pandas as pd from typeguard import typechecked # Local application imports from .. import timeseries ...
pd.date_range(start=start_date, end=end_date, freq=frequency)
pandas.date_range
import numpy as np import pandas as pd from datetime import datetime, timedelta from tqdm import tqdm import yaml import os from sklearn.compose import ColumnTransformer from sklearn.preprocessing import OneHotEncoder from joblib import dump, load from category_encoders import OrdinalEncoder from src.data.spdat import ...
pd.to_datetime(cfg['DATA']['GROUND_TRUTH_DATE'])
pandas.to_datetime
#!/usr/bin/env python # coding: utf-8 #get_ipython().magic('load_ext autoreload') #get_ipython().magic('reload_ext autoreload') import requests import lxml.html as hl from xml.etree import ElementTree import pandas as pd import numpy as np from bs4 import BeautifulSoup from queue import Queue, Empty from urlli...
pd.merge(article_df[['ArticleID','Title']],nobel_author_df[['ArticleID','AuthorOrder','AuthorDAIS','FullName','LastName']],on=['ArticleID'],how='inner')
pandas.merge
import toml import pandas as pd from pathlib import Path def excel_mqtt_topics_to_toml( excelFile="metadata.xlsx", tomlDestination="src/backend/.config/topics.toml" ): df = pd.read_excel(excelFile, sheet_name="mqtt_topics") d = df.to_dict() topics = [d["topic"][row] for row in d["topic"]] qos = [d...
pd.read_excel(excelFile, sheet_name="3D_cages")
pandas.read_excel
import operator import functools as f import json from pkg_resources import resource_filename import pandas as pd def _events_cleaning_map(): with open(resource_filename(__name__, 'events_cleaning_map.json')) as json_map: return(json.load(json_map)) def _find(element_path): return lambda json: f.reduce(...
pd.concat([events_without_generic_cols, details], axis=1)
pandas.concat
""" Tests for the blaze interface to the pipeline api. """ from __future__ import division from collections import OrderedDict from datetime import timedelta, time from unittest import TestCase import warnings import blaze as bz from datashape import dshape, var, Record from nose_parameterized import parameterized im...
pd.Timestamp('2014-01-01')
pandas.Timestamp
from numbers import Number from typing import List import pandas as pd from pandas.api.types import is_integer_dtype, is_float_dtype, is_string_dtype, is_numeric_dtype from sklearn.base import TransformerMixin from sklearn.impute import KNNImputer from sklearn.preprocessing import LabelEncoder from model_config impor...
is_float_dtype(train_df[col])
pandas.api.types.is_float_dtype