prompt stringlengths 19 1.03M | completion stringlengths 4 2.12k | api stringlengths 8 90 |
|---|---|---|
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 18 14:52:35 2019
@author: KatieSi
"""
# Import packages
import numpy as np
import pandas as pd
import pdsql
from datetime import datetime, timedelta
# Set Variables
ReportName= 'Summary Tables'
RunDate = datetime.now()
# Set Risk Paramters
SummaryTableRunDate = datet... | pd.isnull(WAPSummary['WS_PercentAnnualVolume']) | pandas.isnull |
#!/usr/bin/env python
import pandas as pd
import numpy as np
import multiprocessing
import argparse
import operator
import os
import random
import sys
import time
import random
import subprocess
import pysam
import collections
import warnings
import math
import re
from Bio import SeqIO
base_path = os.path.split(__fil... | pd.concat([contig_data, split_data], axis=1) | pandas.concat |
"""
Sklearn dependent models
Decision Tree, Elastic Net, Random Forest, MLPRegressor, KNN, Adaboost
"""
import datetime
import random
import numpy as np
import pandas as pd
from autots.models.base import ModelObject, PredictionObject
from autots.tools.probabilistic import Point_to_Probability
from autots.tools.season... | pd.DataFrame() | pandas.DataFrame |
"""Aggregate plant parts to make an EIA master plant-part table.
Practically speaking, a plant is a collection of generator(s). There are many
attributes of generators (i.e. prime mover, primary fuel source, technology
type). We can use these generator attributes to group generator records into
larger aggregate record... | pd.concat([part_own, part_tot_out]) | pandas.concat |
import os
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
from .. import read_sql
@pytest.fixture(scope="module") # type: ignore
def postgres_url() -> str:
conn = os.environ["POSTGRES_URL"]
return conn
@pytest.mark.xfail
def test_on_non_select(postgres_url: str) -> None:
... | pd.Series([3.1, 7.8], dtype="float64") | pandas.Series |
from kamodo import Kamodo, kamodofy
import pandas as pd
import numpy as np
import scipy
import time
import datetime
from datetime import timezone
import urllib, json
import plotly.express as px
import plotly.graph_objects as go
import pandas as pd
from pandas import DatetimeIndex
from collections.abc import Iterable
... | pd.read_csv('https://ccmc.gsfc.nasa.gov/Kamodo/demo/sphereXYZ.csv') | pandas.read_csv |
from textblob import TextBlob, Word
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.stem import PorterStemmer
import nltk
# nltk.download()
import urllib.request
from bs4 import BeautifulSoup
from nltk.corpus import stopwords
import re
import pandas as pd
# reading from the web
response = urllib.request.urlo... | pd.DataFrame(data={"text": correntSentence, "sentiment": sentiment}) | pandas.DataFrame |
# coding: utf-8
from .abs_loader import AbsLoader
import os
import pandas as pd
import wfile
import wdfproc
##################################################
# データロードクラス
##################################################
class Loader(AbsLoader):
"""データロードクラス
Attributes:
属性の名前 (属性の型): 属性の説明
... | pd.read_csv(ground_weather_csv, index_col=0, parse_dates=[1]) | pandas.read_csv |
'''
__author__=<NAME>
MIT License
Copyright (c) 2020 crewml
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, mer... | pd.to_timedelta(flights_df['totDutyTm']) | pandas.to_timedelta |
# -*- coding:utf-8 -*-
import pandas as pd
import numpy as np
import warnings
def test(x):
print('类型:\n{}\n'.format(type(x)))
if isinstance(x, pd.Series):
print('竖标:\n{}\n'.format(x.index))
else:
print('竖标:\n{}\n'.format(x.index))
print('横标:\n{}\n'.format(x.columns))
... | pd.ExcelWriter(addr_final) | pandas.ExcelWriter |
import gc
import sys
sys.path.append(os.getenv("Analysis"))
import math
import pandas as pd
from Analysis import Plotting
import plotly.express as px
import plotly.figure_factory as ff
import hdbscan
from scipy.spatial import distance
#HDBScan with Andrews Curve Plot
def HDBScan(df, min_cluster_... | pd.DataFrame(clusterer.cluster_persistence_) | pandas.DataFrame |
#%%
from jmespath import search
import pandas as pd
import geopandas as gpd
import requests
import json
from shapely import Point
# %%
print("Reading the HUC-12 names and shapes")
huc_shapes = gpd.read_file(
"R:\\WilliamPenn_Delaware River\\PollutionAssessment\\Stage2\\DRB_GWLFE\\HUC12s in 020401, 020402, 020403 v... | pd.notna(huc["wkaoi_id"]) | pandas.notna |
import pandas as pd
from simple_network_sim import network_of_populations, sampleUseOfModel, hdf5_to_csv
from tests.utils import create_baseline
def test_cli_run(base_data_dir):
try:
sampleUseOfModel.main(["-c", str(base_data_dir / "config.yaml")])
h5_file = base_data_dir / "output" / "simple_ne... | pd.DataFrame({"Value": [2]}) | pandas.DataFrame |
"""Relative Negative Sentiment Bias (RNSB) metric implementation."""
import logging
from typing import Any, Callable, Dict, List, Tuple, Union
import numpy as np
import pandas as pd
from scipy.stats import entropy
from sklearn.base import BaseEstimator
from sklearn.linear_model import LogisticRegression
from ... | pd.DataFrame(calculated_negative_sentiment_probabilities) | pandas.DataFrame |
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from numpy import mean, var
from scipy import stats
from matplotlib import rc
from lifelines import KaplanMeierFitter
# python program to plot the OS difference between M2 HOXA9 low and M2 high HOXA9
def find_gene_... | pd.DataFrame(data=M2_high_tab) | pandas.DataFrame |
# -*- coding: UTF-8 -*-
#
# Copyright 2016 Metamarkets Group 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 app... | pandas.DataFrame(EXPECTED_RESULTS_PANDAS) | pandas.DataFrame |
# coding: utf-8
# # Read Data Sample
# In[1]:
import pandas as pd
import numpy as np
import os
from collections import namedtuple
pd.set_option("display.max_rows",100)
#%matplotlib inline
# In[2]:
class dataset:
kdd_train_2labels = pd.read_pickle("dataset/kdd_train_2labels.pkl")
kdd_test_2labels = pd.rea... | pd.read_pickle("dataset/tf_dense_only_nsl_kdd_scores_all.pkl") | pandas.read_pickle |
import pandas as pd
from typing import List, Tuple
from pydantic import BaseModel
from icolos.core.containers.compound import Conformer
from icolos.utils.enums.step_enums import StepClusteringEnum
from icolos.core.workflow_steps.step import _LE
from icolos.core.workflow_steps.calculation.base import StepCalculationB... | pd.DataFrame(columns=features) | pandas.DataFrame |
"""
Project: gresearch
File: data.py
Created by: louise
On: 25/01/18
At: 4:56 PM
"""
import os
import torch
from torch.utils.data.dataset import Dataset
from sklearn.preprocessing import MinMaxScaler
import pandas as pd
class SP500(Dataset):
def __init__(self, folder_dataset, T=10, symb... | pd.read_csv(fn, index_col='Date', usecols=self.use_columns, na_values='nan', parse_dates=True) | pandas.read_csv |
"""
MIT License
Copyright (c) 2018 <NAME> Institute of Molecular Physiology
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, co... | pd.Series([2, 2.05], dtype=float) | pandas.Series |
"""
Functions to filter WI images based on different conditions.
"""
import numpy as np
import pandas as pd
from . import _domestic, _labels, _utils
from .extraction import get_lowest_taxon
def remove_domestic(images: pd.DataFrame, reset_index: bool = True) -> pd.DataFrame:
"""
Removes images where the ident... | pd.to_datetime(df[_labels.images.date]) | pandas.to_datetime |
import unittest
import os
import shutil
import numpy as np
import pandas as pd
from aistac import ConnectorContract
from ds_discovery import Wrangle, SyntheticBuilder
from ds_discovery.intent.wrangle_intent import WrangleIntentModel
from aistac.properties.property_manager import PropertyManager
class WrangleIntentCo... | pd.Series(result) | pandas.Series |
#!/usr/bin/env python3
"""
https://mygene.info/
https://mygene.info/v3/api
https://pypi.org/project/mygene/
"""
###
#
import sys,os
import pandas as pd
import mygene as mg
#
FIELDS = 'HGNC,symbol,name,taxid,entrezgene,ensemblgene'
NCHUNK=100;
#
###########################################################################... | pd.concat([df, df_this]) | pandas.concat |
#!/usr/bin/env python
#
# analysis.py
#
# Copyright (c) 2018 <NAME>. All rights reserved.
import argparse
import time
import sys
import random
from sort import *
import pandas as pd
import matplotlib.pyplot as plt
# Utility
def print_err(*args, **kwargs):
print(*args, **kwargs, file=sys.stderr)
def parse_int(... | pd.pivot_table(nswap_n_g, values='nswap/n', index='length', columns='algorithm') | pandas.pivot_table |
######################################################################################################
# importar bibliotecas
######################################################################################################
import streamlit as st
from streamlit import caching
impo... | pd.read_csv(csv_string, sep=',') | pandas.read_csv |
"""Dataset preprocessing scripts"""
def process_mim_gold_ner():
from pathlib import Path
import pandas as pd
from tqdm.auto import tqdm
import json
import re
from collections import defaultdict
conversion_dict = {
"O": "O",
"B-Person": "B-PER",
"I-Person": "I-PER",... | pd.read_csv(input_path, sep="\t") | pandas.read_csv |
import tempfile
import unittest
import numpy as np
import pandas as pd
from airflow import DAG
from datetime import datetime
from mock import MagicMock, patch
import dd.api.workflow.dataset
from dd import DB
from dd.api.workflow.actions import Action
from dd.api.workflow.sql import SQLOperator
dd.api.workflow.datase... | pd.DataFrame([[np.nan, 2], [1, 2]], columns=["n1", "n2"]) | pandas.DataFrame |
# -*- coding: utf-8 -*-
import datetime
import os
import time
import pandas as pd
from quantity.digger.errors import ArgumentError
def csv2frame(fname):
return | pd.read_csv(fname, index_col=0, parse_dates=True) | pandas.read_csv |
import numpy as np
import pandas as pd
import plotly.graph_objects as go
from credit_scoring.metrics.credit_score import CreditScore
class CalculatedLift(CreditScore):
def __init__(self, pred, target, bucket=10):
super().__init__(pred, target)
self.bucket = bucket
self.pred = 1 - self.pred
def ... | pd.DataFrame({'Target': self.target, 'Pred': self.pred}) | pandas.DataFrame |
#!/usr/bin/env python
# By <NAME>
# Sept 10, 2020
# Store queried ZTF objects in database
import sqlite3
import pandas as pd
from sqlite3 import Error
import os
import inspect
import pdb
import sys
# from .constants import DB_DIR
DB_DIR = '../local/db/'
def create_connection(db_file):
""" Create a database con... | pd.DataFrame(rows, columns=["ZTF_object_id","SIMBAD_otype","ra","dec","xray_name", "SIMBAD_include"]) | pandas.DataFrame |
#!/usr/bin/env python
# coding: utf-8
# ## Plot mutation prediction results
# In this notebook, we'll compare the results of our mutation prediction experiments for expression and methylation data only, predicting a binary mutated/not mutated label for each gene (see `README.md` for more details). The files analyzed ... | pd.DataFrame({'x': x, 'y': y, 'gene': gene}) | pandas.DataFrame |
from elsapy.elsclient import ElsClient
from elsapy.elsdoc import FullDoc, AbsDoc
import pandas as pd
from . import requests
from . import error
@error.error
class elsapy_connector:
def __init__(self):
req = requests.request_handler()
self.client = ElsClient(req.apikey)
pass
def pii_se... | pd.DataFrame(res) | pandas.DataFrame |
import os
import h5py
import numpy as np
from os import listdir
from os.path import isfile, join
import pandas as pd
import bisect
from ECG_preprocessing import *
from ECG_feature_extraction import *
from PPG_preprocessing import *
from PPG_feature_extraction import *
import csv
import xlrd
from sklearn.impute import S... | pd.DataFrame(data=dic) | pandas.DataFrame |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | pd.datetime(2016, 1, 1) | pandas.datetime |
# Arithmetic tests for DataFrame/Series/Index/Array classes that should
# behave identically.
# Specifically for datetime64 and datetime64tz dtypes
from datetime import (
datetime,
time,
timedelta,
)
from itertools import (
product,
starmap,
)
import operator
import warnings
import numpy as np
impo... | Timestamp("20130301") | pandas.Timestamp |
#!/usr/bin/env python3
import os
import sys
from bs4 import BeautifulSoup
from fake_headers import Headers
from pprint import pprint
from pandas import DataFrame
from requests_futures.sessions import FuturesSession
from requests.exceptions import ConnectionError
from datetime import datetime
from pathlib import Path
... | DataFrame(data, columns=['Titles', 'Links']) | pandas.DataFrame |
import numpy as np
import pandas as pd
import pytest
import skorecard.reporting.report
from skorecard.metrics import metrics
from skorecard.bucketers import DecisionTreeBucketer
@pytest.fixture()
def X_y():
"""Set of X,y for testing the transformers."""
X = np.array(
[[0, 1], [1, 0], [0, 0], [3, 2], ... | pd.Series(expected_iv) | pandas.Series |
'''
CIS 419/519 project: Using decision tree ensembles to infer the pathological
cause of age-related neurodegenerative changes based on clinical assessment
nadfahors: <NAME>, <NAME>, & <NAME>
This file contains code for preparing NACC data for analysis, including:
* synthesis of pathology data to create pat... | pd.DataFrame(Xnumimp) | pandas.DataFrame |
#%% Change working directory from the workspace root to the ipynb file location. Turn this addition off with the DataScience.changeDirOnImportExport setting
import os
try:
os.chdir(os.path.join(os.getcwd(), 'easy21'))
print(os.getcwd())
except:
pass
#%% [markdown]
# # Easy 21 Control Assignment
# ### Exercise instru... | pd.DataFrame({'x': x, 'y': y, 'z': z}) | pandas.DataFrame |
import pandas as pd
import numpy as np
from dateutil import relativedelta
import datetime
from forex_python.converter import CurrencyRates
from currency_converter import ECB_URL, CurrencyConverter
import os
import shutil
import urllib.request
class Declaracion:
@staticmethod
def fifo(dfg, trade=True):
... | pd.DataFrame(columns=dfg.columns) | pandas.DataFrame |
import copy
import re
from textwrap import dedent
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
MultiIndex,
)
import pandas._testing as tm
jinja2 = pytest.importorskip("jinja2")
from pandas.io.formats.style import ( # isort:skip
Styler,
)
from pandas.io.formats.sty... | _get_level_lengths(index, sparsify=False, max_index=100) | pandas.io.formats.style_render._get_level_lengths |
import unittest
import ast
import pandas as pd
from blotter import blotter
from pandas.util.testing import assert_dict_equal
class TestBlotter(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def assertEventEqual(self, ev1, ev2):
self.assertEqual(ev1.type, ev2.... | pd.Timestamp('2016-12-01T10:00:00') | pandas.Timestamp |
#!/usr/bin/env python3
# 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.
"""
Taskmaster-2 implementation for ParlAI.
No official train/valid/test splits are available as of 2020-05-18, so we m... | pd.concat(chunks, axis=0) | pandas.concat |
import pandas as pd
import numpy as np
import os
import tensorflow as tf
import copy
from tensorflow.contrib import learn
import _pickle as pickle
def read_from_csv():
csv_fname = "/Users/shubhi/Public/CMPS296/friends.csv" #replace with local file loc
df = | pd.DataFrame.from_csv(csv_fname) | pandas.DataFrame.from_csv |
import pandas as pd
import numpy as np
from scipy import signal as sgn
import math as m
##################################################
# Aux functions #
##################################################
# Mult quaternion
def q_mult(q1, q2):
w1, x1, y1, z1 = q1
w2,... | pd.DataFrame([]) | pandas.DataFrame |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 21 14:16:52 2021
@author: <NAME>
INFO:
This script is where the UHA and urban heat analyses are done
The UHA is calculated in this script using both MIDAS and CWS measurements
Most of the plots and tables in the ERL paper are made here
Some information written ... | pd.DatetimeIndex(df.index) | pandas.DatetimeIndex |
import os
import errno
import warnings # To ignore any warnings warnings.filterwarnings("ignore")
from glob import glob # glob uses the wildcard pattern to create an iterable object file names # containing all matching file names in the current directory.
import numpy as np # For mathematical calculations
import pa... | pd.DataFrame() | pandas.DataFrame |
# coding: utf-8
# Copyright (c) pytmge Development Team.
'''
Classes for data preparation.
Dataset
chemical_formulas
composition
'''
import re
import numpy as np
import pandas as pd
from pytmge.core import element_list, progressbar, _print
__author__ = '<NAME>'
__maintainer__ = '<NA... | pd.isnull(cf) | pandas.isnull |
import numpy as np
import numpy as np
import pandas as pd
from sklearn import preprocessing
import pprint
from os import chdir
from sklearn.ensemble import RandomForestClassifier
import sys
#sys.path.insert(0, '//Users/babakmac/Documents/HypDB/relational-causal-inference/source/HypDB')
#from core.cov_selection import... | pd.get_dummies(cur_test[Y_features]) | pandas.get_dummies |
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | tm.assert_frame_equal(expected_df, result) | pandas.util.testing.assert_frame_equal |
import itertools
from collections.abc import Iterable
from typing import Pattern
from warnings import warn
import numpy as np
import pandas as pd
def _unique(df, columns=None):
if isinstance(columns, str):
columns = [columns]
if not columns:
columns = df.columns.tolist()
info = {}
for... | pd.DataFrame(columns=df.columns) | pandas.DataFrame |
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implement transformers for summarizing a time series."""
__author__ = ["mloning", "RNKuhns", "danbartl", "grzegorzrut"]
__all__ = ["SummaryTransformer", "WindowSummarizer"]
import warnings
imp... | pd.concat([summary_value, quantile_value]) | pandas.concat |
#!/usr/bin/env python3.7
# Copyright [2020] EMBL-European Bioinformatics Institute
#
# 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... | pd.read_excel(f, usecols="B:AM", header=1, sheet_name='Sheet1') | pandas.read_excel |
#!/usr/bin/env python
# coding: utf-8
import os
import argparse
from time import time
import pandas as pd
from sqlalchemy import create_engine, table
def main(params):
user = params.user
password = params.password
host = params.host
port = params.port
db = params.db
table_name = params.table... | pd.to_datetime(df.tpep_dropoff_datetime) | pandas.to_datetime |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import json
cmip5_scenarios = | pd.read_csv('../data/cmip5/scenario_names.csv') | pandas.read_csv |
import pandas as pd
def get_toy_data_seqclassification():
train_data = {
"sentence1": [
'Amrozi accused his brother , whom he called " the witness " , of deliberately distorting his evidence .',
"Yucaipa owned Dominick 's before selling the chain to Safeway in 1998 for $ 2.5 billio... | pd.DataFrame(dev_data) | pandas.DataFrame |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FFMpegWriter
import copy
from . import otherfunctions
from pathlib import Path
import warnings
import os
from skimage import feature
# Implement the data structure
class BaseMeasurement:
# Store... | pd.concat(pg_data, axis=1) | pandas.concat |
"""analysis.py: module for manifolds analysis."""
__author__ = "<NAME>, <NAME>, <NAME> and <NAME>"
__copyright__ = "Copyright (c) 2020, 2021, <NAME>, <NAME>, <NAME> and <NAME>"
__credits__ = ["Department of Chemical Engineering, University of Utah, Salt Lake City, Utah, USA", "Universite Libre de Bruxelles, Aero-Therm... | pd.DataFrame(metrics_to_print, columns=__clusters_names, index=['Observations', 'Min', 'Max'] + metrics) | pandas.DataFrame |
# -*- coding: utf-8 -*-
# pylint: disable=W0612,E1101
from datetime import datetime
import operator
import nose
from functools import wraps
import numpy as np
import pandas as pd
from pandas import Series, DataFrame, Index, isnull, notnull, pivot, MultiIndex
from pandas.core.datetools import bday
from pandas.core.n... | assert_panel_equal(inp, exp) | pandas.util.testing.assert_panel_equal |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 6 11:40:40 2020
@author: hendrick
"""
# =============================================================================
# # # # import packages
# =============================================================================
import numpy as np
import pandas as pd
import ma... | pd.read_csv(xynfilef, header=None, delim_whitespace=True) | pandas.read_csv |
"""Module for common preprocessing tasks."""
import time
import pandas as pd
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
# TODO: acertar docstrings
# TODO: drop_by
# TODO: apply_custom_item_level (escolher axis)
# TODO: colocar um acompanhamento de progresso
class Prep(object):
"""Preprocessing /... | pd.concat([self._data, dummy], axis=1) | pandas.concat |
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pandas.compat as compat
###############################################################
# Index / Series common tests which may trigger dtype coercions
###############################################... | pd.Index([1, 1.1, 2, 3, 4]) | pandas.Index |
# ----------------------------------------------------------------------------
# Copyright (c) 2022, Bokulich Laboratories.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# --------------------------------------------------------... | pd.Series(found_terms, name='count') | pandas.Series |
# -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Author: <NAME>
date: 2020/1/9 22:52
contact: <EMAIL>
desc: 金十数据中心-经济指标-央行利率-主要央行利率
https://datacenter.jin10.com/economic
美联储利率决议报告
欧洲央行决议报告
新西兰联储决议报告
中国央行决议报告
瑞士央行决议报告
英国央行决议报告
澳洲联储决议报告
日本央行决议报告
俄罗斯央行决议报告
印度央行决议报告
巴西央行决议报告
"""
import json
import time
import pandas as pd... | pd.to_datetime(date_list) | pandas.to_datetime |
import os
from glob import glob
import numpy as np, pandas as pd, matplotlib.pyplot as plt
from astropy.io import ascii as ap_ascii
from numpy import array as nparr
from astrobase.services.gaia import objectid_search
from mpl_toolkits.axes_grid1 import make_axes_locatable
from stringcheese import pipeline_utils as pu
... | pd.concat(group_df_list) | pandas.concat |
import os
import pandas as pd
import numpy as np
import scipy
import scipy.stats
import pypeliner
import remixt.seqdataio
import remixt.config
def infer_snp_genotype(data, base_call_error=0.005, call_threshold=0.9):
""" Infer snp genotype based on binomial PMF
Args:
data (pandas.DataFrame): input sn... | pd.DataFrame(columns=['chromosome', 'start', 'end', 'hap_label', 'allele_id', 'readcount']) | pandas.DataFrame |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2022/2/2 23:26
Desc: 东方财富网-行情首页-沪深京 A 股
"""
import requests
import pandas as pd
def stock_zh_a_spot_em() -> pd.DataFrame:
"""
东方财富网-沪深京 A 股-实时行情
http://quote.eastmoney.com/center/gridlist.html#hs_a_board
:return: 实时行情
:rtype: pandas.DataFrame
... | pd.DataFrame() | pandas.DataFrame |
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
date_range,
)
import pandas._testing as tm
class TestDatetimeIndex:
def test_indexing_with_datetime_tz(self):
# GH#8260
# support datetime64 with tz
idx = Index(date_range("20130101", period... | tm.assert_series_equal(result, expected) | pandas._testing.assert_series_equal |
# -*- 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, ... | lrange(3) | pandas.compat.lrange |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 16 03:18:02 2018
@author: Kazuki
"""
import numpy as np
import pandas as pd
import os
import utils
utils.start(__file__)
#==============================================================================
# setting
month_limit = 12 # max: 96
month_ro... | pd.merge(test, pt, on=KEY, how='left') | pandas.merge |
import sys
import os
from tqdm import tqdm
import pmdarima as pm
from pmdarima.model_selection import train_test_split
import numpy as np
import matplotlib.pyplot as plt
from datetime import timedelta
import pandas as pd
sys.path.insert(0, os.path.abspath('../../../covid_forecast'))
from covid_forecast.utils.data_io im... | pd.to_datetime(data['confirmed_date']) | pandas.to_datetime |
import os
import pandas as pd
from gym_brt.data.config.configuration import FREQUENCY
from matplotlib import pyplot as plt
def set_new_model_id(path):
model_id = 0
for (_, dirs, files) in os.walk(path):
for dir in dirs:
try:
if int(dir[:3]) >= model_id:
... | pd.DataFrame(columns=columns) | pandas.DataFrame |
import pandas as pd
import pytest
from evalml.preprocessing import split_data
from evalml.problem_types import (
ProblemTypes,
is_binary,
is_multiclass,
is_regression,
is_time_series,
)
@pytest.mark.parametrize("problem_type", ProblemTypes.all_problem_types)
@pytest.mark.parametrize("data_type", ... | pd.DataFrame(X) | pandas.DataFrame |
# -*- coding: utf-8 -*-
import requests
import json
import pandas as pd
from io import StringIO
import numpy as np
import time
#
timezones={}
#function = 'TIME_SERIES_INTRADAY'
apii = 'https://www.alphavantage.co/query?function={function}&symbol={symbol}&interval={interval}&outputsize=full&datatype=csv&apikey='
apid =... | pd.DataFrame() | pandas.DataFrame |
import os
os.environ["OMP_NUM_THREADS"] = "1" # noqa E402
os.environ["OPENBLAS_NUM_THREADS"] = "1" # noqa E402
os.environ["MKL_NUM_THREADS"] = "1" # noqa E402
os.environ["VECLIB_MAXIMUM_THREADS"] = "1" # noqa E402
os.environ["NUMEXPR_NUM_THREADS"] = "1" # noqa E402
from tqdm import tqdm
from timeit import Timer
... | pd.DataFrame.from_dict(images_per_second) | pandas.DataFrame.from_dict |
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
from pytz import timezone, utc
from scipy import stats
from time import gmtime, strftime, mktime
def data_sampler_renamer_parser(path='weather-data.txt'):
# Take columns that are useful, rename them, parse the timestamp string
... | pd.to_datetime(dataframe['est_datetime']) | pandas.to_datetime |
import numpy as np
import pandas as pd
from rdt.transformers.pii import AnonymizedFaker
def test_anonymizedfaker():
"""End to end test with the default settings of the ``AnonymizedFaker``."""
data = pd.DataFrame({
'id': [1, 2, 3, 4, 5],
'username': ['a', 'b', 'c', 'd', 'e']
})
insta... | pd.testing.assert_frame_equal(transformed, expected_transformed) | pandas.testing.assert_frame_equal |
"""
Code to manage results of many simulations together.
"""
import pandas as pd
from tctx.networks.turtle_data import DEFAULT_ACT_BINS
from tctx.util import sim
import os.path
import logging
from pathlib import Path
import json
from tqdm.auto import tqdm as pbar
import datetime
import h5py
import numpy as np
impor... | pd.Series(spikes_raw_idx) | pandas.Series |
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import os
import pandas as pd
import time
print('PID '+str(os.getpid()))
df = | pd.read_csv('stock-ticker.csv') | pandas.read_csv |
import pkg_resources
from unittest.mock import sentinel
import pandas as pd
import pytest
import osmo_jupyter.dataset.combine as module
@pytest.fixture
def test_picolog_file_path():
return pkg_resources.resource_filename(
"osmo_jupyter", "test_fixtures/test_picolog.csv"
)
@pytest.fixture
def test_... | pd.to_datetime("2022") | pandas.to_datetime |
import os
import click
import pandas as pd
import numpy as np
from datetime import timedelta
from codigo.desafio_iafront.data.dataframe_utils import read_csv
from utils import *
from codigo.desafio_iafront.jobs.constants import DEPARTAMENTOS
from bokeh.plotting import figure, output_file
from bokeh.io import output_f... | pd.concat((missing_vals,nan )) | pandas.concat |
from typing import Dict, List, Optional
from copy import deepcopy
import pytz
from datetime import datetime, timedelta
try:
import MetaTrader5 as Mt5
except:
pass
import pandas as pd
import yaml
from pathlib import Path
from termcolor import colored
from mt5_connector.account import Account
__a... | pd.DataFrame() | pandas.DataFrame |
import csv
import json
import numpy as np
import pandas as pd
def read_delim(filepath):
"""
Reads delimited file (auto-detects delimiter + header). Returns list.
:param filepath: (str) location of delimited file
:return: (list) list of records w/o header
"""
f = open(filepath, 'r')
diale... | pd.DataFrame(temp, columns=headers) | pandas.DataFrame |
import nltk
import numpy as np
import pandas as pd
import os
from collections import Counter
import sklearn
from sklearn.preprocessing import LabelEncoder
from imblearn.over_sampling import RandomOverSampler
from imblearn.under_sampling import RandomUnderSampler
import tensorflow as tf
class Pipeline:
def __init... | pd.read_csv("data/" + list_subfolders[0] + "/" + list_subfolders[0] + "-tweets_labeled.csv") | pandas.read_csv |
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import Index, MultiIndex, Series, date_range, isna
import pandas._testing as tm
@pytest.fixture(
params=[
"linear",
"index",
"values",
"nearest",
"slinear",
... | Series([5.0, 5.0, 5.0, 7.0, 9.0, 9.0]) | pandas.Series |
import discord
import os
import pandas as pd
client = discord.Client()
## Initiate IEX
import pyEX as p
iex = p.Client(api_token=iex_key, version='stable')
## Get Quote
## Get News
## Date
import datetime
def convert_date(x):
stamp = x
date = datetime.datetime.fromtimestamp(stamp / 1e3)
date = date... | pd.DataFrame(news) | pandas.DataFrame |
from opendatatools.common import RestAgent, md5
from progressbar import ProgressBar
import json
import pandas as pd
import io
import hashlib
import time
index_map = {
'Barclay_Hedge_Fund_Index' : 'ghsndx',
'Convertible_Arbitrage_Index' : 'ghsca',
'Distressed_Securities_Index' : 'ghsds',
'Emerg... | pd.DataFrame(jsonobj['data']) | pandas.DataFrame |
# -*- coding: utf-8 -*-
"""
Created on Wed May 20 17:56:56 2020
@author: CatsAndProcurement
The purpose of this script is to extract search-specific data from the
Government Accountability Office (GAO) Recommendations Database.
GAO is the primary legislative branch audit agency of the U.S. government.
This d... | pd.read_csv(callURL,skiprows=5) | pandas.read_csv |
#!/usr/bin/env python
# coding: utf-8
# In[5]:
import pandas as pd
import numpy as np
import glob,os
from glob import iglob
#import scanpy as sc
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import RocCurveDisplay
from sklearn.datasets import load_wine
from skle... | pd.read_csv('./model/ra_pbmc_feature_importance_bulk.csv') | pandas.read_csv |
# -*- coding: utf-8 -*-
# Copyright (C) 2018-2022, earthobservations developers.
# Distributed under the MIT License. See LICENSE for more info.
import pandas as pd
from pandas._testing import assert_series_equal
from wetterdienst.core.scalar.values import ScalarValuesCore
def test_coerce_strings():
series = Sca... | assert_series_equal(series, series_expected) | pandas._testing.assert_series_equal |
"""
General collection of functions for manipulating dataframes, generally to isolate proteins or peptides that fit the criteria of interest.
"""
import numpy as np
import pandas as pd
from scipy import stats
import os
import logging
from ProteomicsUtils.LoggerConfig import logger_config
logger = logger_config(__name_... | pd.DataFrame() | pandas.DataFrame |
import calendar
import datetime as dt
from io import BytesIO, StringIO
import uuid
from fastapi import HTTPException
import numpy as np
import pandas as pd
import pytest
from rq import SimpleWorker
from solarperformanceinsight_api import models, storage, compute
from solarperformanceinsight_api.routers import jobs
... | pd.concat([weather_df, ndf], ignore_index=True) | pandas.concat |
import pandas as pd
import matplotlib.pyplot as plt
import os
import time
from PIL import Image
def users_database():
files = os.listdir()
if 'shurlz_database.csv' in files:
pass
else:
users_database = pd.DataFrame(columns=['Name', 'Price', 'Date'])
users_database.to_csv... | pd.to_datetime(data.Date) | pandas.to_datetime |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
import pydot
from sklearn import preprocessing, model_selection
from sklearn.tree import export_graphviz
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import cross_val_score
from skl... | pd.read_csv(df_name3) | pandas.read_csv |
import pandas as pd # type: ignore
from arkouda.pdarrayclass import pdarray
from arkouda.pdarraycreation import arange, ones
from arkouda.pdarraysetops import argsort, in1d, unique
from arkouda.sorting import coargsort
from arkouda.dtypes import int64, float64, bool
from arkouda.util import register, convert_if_categ... | pd.Series(index=mi, dtype='float64') | pandas.Series |
#Use to plot models on top of data
import numpy as np
from astropy.io import fits
import matplotlib.pyplot as plt
from astropy.table import Table
import math
from matplotlib.colors import PowerNorm
import matplotlib.colors as colors
import pandas as pd
import sys
from scipy.interpolate import RectBivariateSpline, Cubic... | pd.isna(apogee_data['MG_H']) | pandas.isna |
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
color = sns.color_palette()
aisles_df= pd.read_csv("./input/aisles.csv")
departments_df= pd.read_csv("./input/departments.csv")
order_products_prior_df= pd.read_csv("./input/order_products_prior.csv")
order_products_train_df= pd.read_csv(".... | pd.read_csv("./input/products.csv") | pandas.read_csv |
###############
#
# Transform R to Python Copyright (c) 2019 <NAME> Released under the MIT license
#
###############
import os
import numpy as np
import pystan
import pandas
import pickle
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.special import expit as logistic
germination_dat = pandas.read_c... | pandas.get_dummies(germination_dat) | pandas.get_dummies |
import pandas as pd
import numpy as np
import os
import datetime
import git
from pathlib import Path
repo = git.Repo("./", search_parent_directories=True)
homedir = repo.working_dir
inputdir = f"{homedir}" + "/data/us/mobility/"
inputdir2 = f"{homedir}" + "/data/google_mobility/"
outputdir = f"{homedir}" + "/models/da... | pd.read_csv('State_Abbrev.csv') | pandas.read_csv |
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn import metrics
import seaborn as sn
import matplotlib.pyplot as plt
#veri setini excel dosyasından okuyoruz
dataset = pd.read_excel('dataset.xlsx',index_col=0)
#veri setini datafram... | pd.DataFrame(dataset) | pandas.DataFrame |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.