prompt
stringlengths
19
1.03M
completion
stringlengths
4
2.12k
api
stringlengths
8
90
# -*- coding: utf-8 -*- """ Function to save laminate design set-up - save_objective_function_BELLA: saves the objective function parameters on Sheet [Objective function] - save_multipanel: saves the data of the multipanel structure: - panel geometry - panel thickness targets ...
pd.DataFrame()
pandas.DataFrame
# Futu Algo: Algorithmic High-Frequency Trading Framework # # 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 appli...
pd.read_csv(input_file, index_col=None)
pandas.read_csv
import os, glob import pandas as pd def selectX(df_dict=df_dict, ids=ids, x=100): selectX =
pd.DataFrame(columns=df_dict[ids[0]].columns)
pandas.DataFrame
# parser.py - Special parser for reading and writing *.tsv files with pandas. # Import pandas library for parsing dataframes. import pandas as pd # For parsing MFI tables specifically. def read_mfi(path, title="Metric", countries=['AFG', 'JPN']): """Special parser for reading an MFI table. :param path: Path ...
pd.DataFrame(data)
pandas.DataFrame
import os import requests import json from mapLight.dirs import * from mapLight.key import apiKey def downloadBills(jurisdiction,session,includePositions=True,allBills=False): params = {'jurisdiction':jurisdiction, 'session':session, 'include_organizations':int(includePositions)...
pd.concat(billDFs)
pandas.concat
from datetime import datetime from io import StringIO import numpy import pandas import pytest from hts.hierarchy import HierarchyTree from hts.utilities.load_data import load_hierarchical_sine_data, load_mobility_data @pytest.fixture def events(): s = """ts,start_latitude,start_longitude,city 2019-12-06 12...
pandas.date_range(start="1998-01-01", periods=8, freq="QS")
pandas.date_range
import cv2 import numpy as np import pandas as pd import shutil from tqdm import tqdm from pathlib import Path from utils import get_all_files_in_folder from sklearn.model_selection import train_test_split def create_splits_files(root_dir, val_split, test_split): train_dir = Path('denred0_data/train_test_split/t...
pd.DataFrame(labels, columns=["x"])
pandas.DataFrame
# Импортируем стандартный модуль для рендеринга страниц from django.shortcuts import render # Импортируем стандартные модули для пагинации страниц from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger # Подключаем модуль для фиксирования времени import time # Подключаем модуль для анализа pandas impo...
pd.concat(f)
pandas.concat
import pandas as pd import numpy as np import datetime import os from scipy import array from scipy.interpolate import interp1d def subst(x, str_re, loc): """ Parameters: ----------- x : str, the string to be updated str_re : str, the new string to replace loc : int or numpy.array, the index ...
pd.to_datetime(discharge['Time'], format="%H:%M:%S %d/%m/%Y")
pandas.to_datetime
import numpy as np import pandas as pd import os import sys import matplotlib.pyplot as plt import matplotlib import datetime import sklearn.datasets, sklearn.decomposition from sklearn.cluster import KMeans from sklearn_extra.cluster import KMedoids from sklearn.preprocessing import StandardScaler import sk...
pd.read_csv(demand_data_path)
pandas.read_csv
from io import StringIO import pandas as pd import numpy as np import pytest import bioframe import bioframe.core.checks as checks # import pyranges as pr # def bioframe_to_pyranges(df): # pydf = df.copy() # pydf.rename( # {"chrom": "Chromosome", "start": "Start", "end": "End"}, # axis="col...
pd.Int64Dtype()
pandas.Int64Dtype
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 2 17:59:33 2019 @author: anna This script computes the Director order parameter, the Deuterium Order parameters, lipids tilt and splay angles. """ import MDAnalysis import matplotlib.pyplot as plt import MDAnalysis.lib.NeighborSearch as NS impo...
pd.DataFrame({'Time':times[0] , 'box_x': [box[0]], 'box_y': [box[1]], 'box_z': [box[2]], 'alpha' : [box[3]], 'beta' : [box[4]], 'gamma' : [box[5]]})
pandas.DataFrame
import json import re from glob import glob from os import makedirs, path import pandas as pd from mne import Evoked, write_evokeds from mne.channels.layout import _find_topomap_coords from mne.time_frequency import AverageTFR, write_tfrs def files_from_dir(dir_path, extensions, natsort_files=True): """Retrieves...
pd.concat([metadata_df, epochs_df], axis=1)
pandas.concat
import numpy as np import pandas as pd import pandas_datareader.data as web import datetime as dt import requests import io import zipfile from kungfu.series import FinancialSeries from kungfu.frame import FinancialDataFrame def download_factor_data(freq='D'): ''' Downloads factor data from Kenneth French's...
pd.read_excel(url, sheet_name='Sheet1')
pandas.read_excel
""" Show completed state for a given set of experiments. """ import os import sys from datetime import datetime import numpy as np import pandas as pd here = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, here + '/../') import util from config import status_args def get_experiment_hash(args): """...
pd.DataFrame(results)
pandas.DataFrame
#!/usr/bin/env python3 ''' Splits dataset into train/test/val Author: <NAME> Date: 10/16/2019 ''' import os import argparse import pandas as pd import numpy as np import csv import shutil from sklearn.model_selection import GroupShuffleSplit from sklearn.model_selection import train_test_split try: im...
pd.concat([train_pos, train_neg], ignore_index=True)
pandas.concat
import os import tempfile import unittest import numpy as np import pandas as pd from sqlalchemy import create_engine from tests.settings import POSTGRESQL_ENGINE, SQLITE_ENGINE from tests.utils import get_repository_path, DBTest from ukbrest.common.pheno2sql import Pheno2SQL class Pheno2SQLTest(DBTest): @unitt...
pd.isnull(query_result.loc[3, 'c150_0_0'])
pandas.isnull
import time from multiprocess import Process from __future__ import print_function from __future__ import unicode_literals import numpy as np import pandas as pd import os import time from tqdm import tqdm import numpy as np from pyspark.sql import SparkSession from pyspark.sql.functions import * from multiproc...
pd.DataFrame(tmp_l)
pandas.DataFrame
# ----------------------------------------------------------------------------- # Account statement helpers import logging import datetime import camelot import pandas as pd import os import json from pdfquery.cache import FileCache import pdfquery import pdfminer from .utils import * logger = logging.getLogger("h...
pd.DataFrame(self.statement['entries'])
pandas.DataFrame
# Must run example4.py first # Read an Excel sheet and save running config of devices using pandas import pandas as pd from netmiko import ConnectHandler # Read Excel file of .xlsx format data =
pd.read_excel(io="Example4-Device-Details.xlsx", sheet_name=0)
pandas.read_excel
__author__ = 'rhythmicstar' import gffutils import pandas as pd def possible_nmd(nmd_file): splicing_data = pd.read_csv(nmd_file, header=None, sep='\s+') index = pd.Index(splicing_data[3]) event_ids =
pd.Series(index, name='event_id')
pandas.Series
# coding: utf-8 # ### **Loading Libraries** # In[ ]: import numpy as np from sklearn.ensemble import RandomForestClassifier import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) from sklearn import preprocessing import os print(os.listdir("../input")) from sklea...
pd.DataFrame(predict_test,columns=['predict_0', 'predict_1', 'predict_2'])
pandas.DataFrame
"""DataFrameToMatrix: Convert a DataFrame to a Numpy Matrix (ndarray) Class""" from __future__ import print_function # Third Party import pandas as pd import numpy as np # Local imports from bat.utils import dummy_encoder class DataFrameToMatrix(object): """DataFrameToMatrix: Convert a DataFrame to a Numpy Matr...
pd.Categorical(df[column])
pandas.Categorical
from collections import OrderedDict import numpy as np import pytest from pandas import ( DataFrame, Index, MultiIndex, Series, ) import pandas._testing as tm from pandas.core.construction import create_series_with_explicit_dtype class TestFromDict: # Note: these tests are specif...
Series([1.5, 3, 4], idx, dtype="O", name="x")
pandas.Series
from pprint import pprint import joblib import pandas as pd from lightgbm import LGBMClassifier from sklearn.model_selection import train_test_split from cian_similarity.utils import calc_metrics, get_connection, get_features, get_offers, get_pairs class Model: RANDOM_STATE_SKLEARN = 42 TARGET = "resolution...
pd.Series(self.clf.feature_importances_, index=self.X_train.columns)
pandas.Series
"""convert XML results to CSV data """ import os import xml.etree.ElementTree as ET from typing import NamedTuple, List import re import pandas as pd THIS_DIR = os.path.dirname(os.path.realpath(__file__)) DATA_DIR = THIS_DIR class Catch2BenchResult(NamedTuple): """Benchmark result Attributes: name:...
pd.concat([parsed_name, xml_results], axis=1)
pandas.concat
from datetime import timedelta import operator import numpy as np import pytest import pytz from pandas._libs.tslibs import IncompatibleFrequency from pandas.core.dtypes.common import is_datetime64_dtype, is_datetime64tz_dtype import pandas as pd from pandas import ( Categorical, Index, IntervalIndex, ...
tm.assert_series_equal(result[0], expected[0])
pandas._testing.assert_series_equal
from collections import OrderedDict import numpy as np import pandas as pd from sklearn.ensemble import BaggingClassifier, RandomForestRegressor from sklearn.tree import DecisionTreeClassifier from unittest.mock import patch from zipline.data import bundles from tests import assert_output, project_test, generate_rand...
pd.Series(targets[18:24], index[18:24])
pandas.Series
"""Copyright (c) Facebook, Inc. and its affiliates.""" # pylint: disable=unused-argument,too-many-statements,unused-variable import functools import glob import os from collections import defaultdict from pathlib import Path from typing import List, Optional, Union import altair as alt import altair_saver import numpy...
pd.concat([dev_df, test_df])
pandas.concat
""" Test cases for misc plot functions """ import numpy as np import pytest import pandas.util._test_decorators as td from pandas import ( DataFrame, Index, Series, Timestamp, ) import pandas._testing as tm from pandas.tests.plotting.common import ( TestPlotBase, _check_plot_works, ) import ...
tm.makeTimeSeries(name="ts")
pandas._testing.makeTimeSeries
import sys assert sys.version_info >= (3, 5) # make sure we have Python 3.5+ import pandas as pd # ------------------------Function to combine df of all gear type----------------------------- def main(p1, p2, p3, p4, p5, p6, version): df1 = pd.read_csv('../data/' + p1) df2 = pd.read_csv('../data/' + p2) ...
pd.read_csv('../data/' + p4)
pandas.read_csv
import urllib import urllib.parse import urllib.request import json import pandas as pd from datetime import datetime import os class RetrieveByAttribute(object): ''' This class extracts Historical user defined weather attributes from the WorldWeatherOnline API. The data is extracted by city. ---------------...
pd.date_range(self.start_date_datetime, self.end_date_datetime, freq='M', closed='left')
pandas.date_range
import pandapower as pp from pandapower.grid_equivalents.auxiliary import drop_internal_branch_elements import pandas as pd import numpy as np try: import pandaplan.core.pplog as logging except ImportError: import logging logger = logging.getLogger(__name__) def _calculate_ward_and_impedance_parameters(Ybus...
pd.concat([net_external.res_ext_grid.p_mw, net_external.res_gen.p_mw[slack_gen]])
pandas.concat
import os import pandas as pd import numpy as np import copy from pprint import pprint def work(pres): count = [0, 0] for i in pres: count[i] += 1 out = count.index(max(count)) return out def simple_vote(model_name, date, dataset, pseudo=False): if pseudo: DATA_DIR = '../predict_...
pd.read_csv(DATA_DIR + fname)
pandas.read_csv
import decimal import numpy as np from numpy import iinfo import pytest import pandas as pd from pandas import to_numeric from pandas.util import testing as tm class TestToNumeric(object): def test_empty(self): # see gh-16302 s = pd.Series([], dtype=object) res = to_numeric(s) ...
to_numeric(s, errors='coerce')
pandas.to_numeric
""" Provide a generic structure to support window functions, similar to how we have a Groupby object. """ from collections import defaultdict from datetime import timedelta from textwrap import dedent from typing import List, Optional, Set import warnings import numpy as np import pandas._libs.window as libwindow fro...
Appender(_agg_doc)
pandas.util._decorators.Appender
# -*- coding: utf-8 -*- from unittest import TestCase import pandas as pd from alphaware.base import (Factor, FactorContainer) from alphaware.enums import (FactorType, OutputDataFormat, FreqType, FactorNo...
assert_frame_equal(calculate, expected)
pandas.util.testing.assert_frame_equal
""" Class Features Name: lib_data_io_nc Author(s): <NAME> (<EMAIL>) Date: '20200401' Version: '3.0.0' """ ####################################################################################### # Libraries import logging import os import netCDF4 import time import re import warnings impor...
pd.DatetimeIndex([var_time_end])
pandas.DatetimeIndex
# -*- coding: utf-8 -*- """ Created on Wed Nov 22 12:05:22 2017 @author: rgryan """ import pandas as pd import matplotlib.pyplot as plt import numpy as np import glob import datetime sh = False # Plotting the scale height info? zc = False # Plotting the zero height concentration info? re = True ...
pd.DataFrame()
pandas.DataFrame
import os import pandas as pd import csv from sklearn.model_selection import train_test_split import numpy as np import random import tensorflow as tf import torch #directory of tasks dataset os.chdir("original_data") #destination path to create tsv files, dipends on data cutting path_0 = "mttransformer/...
pd.concat([labeled3, unlabeled3])
pandas.concat
# # Copyright (c) 2015 - 2022, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions a...
pandas.DataFrame()
pandas.DataFrame
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pandas as pd from usal_echo.d00_utils.log_utils import setup_logging from usal_echo.d00_utils.db_utils import ( dbReadWriteClean, dbReadWriteViews, dbReadWriteMeasurement, ) logger = setup_logging(__name__, __name__) def get_recommendation(row): ...
pd.Series(start + ground_truth_df.index)
pandas.Series
# -*- coding: utf-8 -*- import pytest import os import numpy as np import pandas as pd from pandas.testing import assert_frame_equal, assert_series_equal import numpy.testing as npt from numpy.linalg import norm, lstsq from numpy.random import randn from flaky import flaky from lifelines import CoxPHFitter, WeibullA...
pd.DataFrame.from_records([{"id": 1, "t": 1, "var1": 1.0}, {"id": 1, "t": 2, "var1": 2.0}])
pandas.DataFrame.from_records
from __future__ import print_function import collections import os import re import sys import numpy as np import pandas as pd from sklearn.preprocessing import Imputer from sklearn.preprocessing import StandardScaler, MinMaxScaler, MaxAbsScaler file_path = os.path.dirname(os.path.realpath(__file__)) lib_path = os....
pd.DataFrame(mat, columns=df.columns)
pandas.DataFrame
import pandas as pd #import geopandas as gpd import numpy as np import os #from sqlalchemy import create_engine from scipy import stats from sklearn.preprocessing import MinMaxScaler import math #from shapely import wkt from datetime import datetime, timedelta, date import time from sklearn.ensemble import RandomForest...
pd.DataFrame({'datetime':prediction_date_range_hour})
pandas.DataFrame
""" Junk code from developing the method which might come in handy later. """ ################################################################################ # Old version of run from analysis.py # ################################################################################ import os import numpy ...
pd.DataFrame(index=lrs, columns=['n_spots'])
pandas.DataFrame
import sqlite3 import json import pandas as pd class MamphiDataFetcher: mamphi_db = "" def __init__(self, mamphi_db=mamphi_db): self.mamphi_db = mamphi_db def fetch_center(self): conn = sqlite3.connect(self.mamphi_db) conn.row_factory = sqlite3.Row cursor = conn.cursor()...
pd.read_json(week2)
pandas.read_json
# -*- coding: utf-8 -*- # pylint: disable-msg=W0612,E1101 import itertools import warnings from warnings import catch_warnings from datetime import datetime from pandas.types.common import (is_integer_dtype, is_float_dtype, is_scalar) from pandas.compat...
tm.assert_frame_equal(df, expected)
pandas.util.testing.assert_frame_equal
import math import matplotlib.pyplot as plt import seaborn as sns from sklearn.cluster import DBSCAN, KMeans from configs import Level, LEVEL_MAP from db.QueryBuilder import get_level_refactorings from refactoring_statistics.query_utils import retrieve_columns import pandas as pd from pathlib import Path from os impor...
pd.DataFrame(data=data)
pandas.DataFrame
import numpy as np import pandas as pd import hydrostats.data as hd import hydrostats.visual as hv import HydroErr as he import matplotlib.pyplot as plt import os from netCDF4 import Dataset # ***************************************************************************************************** # *************ERA Inter...
pd.DataFrame(data=Q[:, counter], index=dates, columns=['flowrate (cms)'])
pandas.DataFrame
""" A warehouse for constant values required to initilize the PUDL Database. This constants module stores and organizes a bunch of constant values which are used throughout PUDL to populate static lists within the data packages or for data cleaning purposes. """ import pandas as pd import sqlalchemy as sa ##########...
pd.StringDtype()
pandas.StringDtype
import string from flask import Blueprint from root.modules.consolidations.dao.consolidation_dao_impl import getFileDetails, getFileList, getProjectDetails, saveConsolidation import os from flask import Flask, render_template, url_for, json import re import pandas as pd from flask import request, jsonify impo...
pd.DataFrame.merge(A, B, how='inner', on=common_col)
pandas.DataFrame.merge
import os import cv2 import numpy as np import pandas as pd import dataset_settings from util import insert_into_df, write_info, process_bimcv_image, resize_image def prepare_bimcv_plus_data(data_path, v1_csv_path, v2_csv_path, source_url): v1_csv = pd.read_excel(v1_csv_path, engine='openpyxl') v2_csv = pd....
pd.concat([v1_csv, v2_csv])
pandas.concat
import datetime import numpy as np import pandas as pd from six import iteritems from six.moves import zip from zipline.utils.numpy_utils import NaTns, NaTD def next_date_frame(dates, events_by_sid, event_date_field_name): """ Make a DataFrame representing the simulated next known date for an event. Pa...
pd.DatetimeIndex(df.loc[:, ts_field], tz='utc')
pandas.DatetimeIndex
import sys import os import numpy as np import pandas as pd from sklearn.preprocessing import OneHotEncoder from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split def preprocess(df): df.Age = df.Age.fillna(value=df.Age.mean()) # create new class U for unkown embar...
pd.concat([X,encoded],axis=1)
pandas.concat
# pip.main(['install', 'nibabel']) # pip.main(['install', 'pynrrd']) # pip.main(['install', 'h5py']) # pip.main(['install', 'scikit-image']) # pip.main(['install', 'future']) import os import sys import shutil import difflib import itertools import numpy as np import pandas as pd import matplotlib.pyplot as pp import ...
pd.DataFrame(timesers)
pandas.DataFrame
# -*- coding: utf-8 -*- # Copyright (c) 2016 by University of Kassel and Fraunhofer Institute for Wind Energy and Energy # System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import numpy as np import pandas as pd ...
pd.Series()
pandas.Series
# # 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...
pd.Timestamp("2015-01-07 8:45", tz='US/Eastern')
pandas.Timestamp
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
pd.concat((train, valid, test), axis=0)
pandas.concat
# x-by-y.py - dataviz module for quick X by Y charts. __version__ = '0.1' __all__ = ['layout', 'callback'] import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import plotly.graph_objs as go import pandas as pd from lib.components import x_axis_dropdown, y...
pd.read_csv(DATA_DIR + '/' + xdata)
pandas.read_csv
import pandas as pd from glob import glob import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap import numpy as np ### Function to Create Colormap def custom_div_cmap(numcolors=256, name='custom_div_cmap',colors=['black','dimgrey','lightgrey','white','palegreen','forestgreen', 'darkgre...
pd.DataFrame(data.values[9,:][11,])
pandas.DataFrame
import numpy as np import pandas as pd import math # step 1/2 数据生成器 Batch_size = 20 Lens = 528 # 取640为训练和验证截点。 TEST_MANIFEST_DIR = "../data/test_data.csv" def ts_gen(path = TEST_MANIFEST_DIR, batch_size = Batch_size): data_list =
pd.read_csv(path)
pandas.read_csv
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/02-spec-gen.ipynb (unless otherwise specified). __all__ = ['init_spec', 'load_endpoints_df', 'get_endpoint_single_attr', 'init_stream_dict', 'add_params_to_stream_dict', 'add_streams_to_spec', 'construct_spec', 'save_spec', 'load_API_yaml'] # Cell import nump...
pd.read_csv(endpoints_fp)
pandas.read_csv
# 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-04-12 00:00:00")
pandas.Timestamp
#!/usr/bin/env python # coding: utf-8 # In[2]: import pandas as pd # In[3]: sub_1_p = pd.read_csv('./output/submission_1020.csv') sub_2_p = pd.read_csv('./output/submission_1021.csv') sub_3_p = pd.read_csv('./output/submission_12345.csv') sub_4_p = pd.read_csv('./output/submission_1234.csv') sub_5_p = pd.read_cs...
pd.read_csv('type.csv')
pandas.read_csv
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 12 12:30:30 2021 @author: sahand """ import pandas as pd import numpy as np from tqdm import tqdm dir_root = '/home/sahand/GoogleDrive/Data/Corpus/Dimensions AI unlimited citations/clean/' # ryzen # dir_root = '/mnt/6016589416586D52/Users/z5204044/G...
pd.read_csv(dir_root+'publication idx',names=['id'])
pandas.read_csv
from django.db import models from django.utils import timezone from django.db.models import Q import asyncio from ib_insync import IB, Stock, MarketOrder, util from core.common import empty_append from core.indicators import rel_dif import vectorbtpro as vbt import sys import math import pandas as pd import numpy a...
pd.DataFrame(data=volume,index=df["date"],columns=symbols)
pandas.DataFrame
import dash import dash_core_components as dcc import dash_bootstrap_components as dbc import dash_html_components as html import pandas as pd import plotly.express as px import plotly.graph_objs as go from datetime import date import dash_loading_spinners as dls from dash.dependencies import Input, Output, ClientsideF...
pd.to_datetime(data2['Time'])
pandas.to_datetime
import pandas as pd from sqlalchemy import create_engine from nyc_ccci_etl.commons.configuration import get_database_connection_parameters class DataPreparator: def __init__(self): host, database, user, password = get_database_connection_parameters() engine_string = "postgresql+psycopg2://{user}:{p...
pd.read_sql_table('inspections', self.engine, schema="transformed")
pandas.read_sql_table
"""Text Prediction Model based on Pretrained Language Model. Version 1""" from typing import Optional import collections import logging import pandas as pd import os import random import numpy as np from ..abstract.abstract_model import AbstractModel from ...features.feature_metadata import R_OBJECT, R_INT, R_FLOAT, R...
pd.concat([y_train, y_val])
pandas.concat
#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 #d...
pd.get_dummies(X,drop_first=False)
pandas.get_dummies
import csv import re import string import math import warnings import pandas as pd import numpy as np import ipywidgets as wg import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib.ticker as mtick from itertools import product from scipy.optimize import curve_fit from IPython.display i...
pd.ExcelWriter(f"{path}Anisotropy Data.xlsx", engine='openpyxl', mode='a')
pandas.ExcelWriter
# type: ignore ### Standard imports ### import os import glob import logging import argparse import itertools import operator import timeit from multiprocessing import Pool ### Non-standard imports ### import yaml import numpy as np import pandas ### Local imports ### from riptide import TimeSeries, ffa_search, find...
pandas.DataFrame(data, columns=columns)
pandas.DataFrame
import unittest import qteasy as qt import pandas as pd from pandas import Timestamp import numpy as np import math from numpy import int64 import itertools import datetime from qteasy.utilfuncs import list_to_str_format, regulate_date_format, time_str_format, str_to_list from qteasy.utilfuncs import maybe_trade_day, ...
pd.Timestamp('1970-01-01 00:00:00.000000008')
pandas.Timestamp
import math import string from typing import Optional, Sequence, Tuple import hypothesis.strategies as st import numpy as np import pandas as pd import pandas.testing as tm import pyarrow as pa import pytest from hypothesis import example, given, settings import fletcher as fr from fletcher.testing import examples t...
pd.Series(fr_array)
pandas.Series
import os import glob import argparse import pandas as pd import xml.etree.ElementTree as ET def process(path, prefix): xml_list = [] for xml_file in glob.glob(path + '/*.xml'): tree = ET.parse(xml_file) root = tree.getroot() for member in root.findall('object'): value = (pr...
pd.DataFrame(xml_list, columns=column_name)
pandas.DataFrame
import logging import time from functools import reduce from typing import List, Iterator, Callable, Any import pandas log = logging.getLogger(__name__) def flatten(l: Iterator[Any]) -> Iterator[Any]: """ Thanks to this StackOverflow answer: https://stackoverflow.com/a/10824420 """ for i in l: ...
pandas.concat([update[indices], using], ignore_index=True)
pandas.concat
from myutils.utils import getConnection, cronlog import pandas as pd import numpy as np import datetime import requests class TestRequest: def __init__(self, url, method='GET', META=None, postdata=None): self.method = method u = url.split('?') self.path_info = u[0] self.META = META...
pd.DataFrame()
pandas.DataFrame
#!/usr/bin/env python # coding: utf-8 import datetime import matplotlib.pyplot as plt import numpy as np import pandas as pd import pytz import random # Date and Time # ============= print(datetime.datetime(2000, 1, 1)) print(datetime.datetime.strptime("2000/1/1", "%Y/%m/%d")) print(datetime.datetime(2000, 1, 1, 0, ...
pd.tseries.offsets.BusinessHour(start='07:00', end='22:00')
pandas.tseries.offsets.BusinessHour
#!/usr/bin/env python3 import re import tqdm import sqlite3 import matplotlib.pyplot as plt import itertools import pandas as pd from ShortestPathDepParse import Dependencies from EntitiesExtraction import EntityExtractor, Entity from nltk import CoreNLPParser import numpy as np np.random.seed(17) punctuation = r'[\....
pd.DataFrame()
pandas.DataFrame
# pylint: disable-msg=W0612,E1101,W0141 import nose from numpy.random import randn import numpy as np from pandas.core.index import Index, MultiIndex from pandas import Panel, DataFrame, Series, notnull, isnull from pandas.util.testing import (assert_almost_equal, assert_series_equal...
assert_almost_equal(df.values, values)
pandas.util.testing.assert_almost_equal
import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt #from sklearn import metrics import scipy #Regressao linear com Adaline e Pseudo-Inversa entrada = np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0]) target = np.array([2.26, 3.8, 4.43, 5.91, 6.18, 7.26, 8.15, ...
pd.Series(entrada, name="X")
pandas.Series
"""Unit tests for orbitpy.coveragecalculator.gridcoverage class. ``TestGridCoverage`` class: * ``test_execute_0``: Test format of output access files. * ``test_execute_1``: Roll Circular sensor tests * ``test_execute_2``: Yaw Circular sensor tests * ``test_execute_3``: Pitch Circular sensor tests * ``test_execute_4``...
pd.read_csv(out_file_access, skiprows = [0,1,2,3])
pandas.read_csv
# Copyright 2018 Corti # # 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 #...
pd.concat(segments, ignore_index=True)
pandas.concat
#!/usr/bin/env python """Tests for `featureeng` package.""" import pytest import pandas as pd from featureeng import featureeng from numpy.testing import assert_almost_equal, assert_equal # @pytest.mark.xfail(reason ="Being Lazy, test_aggs_by_columns() has not yet been implemented") def test_aggs_by_columns(): ...
pd.DataFrame(data=[[4,7], [4,7]], columns=[expected_column_name, 'column_two'])
pandas.DataFrame
import calendar from datetime import datetime import ccxt import numpy as np import pandas as pd from stockstats import StockDataFrame as Sdf class CCXTEngineer: def __init__(self): self.binance = ccxt.binance() def data_fetch(self, start, end, pair_list=["BTC/USDT"], period="1m"): def min_o...
pd.MultiIndex.from_product([pair_list, ["close"]])
pandas.MultiIndex.from_product
from typing import List, Text, Dict from dataclasses import dataclass import ssl import urllib.request from io import BytesIO from zipfile import ZipFile from urllib.parse import urljoin from logging import exception import os from re import findall from datetime import datetime, timedelta import lxml.html...
pd.read_html(url, header=0)
pandas.read_html
import flask from flask import request import pandas as pd import spacy import nltk import numpy as np from sklearn.cluster import KMeans import os from nltk.corpus import stopwords from sklearn.feature_extraction.text import TfidfVectorizer import pickle import gensim from gensim import corpora from sklearn import svm...
pd.DataFrame.from_dict(documents, orient='index')
pandas.DataFrame.from_dict
import sys import pandas as pd from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): ''' Load and merge two CSV files - one containing messages and the other containing categories Args: messages_filepath (str): Path to the CSV file containing messages ...
pd.read_csv(categories_filepath)
pandas.read_csv
import pandas as pd import numpy as np import matplotlib.pyplot as plt import xgboost import sklearn from xgboost import XGBClassifier from sklearn.model_selection import train_test_split from sklearn.grid_search import GridSearchCV, RandomizedSearchCV from sklearn.datasets import make_classification from sklearn.cross...
pd.merge(meta,shared,on=['sample'])
pandas.merge
import numpy as np import pytest from pandas.core.dtypes.common import is_integer_dtype import pandas as pd from pandas import Categorical, CategoricalIndex, DataFrame, Series, get_dummies import pandas._testing as tm from pandas.core.arrays.sparse import SparseArray, SparseDtype class TestGetDummies: @pytest.f...
get_dummies(data)
pandas.get_dummies
import numpy as np import matplotlib.pyplot as plt import pandas as pd #For User 1 User_1 = pd.read_csv('acceleration_labelled_data.csv') User_1 = pd.DataFrame(User_1.iloc[:, 1:6].values) User_1.columns = ["Activity", "Timeframe", "X axis", "Y axis", "Z axis"] User_1["Timeframe"] = User_1["Timeframe"] - 0.017856 """...
pd.DataFrame(User_6_annotations)
pandas.DataFrame
""" Full Pipeline: A-B-C Development Pipeline: B-C A) Making negative examples B) Offering categories for redirect(Filter) C) Predict probability for (query, category) (redirects) """ import pandas as pd import re from json import load from utils.merge_tables import merge_product_external_id_to_categories from utils.co...
pd.DataFrame({'query': query, 'external_id': product_external_id})
pandas.DataFrame
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. # Specifically for Period dtype import operator import numpy as np import pytest from pandas._libs.tslibs.period import IncompatibleFrequency from pandas.errors import PerformanceWarning import pandas as pd from pandas impo...
tm.assert_frame_equal(p - df, exp)
pandas.util.testing.assert_frame_equal
# -*- coding: utf-8 -*- import os import ast import pandas as pd import numpy as np import torch from torch.utils.data import Dataset class AffectiveMonitorDataset(Dataset): """ Affective Monitor Dataset in Pytorch version class raw dataframe read from csv file is in .face_df fil...
pd.read_csv(filepath,header=6)
pandas.read_csv
############################################################# # ActivitySim verification against TM1 # <NAME>, <EMAIL>, 02/22/19 # C:\projects\activitysim\verification>python compare_results.py ############################################################# import pandas as pd import openmatrix as omx ################...
pd.Categorical(tm1_trips["orig_purpose"])
pandas.Categorical
from datetime import ( datetime, timedelta, timezone, ) import numpy as np import pytest import pytz from pandas import ( Categorical, DataFrame, DatetimeIndex, NaT, Period, Series, Timedelta, Timestamp, date_range, isna, ) import pandas._testing as tm class TestS...
Timestamp("20130103 9:01:01")
pandas.Timestamp
import joblib import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import metrics from sklearn.cluster import KMeans from sklearn.ensemble import RandomForestRegressor from sklearn.preprocessing import StandardScaler from sklearn.neighbors import KNeighborsRegressor from sklearn.model_sel...
pd.DataFrame(data['风险值'])
pandas.DataFrame
# -*- coding: utf-8 -*- """ Created on Thu Jan 16 19:59:22 2020 @author: Dell """ import pandas as pd import numpy as np import matplotlib.pyplot as plt sicData=
pd.read_excel(r'C:\Users\Dell\Desktop\data\SIC(2011-2018).xlsx',parse_dates=[0])
pandas.read_excel
# -*- coding: utf-8 -*- """ Created on Sat Feb 1 18:29:16 2020 @author: POI-PC """ from PyQt5.QtWidgets import* from PyQt5.QtCore import pyqtSlot from PyQt5 import QtGui from PyQt5 import QtCore, QtWidgets import sys from selenium import webdriver import time import pandas as pd import numpy as np from xlrd import o...
pd.read_html('Sirketler/Sirketler.xls')
pandas.read_html