prompt
stringlengths
19
1.03M
completion
stringlengths
4
2.12k
api
stringlengths
8
90
import pandas as pd class Write: def Write(self, df, target_path): print(f'\n===\nWriting data to target: {target_path} ...') # Write the collated and formated data to a new file # Create separate DataFrames for each sheet in the Migration Template df_member = pd.DataFrame.from_dic...
pd.DataFrame.from_dict(df['Op - Yes_No'])
pandas.DataFrame.from_dict
from unittest import TestCase from unittest.mock import Mock, patch import copulas import numpy as np import pandas as pd import pytest from copulas import univariate from rdt.transformers.null import NullTransformer from rdt.transformers.numerical import ClusterBasedNormalizer, FloatFormatter, GaussianNormalizer c...
pd.Series([0.0, np.nan, 1.0])
pandas.Series
import pandas as pd # Part I: Data Index # data=pd.series([5,4,-2,3,7]) data=pd.Series([5,4,-2,3,7], index=["a","b","c","d","e"]) print(data) # Part II: Observe Data print("Data Type", data.dtype) print("Data Number", data.size) print("Data Index", data.index) # Part III: Get Data print(data[2], data[0]) print(data[...
pd.Series(["你好","Python","Pandas"])
pandas.Series
"""Silly data generator (Faker (https://github.com/joke2k/faker) and others are much better, but we just need something simple""" import string # Third Party import pandas as pd import numpy as np def df_random(num_numeric=3, num_categorical=3, num_rows=100): """Generate a dataframe with random data. This is...
pd.Categorical.from_codes(splitter, categories=category_values)
pandas.Categorical.from_codes
#reproducability from numpy.random import seed seed(1+347823) import tensorflow as tf tf.random.set_seed(1+63493) import numpy as np import os import pandas as pd import datetime from matplotlib import pyplot from sklearn.preprocessing import MinMaxScaler import tensorflow as tf import shap gpus = tf.config.experim...
pd.read_csv(pathGW+Well_ID+'_GW-Data.csv',parse_dates=['Date'],index_col=0, dayfirst = True,decimal = '.', sep=',')
pandas.read_csv
"""MODFLOW support utilities""" import os from datetime import datetime import shutil import warnings import numpy as np import pandas as pd import re pd.options.display.max_colwidth = 100 from pyemu.pst.pst_utils import SFMT,IFMT,FFMT,pst_config,\ parse_tpl_file,try_process_output_file from pyemu.utils.os_utils im...
pd.read_csv(sft_file,skiprows=1,delim_whitespace=True)
pandas.read_csv
# -*- coding: utf-8 -*- from pmdarima.arima import ARIMA, auto_arima, AutoARIMA from pmdarima.arima.arima import VALID_SCORING, _uses_legacy_pickling from pmdarima.arima.auto import _post_ppc_arima from pmdarima.arima.utils import nsdiffs from pmdarima.arima.warnings import ModelFitWarning from pmdarima.compat.pytest ...
pd.Series(hr)
pandas.Series
#!/usr/bin/python # -*- coding: utf-8 -*- import decimal import datetime import pandas as pd from scipy.optimize import fsolve from django.http import HttpResponse from django.shortcuts import render from .models import Currency, Category, Bank, Account, AccountCategory, AccountRec, Risk, InvProj, InvRec from . impo...
pd.Series(name=cat.name)
pandas.Series
import warnings warnings.filterwarnings('ignore') from sklearn.model_selection import KFold, StratifiedKFold import pandas as pd import numpy as np class BaggingRegressor(): def __init__(self, regressors, seeds = [2022], n_fold=5): self.regressors = regressors self.n_regressors = 1 if type(self.r...
pd.DataFrame()
pandas.DataFrame
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.2 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + import numpy as np i...
pd.DataFrame()
pandas.DataFrame
# coding: utf-8 # # Interrogating building age distributions # # This notebook is to explore the distribution of building ages in # communities in Western Australia. from os.path import join as pjoin import pandas as pd import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from ...
pd.unique(suburblist)
pandas.unique
from collections import OrderedDict import pydoc import warnings import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, DatetimeIndex, Index, Series, TimedeltaIndex, date_range, period_range, timedelta_range, ) from pandas.core.arrays impo...
Categorical(["a", "b", np.nan, "a"])
pandas.Categorical
import numpy as np import matplotlib.pyplot as plt import pandas as pd from .mean_action import get_mean_action from .drawer.berthing_trajectory_drawer import BerthingTrajectoryDrawer def test(norm_init_coords, init_heading_angle, env, model, deterministic=False, use_recurrent_model=False): env.reset() ...
pd.DataFrame(state_hist, columns=["x_hist", "y_hist", "heading_angle_hist", "n_hist", "rudder_angle_hist", "u_hist", "v_hist", "r_hist"])
pandas.DataFrame
import pandas as pd import matplotlib.pyplot as plt import numpy as np from pandas.core.reshape.concat import concat import streamlit as st import os from pathlib import Path #Data Structures class DataGroup : def __init__(self, name, timepoint, dataframe): self.name = name self.timepoint = tim...
pd.DataFrame(data = [avg_percent_change, normalized_std, normalized_sem, normalized_n_row], index = ['%Change','SD','SEM', 'N'], columns= group_id)
pandas.DataFrame
import argparse import json import os import pandas as pd import requests def get_parser(): parser = argparse.ArgumentParser(description=__doc__) input_group = parser.add_mutually_exclusive_group(required=True) input_group.add_argument('-i', "--infile", action='store', help="""Path...
pd.DataFrame()
pandas.DataFrame
import pandas as pd import plotly.express as px import datetime as dt dd =
pd.read_csv('validation/lithuania_processed.csv', header=2)
pandas.read_csv
from datetime import timedelta from functools import partial import itertools from parameterized import parameterized import numpy as np from numpy.testing import assert_array_equal, assert_almost_equal import pandas as pd from toolz import merge from zipline.pipeline import SimplePipelineEngine, Pipeline, CustomFacto...
pd.date_range("2015-01-20", "2015-02-09")
pandas.date_range
# -*- coding: utf-8 -*- """ Tests dtype specification during parsing for all of the parsers defined in parsers.py """ import pytest import numpy as np import pandas as pd import pandas.util.testing as tm from pandas import DataFrame, Series, Index, MultiIndex, Categorical from pandas.compat import StringIO from pan...
CategoricalDtype(['a', 'b', 'd', 'e'])
pandas.core.dtypes.dtypes.CategoricalDtype
def btrain(names,homepath): import numpy as np import pandas as pd import warnings warnings.filterwarnings("ignore") #reading data and doing work cresult=pd.DataFrame() nresult=pd.DataFrame() for index in range(len(names)): Cancer = pd.read_csv(homepath+"/train_data/cancer/"+ ...
pd.DataFrame()
pandas.DataFrame
import unittest import pytest import pandas as pd from analitico.schema import generate_schema, apply_schema from .test_mixin import TestMixin # pylint: disable=no-member @pytest.mark.django_db class DatasetTests(unittest.TestCase, TestMixin): """ Unit testing of Dataset functionality, reading, converting, tra...
pd.isnull(df.iloc[3, 2])
pandas.isnull
# -*- coding: utf-8 -*- # pylint: disable=E1101,E1103,W0232 import os import sys from datetime import datetime from distutils.version import LooseVersion import numpy as np import pandas as pd import pandas.compat as compat import pandas.core.common as com import pandas.util.testing as tm from pandas import (Categor...
pd.period_range('2011-01-01 09:00', freq='H', periods=1)
pandas.period_range
''' Created on 18.03.2015 @author: <NAME> ''' import pandas as pd from pandas import Series, DataFrame, MultiIndex import matplotlib.pyplot as plt import matplotlib import matplotlib.gridspec as gridspec import numpy as np from matplotlib.patches import Polygon from docutils.languages.af import labels # import Histo...
DataFrame(results, index=indicis,columns=columns4Results)
pandas.DataFrame
# Author: <NAME> # Created: 7/7/20, 10:12 AM import logging import argparse import pandas as pd from typing import * import matplotlib.pyplot as plt import seaborn from tqdm import tqdm # noinspection All import pathmagic # noinspection PyUnresolvedReferences import mg_log # runs init in mg_log and configures logg...
pd.read_csv(args.pf_summary)
pandas.read_csv
try: import cPickle as pickle except: import pickle import os if os.name == 'posix' and 'DISPLAY' not in os.environ: import matplotlib matplotlib.use('Agg') import matplotlib import matplotlib.pyplot as plt import itertools from matplotlib import rc import random import seaborn import numpy as np import pan...
pd.DataFrame()
pandas.DataFrame
#Plot import matplotlib.pyplot as plt import seaborn as sns from bleu import file_bleu #Data Packages import math import pandas as pd import numpy as np #Progress bar from tqdm import tqdm #Counter from collections import Counter #Operation import operator #Natural Language Processing Packages import re import nltk...
pd.concat((reviewDF_neg_ALE, reviewDF_pos_ALE), 0)
pandas.concat
import re import numpy as np import pandas as pd from run_gw_ridge import load_genotype_from_bedfile def add_noise(y, sd_noise): return y + np.random.normal(scale=sd_noise, size=(y.shape[0])) def load_indiv(fn): res = [] with open(fn, 'r') as f: for i in f: line = i.strip().split(' ') ...
pd.DataFrame(df_omed)
pandas.DataFrame
# EPA_SIT.py (flowsa) # !/usr/bin/env python3 # coding=utf-8 """ Loads EPA State Inventory Tool (SIT) data for state specified from external data directory. Parses EPA SIT data to flowbyactivity format. """ import pandas as pd import os from flowsa.settings import externaldatapath, log from flowsa.flowbyfunctions impo...
pd.concat([df0, df])
pandas.concat
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd import openpyxl import os import re import argparse from datetime import datetime import json # In[2]: def load_json_as_df(json_data): out_df = pd.DataFrame(list(json_data.items()), columns=[key_column, english_col]) ...
pd.ExcelFile(file)
pandas.ExcelFile
#psaw from psaw import PushshiftAPI api = PushshiftAPI() import datetime as dt start_epoch=int(dt.datetime(2017, 1, 1).timestamp()) end_epoch=int(dt.datetime(2020, 1, 1).timestamp()) headlines_data = list(api.search_submissions(after=start_epoch, before=end_epoch, ...
pd.read_csv('combinednew.csv',error_bad_lines=False)
pandas.read_csv
"""Module defining the class responsible for implementing the testing framework for the PPE matching problem. Copyright 2021 <NAME>, <NAME>, <NAME>, <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 Licens...
pd.DataFrame(columns=['don_id', 'rec_id', 'ppe','date', 'qty', 'distance', 'holding_time'])
pandas.DataFrame
from collections import ( abc, deque, ) from decimal import Decimal from warnings import catch_warnings import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, PeriodIndex, Series, concat, date_range, ) import pandas._testing as tm fr...
concat([df1, df2])
pandas.concat
# -*- coding: utf-8 -*- """ These test the private routines in types/cast.py """ import pytest from datetime import datetime, timedelta, date import numpy as np import pandas as pd from pandas import (Timedelta, Timestamp, DatetimeIndex, DataFrame, NaT, Period, Series) from pandas.core.dtypes.c...
tm.assert_numpy_array_equal(arr, exp)
pandas.util.testing.assert_numpy_array_equal
# -*- coding: utf-8 -*- """ Created on Fri Dec 10 14:24:56 2021 @author: <NAME> Script created for determination of optimal power generation mix looking at interannual power production variability of DK1 and DK2. - Plots the generation mix as function of time - Plots the average optimal capacity with st...
pd.read_csv('data/data/annual_renewable_generation_dk1_dk2.csv', sep=',', index_col=0)
pandas.read_csv
"""This module provides tests for the array_stats module.""" import pytest import pandas as pd from fractalis.analytics.tasks.shared import array_stats # noinspection PyMissingOrEmptyDocstring,PyMethodMayBeStatic,PyMissingTypeHints class TestArrayStats: def test_get_limma_stats_raises_for_invalid_subsets(self...
pd.DataFrame()
pandas.DataFrame
# -*- coding: utf-8 -*- import requests,re,json,pickle,os from lxml import etree from pymongo import MongoClient from bs4 import BeautifulSoup from CrawlFunctions import getSoup,getEtreeHtml,getSoup from multiprocessing.dummy import Lock,Pool import numpy as np import pandas as pd from datetime import datetime cl...
pd.merge(df,df2,on='shop_id')
pandas.merge
# Multiscale sampling (MSS) with VASP and LAMMPS # <NAME> # Getman Research Group # Mar 10, 2019 import sys, os import numpy as np import pandas as pd import itertools from datetime import datetime from readInput import ReadInput class VaspToLmps(ReadInput): """ read POSCAR/CONTCAR and extract information ...
pd.concat([df_vac, df_sol])
pandas.concat
#!/usr/bin/env python import datetime import numpy as np import pandas as pd from dateutil import parser from linear_segment import SegmentedLinearRegressor def get_utc_days(format='%Y-%m-%d'): utc = datetime.datetime.utcnow() yesterday = utc.date() - datetime.timedelta(1) return utc.strftime(format), yes...
pd.read_csv(f's3://whisky-pricing/{day}.csv', parse_dates=False)
pandas.read_csv
import numpy as np import pandas as pd import bisect import tqdm import utils.utils as utils import _settings import ipdb import torch _LocalConformal = "LocalConformal" _LocalConformalMAD = "LocalConformalMAD" class NaiveKernel(): def __init__(self, type='Gaussian'): self._device = utils.gpuid_to_device(...
pd.DataFrame(res)
pandas.DataFrame
import argparse import json import pandas as pd import numpy as np from numpy.random.mtrand import RandomState from shapely.geometry import Polygon from shapely.ops import cascaded_union from sklearn.model_selection import KFold box_lon1, box_lat1 = 4.385218620300293, 51.85078428900754 box_lon2, box_lat2 = 4.4047880...
pd.read_csv(args.csv)
pandas.read_csv
import pandas as pd import requests import lxml.html from datetime import datetime from urllib.parse import urljoin pd.set_option('display.max_colwidth', 50) pd.set_option("display.expand_frame_repr", False) #Urls phishing = "https://www.scmagazine.com/topic/phishing" patch_management = "https://www.scma...
pd.concat([Siterow, gc])
pandas.concat
from ehr_functions.features import occurrence import pandas as pd def test_nth_occurrence(): df = pd.DataFrame({ 'PatientID': [1, 1, 2, 2], 'EncounterDate': ['01/01/2020', '01/05/2020', '01/01/2020', '01/02/2020'], 'Diagnosis1': ['A', 'F', 'D', 'C'], 'Diagnosis2': [None, 'B', 'B', ...
pd.to_datetime(df['EncounterDate'])
pandas.to_datetime
# -*- coding: utf-8 -*- import json import os import tarfile import tempfile from io import BytesIO import numpy as np import pandas as pd import skimage.io as io import warnings from skimage.util import img_as_uint from skimage.util import img_as_ubyte import skimage.measure as measure from pcnaDeep.tracker import t...
pd.read_csv(table_path)
pandas.read_csv
# -*- coding: utf-8 -*- """House Prices Isabel.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1crlL-Zf_EXl_hSIAIwKw17wb81Bvnqvg """ import pandas as pd import numpy as np from sklearn import neighbors, tree from sklearn.linear_model import Linea...
pd.read_csv("train.csv")
pandas.read_csv
""" v167 2022.01.18 automatic .csv to AWS-dynamoDB -- a python AWS-lambda-function this lambda function will need these permissions: AmazonDynamoDBFullAccess AWSLambdaDynamoDBExecutionRole AWSLambdaInvocation-DynamoDB AWSLambdaBasicExecutionRole AmazonS3FullAccess AmazonS3ObjectLambdaExecu...
pd.read_csv(this_file)
pandas.read_csv
#!/usr/bin/env python # Copyright 2017 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...
pd.Series(true_labels)
pandas.Series
# -*- coding: utf-8 -*- """ dwx_analytics.py - Pythonic access to raw DARWIN analytics data via FTP -- @author: <NAME> (www.darwinex.com) Last Updated: October 17, 2019 Copyright (c) 2017-2019, Darwinex. All rights reserved. Licensed under the BSD 3-Clause License, you may not use...
pd.to_numeric(year)
pandas.to_numeric
import os from django.conf import settings import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model, preprocessing import pandas as pd import numpy as np import matplotlib.pyplot as plt import datetime as dt companies_list = [ {'value':"AMBUJACEM", 'name':"<NAME>...
pd.read_csv(settings.MEDIA_ROOT + name)
pandas.read_csv
# -*- coding: utf-8 -*- """ Created on Thu Jun 14 12:04:33 2018 @author: gurunath.lv """ try : import base64 import datetime import io import dash from dash.dependencies import Input, Output import dash_core_components as dcc import dash_html_components as html import dash...
pd.DataFrame(rows)
pandas.DataFrame
import pandas as pd from itertools import chain from pgmpy.models import BayesianModel from pgmpy.models import DynamicBayesianNetwork as DBN from pgmpy.inference import DBNInference from pgmpy.estimators import ParameterEstimator from pgmpy.factors.discrete import TabularCPD from sklearn.preprocessing import KBinsDisc...
pd.DatetimeIndex(date)
pandas.DatetimeIndex
import torch import numpy as np import scipy as sp import pandas as pd import scanpy as sc from sklearn.model_selection import train_test_split #from sklearn.preprocessing import scale class GeneCountData(torch.utils.data.Dataset): """Dataset of GeneCounts for DCA""" def __init__(self, path='data/francescon...
pd.Series(['train'] * adata.n_obs)
pandas.Series
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...
pd.offsets.MonthEnd(5)
pandas.offsets.MonthEnd
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from jsonschema import validate as js_validate import warnings import uuid import time as ttime import pandas as pd from ..utils import sanitize_np, apply_to_dict_recursively class DatumNotFound(Exc...
pd.DataFrame(dkwargs_table)
pandas.DataFrame
from linearmodels.compat.statsmodels import Summary from itertools import product import struct from typing import Optional import numpy as np from numpy.testing import assert_allclose, assert_array_equal import pandas as pd from pandas.testing import assert_frame_equal, assert_series_equal import pytest import scipy...
pd.DataFrame(dfd)
pandas.DataFrame
# -*- coding: utf-8 -*- import numpy as np import pytest from numpy.random import RandomState from numpy import nan from datetime import datetime from itertools import permutations from pandas import (Series, Categorical, CategoricalIndex, Timestamp, DatetimeIndex, Index, IntervalIndex) import pan...
algos.value_counts(factor)
pandas.core.algorithms.value_counts
# 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...
pprint_thing(non_null_count[col])
pandas.io.formats.printing.pprint_thing
import logging as logger import re import regex import unicodedata from abc import abstractmethod from collections import defaultdict import pandas as pd import nltk # noinspection PyPackageRequirements from iso639 import languages from langdetect import detect, DetectorFactory from nltk.corpus import stopwords # noin...
pd.MultiIndex.from_product([columns, metadata_names], names=['column', 'metadata'])
pandas.MultiIndex.from_product
"""title https://adventofcode.com/2021/day/19 """ import numpy as np import pandas as pd import itertools import re SMALL_INPUT = open('small_input.txt').read() ORIENTATIONS = """ x, y, z x, z,-y x,-y,-z x,-z, y y,-x, z y, z, x y, x,-z y,-z,-x z, y,-x z,-x,-y z,-y, x z, x, y -x, y,-z -x, z, y -x,-y, z -...
pd.DataFrame(s2_trans)
pandas.DataFrame
#Import modules import os import pandas as pd import numpy as np from pandas import DatetimeIndex import dask import scipy from scipy.optimize import minimize, LinearConstraint import time from sklearn.preprocessing import MinMaxScaler, StandardScaler import pickle #Define Column Name indexName = 'date' ...
pd.read_csv(dataSetPath)
pandas.read_csv
import rdflib from datetime import datetime from nanopub import Nanopublication import logging import sys import pandas as pd import configparser import hashlib from .autonomic.update_change_service import UpdateChangeService from whyis.namespace import whyis, prov, sio class Interpreter(UpdateChangeService): k...
pd.isnull(item.Relation)
pandas.isnull
""" 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 data, test set do not have label import pandas as pd import numpy as np train = pd.read_csv("./data/train.csv") test = pd.read_csv("./data/test.csv") print(train.head()) #data cleaning ##empty data print(np.sum(np.array(train.isnull()==True), axis=0)) print(np.sum(np.array(test.isnull()==True), axis=0)) ##fil...
pd.DataFrame({'id':id, 'Class': pred_class})
pandas.DataFrame
import datetime import json from typing import Union import pandas as pd from wkz.gis.geo import get_location_name def _get_daytime_name(date: datetime.datetime) -> str: hour = date.hour if (hour > 4) and (hour <= 8): return "Early Morning" elif (hour > 8) and (hour <= 12): return "Morni...
pd.Series(coordinates, dtype=float)
pandas.Series
""" Utils for doing data analysis """ import pandas as pd import numpy as np def impute_empty_years( yearly_stats: pd.DataFrame, min_year: int = None, max_year: int = None ) -> pd.DataFrame: """ Imputes zero values for years without data Args: yearly_stats: A dataframe with a 'year' column a...
pd.DataFrame([magnitude_df, growth_df], index=["magnitude", "growth"])
pandas.DataFrame
import sys import pickle import pandas as pd import numpy as np from nltk.tokenize import word_tokenize from nltk.stem import WordNetLemmatizer from nltk.corpus import stopwords from sklearn.pipeline import Pipeline, FeatureUnion from sklearn.ensemble import RandomForestClassifier from sklearn.feature_extraction.tex...
pd.DataFrame(y_pred, columns=category_names)
pandas.DataFrame
import argparse import sys import time from multiprocessing import Pool import numpy as np import pandas as pd from terminaltables import * from dataset import VideoDataSet from ops.utils import temporal_nms sys.path.append('./anet_toolkit/Evaluation') import os import pdb import pickle from anet_toolkit.Evaluation...
pd.DataFrame(detection_list, columns=["video-id", "cls","t-start", "t-end", "score"])
pandas.DataFrame
""" Tests for scalar Timedelta arithmetic ops """ from datetime import datetime, timedelta import operator import numpy as np import pytest import pandas as pd from pandas import NaT, Timedelta, Timestamp, offsets import pandas._testing as tm from pandas.core import ops class TestTimedeltaAdditionSubtraction: "...
Timestamp("20121231 9:01")
pandas.Timestamp
# -*- coding: utf-8 -*- import glob import json import argparse import re import pandas as pd from logic_util import parse_lambda from syntactic_tree_parser import bpe_mask, un_bpe, un_bpe_mask # recoverubg BPE words def recover_bpe_words(row_info): if row_info["template"] == "error-parse-tree" or not isinsta...
pd.DataFrame({'bpe_sent': lines})
pandas.DataFrame
# Import import datetime import json import random import time import urllib from datetime import timedelta from typing import Optional import geopy import geopy.distance import pandas as pd from pyroutelib3 import Router from shapely.geometry import Polygon, Point from termcolor import colored from tqdm import tqdm ...
pd.DataFrame(trip)
pandas.DataFrame
import itertools import re import os import time import copy import json import Amplo import joblib import shutil import warnings import numpy as np import pandas as pd from tqdm import tqdm from typing import Union from pathlib import Path from datetime import datetime from shap import TreeExplainer from shap import K...
pd.concat([self.results, best_initial_model], ignore_index=True)
pandas.concat
import os import numpy as np import pandas as pd import pickle import glob import shutil import logging import re, sys, joblib, bz2 import multiprocessing as mp import tensorflow as tf from joblib import Parallel, delayed from Fuzzy_clustering.ver_tf2.CNN_tf_core_3d import CNN_3d from sklearn.model_selection import tra...
pd.DataFrame.from_dict(model_cnn['error_func'], orient='index')
pandas.DataFrame.from_dict
from flask import Flask, redirect,url_for, render_template, request import numpy as np import matplotlib.pyplot as plt import pandas as pd import datetime import pickle from pandas import to_datetime app = Flask(__name__) @app.route("/home") @app.route("/") def home(): return render_template("home.html") @app.ro...
to_datetime(date['ds'])
pandas.to_datetime
#%% [markdown] # # Author : <NAME> # *** # ## Capstone Project for Qualifying IBM Data Science Professional Certification # *** #%% [markdown] # # # Import Packages # #%% import numpy as np # library to handle data in a vectorized manner import pandas as pd # library for data analsysis
pd.set_option('display.max_columns', None)
pandas.set_option
# Tests aimed at pandas.core.indexers import numpy as np import pytest from pandas.core.indexers import is_scalar_indexer, length_of_indexer, validate_indices def test_length_of_indexer(): arr = np.zeros(4, dtype=bool) arr[0] = 1 result = length_of_indexer(arr) assert result == 1 def ...
validate_indices(indices, 2)
pandas.core.indexers.validate_indices
# ------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # ----------------------------------------------------------------------...
pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
pandas.DataFrame
import numpy as np from pandas import DataFrame, Series import pandas as pd from utilities import (LICENSE_KEY, generate_token, master_player_lookup, YAHOO_FILE, YAHOO_KEY, YAHOO_SECRET) import json from yahoo_oauth import OAuth2 from pathlib import Path # store credentials if don't already exis...
pd.merge(roster_df, stats)
pandas.merge
import requests from urllib3.util.retry import Retry from requests.adapters import HTTPAdapter import pandas as pd def query(addr): r = requests.post( 'http://citizenatlas.dc.gov/newwebservices/locationverifier.asmx/findLocation2', data={'f': 'json', 'str': addr}) r.raise_for_status() return r.json() def qu...
pd.read_csv('Address_Points.csv')
pandas.read_csv
""" The wntr.metrics.misc module contains metrics that do not fall into the topographic, hydraulic, water quality, water security, or economic categories. """ from wntr.network import Junction import pandas as pd import numpy as np import sys import logging if sys.version_info >= (3,0): from functools import reduc...
pd.Series()
pandas.Series
import datetime import json import numpy as np import requests import pandas as pd import streamlit as st from copy import deepcopy from fake_useragent import UserAgent import webbrowser from footer_utils import image, link, layout, footer service_input = st.selectbox('Select Service',["","CoWin Vaccine...
pd.DataFrame(data_json)
pandas.DataFrame
# # Copyright 2016 Quantopian, 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 in wr...
isnull(last_traded_dt)
pandas.isnull
""" Code to gather time series related to LiveOcean forcing. """ import os import sys pth = os.path.abspath('../alpha') if pth not in sys.path: sys.path.append(pth) import Lfun Ldir = Lfun.Lstart() import zrfun import zfun import numpy as np import pandas as pd import pickle import netCDF4 as nc from datetime imp...
pd.DataFrame(index=wind_df.index, columns=['eta_rms'])
pandas.DataFrame
""" Research results class """ import os from collections import OrderedDict import glob import json import dill import pandas as pd class Results: """ Class for dealing with results of research Parameters ---------- path : str path to root folder of research names : str, list or None ...
pd.np.array(dumped_file[variable])
pandas.np.array
#-*- coding:utf-8 -*- import pandas as pd import pdb import sys,os import random import yaml from collections import defaultdict class GenerateData(): def __init__(self, conf): self.conf = conf def process(self, train_rate = 0.9): ori_file = self.conf['ori_path'] #csv = pd.read_csv(ori...
pd.DataFrame({'text':test_x,'intent':test_y})
pandas.DataFrame
## Real Estate price predictor import pandas as pd import numpy as np housing = pd.read_csv("data.csv") housing.head() # Imputing missing values from sklearn.impute import SimpleImputer imputer = SimpleImputer(strategy="median") imputer.fit(housing) X = imputer.transform(housing) housing_tr =
pd.DataFrame(X, columns=housing.columns)
pandas.DataFrame
from sklearn.datasets import load_wine import pandas as pd wine = load_wine() columns_names = wine.feature_names y = wine.target X = wine.data # Splitting features and target datasets into: train and test from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, t...
pd.DataFrame(lr.coef_[2], columns_names)
pandas.DataFrame
from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier as KNN from sklearn.neighbors import NeighborhoodComponentsAnalysis as NCA from sklearn.pipeline import Pipeline import pandas as pd from sklearn.metrics import matthews_corrcoef, confusion_matrix from sklearn....
pd.DataFrame(x.te_report)
pandas.DataFrame
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd import matplotlib.ticker as mticker import sys starterpath = sys.argv[1] fname = starterpath + '/ccbench-all/uartlog' outputpath = starterpath + '/outputplot.pdf' f = open(fname, 'r') q = f.readlines() f.close() q = filter(l...
pd.DataFrame(data=cacheline_stride_bmark_data)
pandas.DataFrame
from bs4 import BeautifulSoup as bs import requests import pandas as pd import os import state_code from state_code import SAMPLE import collections import plotly.graph_objects as go import numpy as np import plotly.express as px files = os.listdir('./dataset/') files.sort() biggest_con = 0 def set_color_group(item)...
pd.to_numeric(entire.color_code, errors='coerce')
pandas.to_numeric
# coding=utf-8 # pylint: disable-msg=E1101,W0612 from datetime import datetime, timedelta from numpy import nan import numpy as np import pandas as pd from pandas.types.common import is_integer, is_scalar from pandas import Index, Series, DataFrame, isnull, date_range from pandas.core.index import MultiIndex from pa...
range(10)
pandas.compat.range
""" Unit test for smart explainer """ import unittest from unittest.mock import patch, Mock import os from os import path from pathlib import Path import types import pandas as pd import numpy as np import catboost as cb from sklearn.linear_model import LinearRegression from shapash.explainer.smart_explainer import Sma...
pd.testing.assert_frame_equal(xpl.y_pred, expected.y_pred)
pandas.testing.assert_frame_equal
from __future__ import print_function import collections import os import sys import numpy as np import pandas as pd try: from sklearn.impute import SimpleImputer as Imputer except ImportError: from sklearn.preprocessing import Imputer from sklearn.preprocessing import StandardScaler, MinMaxScaler, MaxAbsSca...
pd.concat([df1, df2], axis=1)
pandas.concat
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Mar 23 09:26:17 2020 @author: jone """ import pandas as pd import numpy as np import dipole import matplotlib.pyplot as plt import datetime as dt #investigate the relationship between equatorward boundary in NOAA data and the #occurrence rate of subs...
pd.cut(sophiexp.bylong, bins=bybins)
pandas.cut
import pandas as pd import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator def plot_severity(data): # absolute plt.figure() a = data.plot.barh(figsize=(7.7, 2.4), width=.95, color=("#BABDB6", "#8AE234", "#FCE94F", "#F57900", "#EF2929")) ...
pd.DataFrame(columns=["Shirtinator", "Spreadshirt"])
pandas.DataFrame
""" .. module:: repeats :synopsis: Repeats (transposon) related stuffs .. moduleauthor:: <NAME> <<EMAIL>> """ import csv import subprocess import os import gzip import glob import logging logging.basicConfig(level=logging.DEBUG) LOG = logging.getLogger(__name__) import uuid import pandas as PD import numpy a...
PD.concat(npchrs, ignore_index=True)
pandas.concat
# -*- coding: utf-8 -*- """ Created on Mon Nov 25 10:11:28 2019 @author: yazdsous """ import numpy as np import pyodbc import pandas as pd import datetime #conn = pyodbc.connect('Driver={SQL Server};' # 'Server=DSQL23CAP;' # 'Database=Regulatory_Untrusted;' # ...
pd.to_datetime(application_date)
pandas.to_datetime
# D:\Users\kozgen\PROJECT\log_channel.log file contains logs of discord server # D:\Users\kozgen\PROJECT\bans-filtered.json file contains filtered logs of log_channel.log # D:\Users\kozgen\PROJECT\welcome.log file contains member join logs of discord server # Read files and import them to dataframes and visualize them...
pd.DataFrame(columns=['classifier','array', 'training_ratio', 'array_size'] )
pandas.DataFrame
from flask import Flask, render_template, url_for, request, redirect import pickle import math import pandas as pd import numpy as np app = Flask(__name__) predicted_score = None @app.route('/') def index(): return render_template('index.html', score=predicted_score) @app.route('/predict', methods=['GET', 'POST']...
pd.DataFrame()
pandas.DataFrame
import pandas as pd import numpy as np import warnings from numpy import cumsum, log, polyfit, sqrt, std, subtract from datetime import datetime, timedelta import scipy.stats as st import statsmodels.api as sm import math import matplotlib import matplotlib.pyplot as plt from tqdm import tqdm from scipy.stats import no...
pd.to_datetime(secondary_df['Entry Time'])
pandas.to_datetime
# coding=utf-8 # pylint: disable-msg=E1101,W0612 from datetime import timedelta from numpy import nan import numpy as np import pandas as pd from pandas import (Series, isnull, date_range, MultiIndex, Index) from pandas.tseries.index import Timestamp from pandas.compat import range from pandas.u...
Series([999, np.nan, np.nan], index=[0, 1, 2])
pandas.Series
# Copyright 1999-2021 Alibaba Group Holding 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 applicable law or a...
pd.Series(raw)
pandas.Series
import scanpy as sc import pandas as pd import numpy as np import scipy import os from anndata import AnnData,read_csv,read_text,read_mtx from scipy.sparse import issparse def prefilter_cells(adata,min_counts=None,max_counts=None,min_genes=200,max_genes=None): if min_genes is None and min_counts is None and max_ge...
pd.Series(pred)
pandas.Series