prompt stringlengths 19 1.03M | completion stringlengths 4 2.12k | api stringlengths 8 90 |
|---|---|---|
# *****************************************************************************
# © Copyright IBM Corp. 2018. All Rights Reserved.
#
# This program and the accompanying materials
# are made available under the terms of the Apache V2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/... | pd.Grouper(key=self._entity_id) | pandas.Grouper |
import os
from datetime import date
from dask.dataframe import DataFrame as DaskDataFrame
from numpy import nan, ndarray
from numpy.testing import assert_allclose, assert_array_equal
from pandas import DataFrame, Series, Timedelta, Timestamp
from pandas.testing import assert_frame_equal, assert_series_equal
from pymo... | Timestamp('2008-10-23 05:53:06') | pandas.Timestamp |
from numpy import mean,cov,double,cumsum,dot,linalg,array,rank
from pylab import plot,subplot,axis,stem,show,figure
import numpy
import pandas
import math
import matplotlib.pyplot as plt
import numpy as np
from sklearn.preprocessing import scale
from sklearn.decomposition import PCA
from sklearn import cross_validation... | pandas.read_csv("multi_phenos.txt",sep=' ',header=None) | pandas.read_csv |
import numpy as np
from sas7bdat import SAS7BDAT
import glob
import pandas as pd
from sklearn import preprocessing
from sas7bdat import SAS7BDAT
import glob
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from sklearn import utils, model_selection, metrics, linear_model, neighbors, ensemble... | pd.read_csv('./data/pact_12_2009only.csv',usecols = ['idind', 'u324', 'u339','u340_mn', 'u341_mn','u508', 'u509_mn','u510_mn','u345','u346_mn', 'u347_mn']) | pandas.read_csv |
"""
This script plots the ARI and Runtime values obtained from graspyclust_experiments.py, autogmm_experiments.py, and mclust_experiments.r
It saves the figures as subset_abc.png and subset_def.png
"""
#%%
import numpy as np
from scipy.stats import mode
from scipy.stats import wilcoxon
from sklearn.metrics import adjus... | pd.read_csv(path + "autogmm_drosophila.csv") | pandas.read_csv |
'''
Contains classes of models that can be found in `Vo and Zhang 2015 paper \
<https://www.ijcai.org/Proceedings/15/Papers/194.pdf>`_.
Classes:
1. :py:class:`bella.models.target.TargetInd` - Target indepdent model
'''
from collections import defaultdict
import copy
import time
import pandas as pd
from sklearn.model... | pd.DataFrame(grid_search.cv_results_) | pandas.DataFrame |
# -*- coding: utf-8 -*-
import scrapy # needed to scrape
import xlrd # used to easily import xlsx file
import json
import re
import pandas as pd
import numpy as np
from openpyxl import load_workbook
import datetime
#from datetime import timedelta
class ScrapeTokenData(scrapy.Spider):
name = 'CreateTokenListbot... | pd.DataFrame(data=temp, index=ranking) | pandas.DataFrame |
import os
import warnings
from collections import OrderedDict
from unittest.mock import patch
import numpy as np
import pandas as pd
import pytest
import woodwork as ww
from sklearn.exceptions import NotFittedError, UndefinedMetricWarning
from sklearn.preprocessing import label_binarize
from evalml.exceptions import ... | pd.Series([2, 1, 3, 4]) | pandas.Series |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 5 12:13:33 2018
@author: <NAME> (<EMAIL> / <EMAIL>)
"""
#Python dependencies
from __future__ import division
import pandas as pd
import numpy as np
from scipy.constants import codata
from pylab import *
from scipy.optimize import curve_fit
import m... | pd.concat([self.df_raw0[0], self.df_raw0[1], self.df_raw0[2], self.df_raw0[3], self.df_raw0[4], self.df_raw0[5], self.df_raw0[6], self.df_raw0[7], self.df_raw0[8], self.df_raw0[9], self.df_raw0[10], self.df_raw0[11]], self.df_raw0[12], self.df_raw0[13], axis=0) | pandas.concat |
import requests
import pandas as pd
import numpy as np
import configparser
from datetime import timedelta, datetime
from dateutil import relativedelta, parser, rrule
from dateutil.rrule import WEEKLY
class whoop_login:
'''A class object to allow a user to login and store their authorization code,
then per... | pd.DataFrame() | pandas.DataFrame |
#!/usr/bin/env python3
"""
Testing a 1D two-state (unsupervised) GMM classifier
The motivation for this simple scheme was to see how well the EMG RMS power
could predict Wake/Sleep states, assuming REM is folded into Sleep.
This 1D two-state GMM scheme is applied (independently) to each feature in the
incoming std
""... | pd.DataFrame(data, columns=scoreblock.data_cols) | pandas.DataFrame |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 22 17:28:54 2018
@author: galengao
This is the original analysis code as it exists in the environment where it was writen and initially run.
Portions and modifications of this script constitute all other .py scripts in this directory.
"""
import nu... | pd.DataFrame(c_results, columns=['Cohort', 'Direction', 'Gene', 'Difference']) | pandas.DataFrame |
# authors: <NAME>
# date: 2020-03-02
"""
The pypuck functions are used as wrapper functions to call the NHL.com
publicly available API's.
"""
import requests
import pandas as pd
import altair as alt
from pypuck.helpers import helpers
def player_stats(start_date=None, end_date=None):
"""
Query the top 100 pl... | pd.DataFrame(api['data']) | pandas.DataFrame |
import pickle
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter
import seaborn as sns
from gensim.models.ldamulticore import LdaMulticore
#load the files
data_files = ["data/pubmed_articles_cancer_01_smaller.csv", "data/pubmed_articles_cancer_02_smaller.csv",
... | pd.DataFrame() | pandas.DataFrame |
"""
Calculate MQA scores only for the resolved region from local score.
MQA methods:
- DeepAccNet
- P3CMQA
- ProQ3D
- VoroCNN
"""
import argparse
import os
import subprocess
import tarfile
from pathlib import Path
from typing import Any, List, Union
import numpy as np
import pandas as pd
from prody i... | pd.read_csv(f, index_col=0) | pandas.read_csv |
"""
This script contains experiment set ups for results in figure 1.
"""
import os
import pandas as pd
from experiment_Setup import Experiment_Setup
from agent_env import get_pi_env
from SVRG import *
if __name__ == '__main__':
NUM_RUNS = 10
# Random MDP
alg_settings = [
{"method... | pd.DataFrame(pi_results) | pandas.DataFrame |
# -*- coding: utf-8 -*-
"""
Created on Sun April 7 18:51:20 2020
@author: omars
"""
# %% Libraries
from mdp_utils import fit_cv_fold
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import random
import binascii
from sklearn.model_selection import GroupKFold
from tqdm import tqdm
import os
impo... | pd.concat(g) | pandas.concat |
#! /usr/bin/env python3
""" -------------------------------
Copyright (C) 2018 RISE
This code was produced by RISE
The 2013-03-26 version
bonsai/src_v02/diagnose.py
processing the diagnosis data
Notice: This file is not imported
using the name dia, since dia is
often used for a data... | pd.DataFrame(data) | pandas.DataFrame |
import pandas as pd
from typing import List
import sys
metabolites_path = sys.argv[1]
proteins_path = sys.argv[2]
pathways_path = sys.argv[3]
def make_node_set(df):
return df.reindex(columns=['id', 'name', 'category', 'description', 'synonyms', 'xrefs'])
def make_edge_set(df):
return df.reindex(columns=['sub... | pd.read_csv(path, dtype=str) | pandas.read_csv |
## Generate twitter Pre-Trained Word2Vec and trained Word2Vec
## Word2Vec
import os
os.chdir("C:/Users/dordo/Dropbox/Capstone Project")
import pandas as pd
import pickle
from gensim import corpora
from gensim.models import Word2Vec
import gensim.downloader as api
##----------------------------------------------------... | pd.DataFrame(embeds_1[0]) | pandas.DataFrame |
# -*- coding: utf-8 -*-
from argparse import RawTextHelpFormatter, ArgumentParser
import pandas as pd
import os
from datetime import timedelta, datetime
from amurlevel_model.config import DAYS_FORECAST, ALL_STATIONS, NUMBER_OF_INFERENCE_STATIONS, DATASETS_PATH
from amurlevel_model.dataloaders.asunp import get_asunp_h... | pd.to_datetime(args.f_day) | pandas.to_datetime |
# Core functions
#
# this file contains reusable core functions like filtering on university
# and adding year and month name info
# these are functions which are generally used in every product
# roadmap: I want to push all functions from loose function
# to functions combined in classgroups
from nlp_functions impo... | pd.notnull(row) | pandas.notnull |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import re
import os
def get_plot_data(path, span=100):
df = pd.DataFrame()
with open(path + 'test.txt') as file:
data = pd.read_csv(file, index_col=None)
df = df.append(data, ignore_index=True)
d... | pd.DataFrame() | pandas.DataFrame |
from collections import OrderedDict
from datetime import timedelta
import numpy as np
import pytest
from pandas.core.dtypes.dtypes import DatetimeTZDtype
import pandas as pd
from pandas import DataFrame, Series, Timestamp, date_range, option_context
import pandas._testing as tm
def _check_cast(df, v):
"""
... | pd.Series(dtype=object) | pandas.Series |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import warnings
from math import sqrt
class portfolio:
'''
The universe and the valid testing period will be defined by the price data.
'''
def __init__(self, weight=None, share=None, benchmark=None, end_date=None, name='Portfolio... | pd.Series(port_daily_ret_values, index=ex_weight.index) | pandas.Series |
"""
utility functions for node classification; dynamic graphs
"""
import argparse
import sys
import pandas as pd
import numpy as np
from scipy.stats import entropy
import random
from sklearn.preprocessing import MinMaxScaler
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticR... | pd.read_csv(stats_filename) | pandas.read_csv |
import os
from nose.tools import *
import unittest
import pandas as pd
from py_entitymatching.utils.generic_helper import get_install_path
import py_entitymatching.catalog.catalog_manager as cm
import py_entitymatching.utils.catalog_helper as ch
from py_entitymatching.io.parsers import read_csv_metadata
datasets_path... | pd.read_csv(path_a) | pandas.read_csv |
import collections
import csv
import tensorflow as tf
from sklearn.metrics import *
import pandas as pd
import numpy as np
from tensorflow.keras.callbacks import Callback
import logging
# Following is a dependency on the ssig package:
#! git clone https://github.com/ipavlopoulos/ssig.git
from ssig import art
def ca_p... | pd.concat(data) | pandas.concat |
#-*- coding: utf-8 -*-
import pandas as pd
import numpy as np
ACTION_201602_FILE = "data_ori/JData_Action_201602.csv"
ACTION_201603_FILE = "data_ori/JData_Action_201603.csv"
ACTION_201603_EXTRA_FILE = "data_ori/JData_Action_201603_extra.csv"
ACTION_201604_FILE = "data_ori/JData_Action_201604.csv"
COMMENT_FILE = "data... | pd.concat(df_ac, ignore_index=True) | pandas.concat |
"""
This module implements several methods for calculating and outputting solutions of the unionfind_cluster_editing() algorithm.
It contains two methods for the (best) generated raw solutions,
and, more importantly, methods to merge solutions into one better solution.
"""
from union_find import *
from math import log
... | pd.unique(merged) | pandas.unique |
import pytest
import pandas as pd
import pypipegraph as ppg
from mbf_genomics import genes, DelayedDataFrame
from mbf_genomics.testing import MockGenome
from pypipegraph.testing import force_load
from pathlib import Path
@pytest.mark.usefixtures("new_pipegraph")
class TestDescription:
def test_simple(self):
... | pd.DataFrame({"gene_stable_id": ["a", "c", "b"]}) | pandas.DataFrame |
# -*- encoding:utf-8 -*-
"""
中间层,从上层拿到x,y,df
拥有create estimator
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import os
import functools
from enum import Enum
import numpy as np
import pandas as pd
from sklearn.base import TransformerM... | pd.get_dummies(raw_df['Cabin'], prefix='Cabin') | pandas.get_dummies |
from unittest.mock import patch
import featuretools as ft
import pandas as pd
import pytest
import woodwork as ww
from pandas.testing import assert_frame_equal
from woodwork.logical_types import (
Boolean,
Categorical,
Datetime,
Double,
Integer,
)
from blocktorch.pipelines.components import DFSTra... | pd.Series([1, 2, 1]) | pandas.Series |
# -*- coding: utf-8 -*-
"""
Created on Wed May 24 16:15:24 2017
Sponsors Club messaging functions
@author: tkc
"""
import pandas as pd
import smtplib
import numpy as np
import datetime
import tkinter as tk
import glob
import re
import math
import textwrap
from tkinter import filedialog
from email.mime.multipart impor... | pd.read_csv(cnf._INPUT_DIR+'\\coaches.csv', encoding='cp437') | pandas.read_csv |
import os
import json
CONFIG_LOCATION = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, "data", "path_config.json"))
with open(CONFIG_LOCATION) as _json_file:
CONFIG = json.load(_json_file)
DATA_DIR = CONFIG["main_data_dir"]
if not os.path.exists(DATA_DIR):
PROJECT_ROOT_PATH = os.path.dirname(os.... | pd.DataFrame(s2and_feature_summary, index=[0]) | pandas.DataFrame |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 31 20:56:31 2019
@author: olegm
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import OneHotEncoder,LabelEncoder
test = pd.read_csv('test.csv')
train = pd.read_csv('train.csv')
submission = pd.read_csv('gender_subm... | pd.merge(left= test, right=submission, how="left", left_on="PassengerId", right_on="PassengerId") | pandas.merge |
import os
import random
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from typing import Tuple, Dict
from .template import Processor
from .normalization import CountNormalization
class PlotTaxonBarplots(Processor):
DSTDIR_NAME = 'taxon-barplot'
taxon_table_tsv_dict: Dict[str, str]
... | pd.Series(self.data.index) | pandas.Series |
# -*- coding: utf-8 -*-
"""
docstring goes here.
:copyright: Copyright 2014 by the Elephant team, see AUTHORS.txt.
:license: Modified BSD, see LICENSE.txt for details.
"""
from __future__ import division, print_function
import unittest
from itertools import chain
from neo.test.generate_datasets import fake_neo
impo... | assert_frame_equal(targ, res7) | pandas.util.testing.assert_frame_equal |
import sys
sys.path.append('../../')
import numpy as np
import pandas as pd
from tqdm import trange
_cache_path = '../src/d04_modeling/cache/'
_default_fname = 'value_function.pkl'
class KnapsackApprox:
"""
This algorithm finds a subset of items whose total weight does
not exceed W, with total value at ... | pd.Index(solution_set, name=data.index.name) | pandas.Index |
# author: Bartlomiej "furas" Burek (https://blog.furas.pl)
# date: 2021.10.18
#
# title: Unpacking pands read_HTML dataframe
# url: https://stackoverflow.com/questions/69608885/unpacking-pands-read-html-dataframe/69610319#69610319
# [Unpacking pands read_HTML dataframe](https://stackoverflow.com/questions/69608885/un... | pd.DataFrame(all_results, columns=['date', 'game_time', 'Team1', 'Team2', 'Score', '1', '2', 'B']) | pandas.DataFrame |
# -*- coding: utf-8 -*-
from __future__ import annotations
import itertools
import collections
from abc import ABC, abstractmethod
from typing import (cast,
Any,
Callable,
Dict,
List,
Optional,
Sequ... | pd.isna(group["turkin1"]) | pandas.isna |
import gc
import glob
import os.path
import numpy as np
import pandas as pd
import torch
from sentence_transformers import SentenceTransformer, util
from torch import nn
from bin.inference.chunks import chunks
from bin.transformers.concat_regression import ConcatRegression
from bin.file_utils import rm_and_new_folder... | pd.read_csv("data/toxictask/task_a_distant.tsv", sep="\t") | pandas.read_csv |
"""
En este archivo se encuentran funciones auxiliares usadas para
actualizar día a día los datos.
"""
from datetime import datetime, timedelta
import os
import time
import logging
from alpha_vantage.techindicators import TechIndicators
import pandas as pd
import numpy as np
import pandas_datareader.data as web
impo... | pd.concat(techindc, axis=1, join='inner') | pandas.concat |
"""
utility for working with DataFrames
"""
import pandas as pd
import numpy as np
class Edit:
"""
this class lets you edit a dataframe
"""
def __init__(self,df = pd.DataFrame(np.ones(5))):
self.df = df
def add_col(self,df,lst,name = "New_column"):
"""
this function w... | pd.Series(lst) | pandas.Series |
import pandas as __pd
import datetime as __dt
from multiprocessing import Pool as __Pool
import multiprocessing as __mp
from functools import reduce as __red
from seffaflik.__ortak.__araclar import make_requests as __make_requests
from seffaflik.__ortak import __dogrulama as __dogrulama
from seffaflik.elektrik import ... | __pd.DataFrame(json["body"]["aicList"]) | pandas.DataFrame |
# -*- coding: utf-8 -*-
import json
import numpy as np
import pandas as pd
import sklearn
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
from sklear... | pd.HDFStore("nnr_data.h5") | pandas.HDFStore |
"""
json 불러와서 캡션 붙이는 것
"""
import json
import pandas as pd
path = './datasets/vqa/v2_OpenEnded_mscoco_train2014_questions.json'
with open(path) as question:
question = json.load(question)
# question['questions'][0]
# question['questions'][1]
# question['questions'][2]
df = pd.DataFrame(question['questions'])
d... | pd.DataFrame(answer['annotations']) | pandas.DataFrame |
# 라이브러리 불러오기
import os
import pandas as pd
import numpy as np
from data.rle_encode import rle_encode
from data.dicom_reader import *
from skimage.io import imread
import math
# 경로 지정 (폴더 위치에 따라 수정이 필요함 *현재는 바탕화면 기준)
path_nrm = "./data/dataset512/train"
path_test = "./data/dataset512/test"
path_test_mask = "./data/data... | pd.DataFrame(file_list_test, columns=['ImageId']) | pandas.DataFrame |
# coding: utf-8
# # Project One: Data Visualization, Descriptive Statistics, Confidence Intervals
#
# This notebook contains the step-by-step directions for Project One. It is very important to run through the steps in order. Some steps depend on the outputs of earlier steps. Once you have completed the steps in thi... | pd.read_csv('nbaallelo.csv') | pandas.read_csv |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
data = | pd.read_csv('201213177_data.csv', engine='python') | pandas.read_csv |
"""Mid-level helper functions for AutoTS."""
import random
import numpy as np
import pandas as pd
import datetime
import json
from hashlib import md5
from autots.evaluator.metrics import PredictionEval
from autots.tools.transform import RandomTransform, GeneralTransformer, shared_trans
from autots.models.ensemble impor... | pd.DataFrame(cur_spl) | pandas.DataFrame |
from datetime import datetime
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas.core.dtypes.base import _registry as ea_registry
from pandas.core.dtypes.common import (
is_categorical_dtype,
is_interval_dtype,
is_object_dtype,
)
from pandas.core.dtypes.dtypes import (... | DatetimeTZDtype(tz="US/Eastern") | pandas.core.dtypes.dtypes.DatetimeTZDtype |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 18:41:53 2020
@author: Danish
"""
import pandas as pd
import os
from utilities import to_weeks, extract_sub_df
import numpy as np
import pickle
path = r'C:\Users\danis\Documents\USFoods'
csv_files = os.listdir(path+'/COVID')
#removes the first file which is non csv
... | pd.read_csv(path+'/zip_to_county.csv') | pandas.read_csv |
import pandas as pd
import glob, os
config = dict(
safegraph_data_path = '~/safegraph_data/'
)
joined_df = pd.read_pickle('data/us_data_with_latent_populations.pkl')
joined_df = | pd.read_pickle('joined_df_test_us.pkl') | pandas.read_pickle |
import pandas as pd
from tabulate import tabulate
import pprint
class System:
def __init__(self, api):
""" Gets information on system information like notifications, status codes, and metrics
:param api: api authentication using the Alooma package
"""
self.api = api
def get_s... | pd.to_datetime(metrics['datapoints'][0][1], unit='s') | pandas.to_datetime |
"""
Script for exploring ESGF results.
"""
import json
import re
import pandas as pd
def split_esgf_string(model_data):
"""
Use re to split as split method takes only one split string
:param model_data:
:return:
"""
model_data = re.split('\.|\|', esgf_holdings_master_list['id'].loc[1])
r... | pd.DataFrame.from_dict(esgf_data['response']['docs']) | pandas.DataFrame.from_dict |
import pandas as pd
import numpy as np
import pickle
from .utils import *
def predNextDays(optmod_name, opt_mod, var_name, pred_days):
pred = (opt_mod[optmod_name]['mod_data'][var_name])[opt_mod[optmod_name]['i_start'] + opt_mod[optmod_name]['period'] -1 :opt_mod[optmod_name]['i_start'] + opt_mod[optmod_name]['per... | pd.Series(uff_Gc) | pandas.Series |
#!/usr/bin/env python3
"""Script to perform the group analysis.
Creates the figures 3 and 4 from the paper
References:
https://towardsdatascience.com/an-introduction-to-the-bootstrap-method-58bcb51b4d60
https://machinelearningmastery.com/calculate-bootstrap-confidence-intervals-machine-learning-results-python... | pd.read_csv(output_dataset_dir / 'reconstruction.csv', index_col='participant_id') | pandas.read_csv |
import pandas as pd
import os
df = pd.DataFrame(columns=["Server-RSSI-1", "Server-RSSI-2", "Server-RSSI-3", "Square"])
point_df = pd.DataFrame(columns=["Server-RSSI-1", "Server-RSSI-2", "Server-RSSI-3", "Square", "Point"])
for root, dirs, files in os.walk("."):
group_id = 0
for filename in files:
with... | pd.DataFrame(columns=["Server-RSSI-1", "Server-RSSI-2", "Server-RSSI-3", "Square", "Point"]) | pandas.DataFrame |
import pandas as pd
import re
from collections import OrderedDict
import time
#This file has various helper functions. Checkout README for the flow.
def helper_input_snt_to_tkn(snt):
step1 = []
for token in snt.split(' '):
handled = False
if '-' in token:
subkns = token.split('-')
... | pd.DataFrame(data=result, columns=["id", "after"]) | pandas.DataFrame |
"""
Coding: UTF-8
Author: Randal
Time: 2021/2/20
E-mail: <EMAIL>
Description: This is a simple toolkit for data extraction of text.
The most important function in the script is about word frequency statistics.
Using re, I generalized the process in words counting, regardless of any preset
word segmentation. Besides, ... | pd.DataFrame.from_dict(strips, orient='index') | pandas.DataFrame.from_dict |
import pandas as pd
location="measure1.csv"
e= | pd.read_csv(location) | pandas.read_csv |
#Imports
import os, sys
import glob
import time, sched
from datetime import datetime
import numpy as np
import pandas as pd
import socket
import psycopg2
import subprocess
import pytz
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from bokeh.io import curdoc ... | pd.read_csv(self.DESI_Log.weather_file) | pandas.read_csv |
# import sys
# sys.path.append('JEMIPYC')
# from array_check_function_global import df,dfn,dfv,dfx,dfnx,dfvx
import pandas as pd
import numpy as np
tab = '__'
# no-extension , number of parameters is not limited, 2 or 3, whatever you want.
# ex) df(A,B,C,D,...,Z...)
# of course you just put one parameter.... | pd.set_option('display.max_rows', None) | pandas.set_option |
#!/usr/bin/env python
# coding: utf-8
# # Previous Applications
# ## About the data
# <blockquote>previous_application: This dataset has details of previous applications made by clients to Home Credit. Only those clients find place here who also exist in <i>application</i> data. Each current loan in the <i>applic... | pd.set_option('display.max_colwidth', -1) | pandas.set_option |
###########################################################################################################
## IMPORTS
###########################################################################################################
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import math
import numpy as np
import pand... | pd.DataFrame(history.history) | pandas.DataFrame |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
@version:
@author: zzh
@file: factor_earning_expectation.py
@time: 2019-9-19
"""
import pandas as pd
class FactorEarningExpectation():
"""
盈利预期
"""
def __init__(self):
__str__ = 'factor_earning_expectation'
self.name = '盈利预测'
... | pd.merge(factor_earning_expect, earning_expect, on='security_code') | 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... | tm.assert_frame_equal(res_just_na, exp_just_na) | pandas._testing.assert_frame_equal |
# pylint: disable=E1101
from datetime import datetime
import datetime as dt
import os
import warnings
import nose
import struct
import sys
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
from pandas.compat import iterkeys
from pandas.core.frame import DataFrame, Series
from pandas.c... | tm.assert_series_equal(expected, parsed_115["srh"]) | pandas.util.testing.assert_series_equal |
from datetime import datetime
import pandas as pd
import robin_stocks as r
import time
import logging
ETH_ID = "76637d50-c702-4ed1-bcb5-5b0732a81f48"
log = logging.getLogger(__name__)
class LstmDataManager:
data: pd.DataFrame = None
# Used for simulation only
end_index = None
def __init__(self, s... | pd.DataFrame(raw_data) | pandas.DataFrame |
"""Genetic evaluation of individuals."""
import os
import sys
# import time
from collections import Counter
from itertools import compress
from numba import njit
import pkg_resources
import numpy as np
import pandas as pd
import scipy.linalg
import scipy.stats
def example_data():
"""Provide data to... | pd.unique(info.gmap.iloc[:, 0]) | pandas.unique |
import pandas as pd
import sasoptpy as so
import requests
from subprocess import Popen, DEVNULL
# Solves the pre-season optimization problem
def get_data():
r = requests.get('https://fantasy.premierleague.com/api/bootstrap-static/')
fpl_data = r.json()
element_data = pd.DataFrame(fpl_data['elements'])
... | pd.merge(element_data, team_data, left_on='team', right_on='id') | pandas.merge |
"""
This file is part of Cytometer
Copyright 2021 Medical Research Council
SPDX-License-Identifier: Apache-2.0
Author: <NAME> <<EMAIL>>
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats as stats
# imports for sped up hdquantiles_sd
from numpy import float_, int_, ndarray
imp... | pd.DataFrame() | pandas.DataFrame |
import itertools as itt
import pathlib as pl
from configparser import ConfigParser
import joblib as jl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats as sst
import seaborn as sns
from statannot import add_stat_annotation
from src.visualization import fancy_plots as fplt
from... | pd.concat([R0, Tau]) | pandas.concat |
#!/usr/bin/env python
"""Tests for `specl` package."""
from functools import reduce
import os
import pytest
from unittest.mock import patch, mock_open
import numpy as np
import pandas as pd
from hypothesis import given, settings
from hypothesis.strategies import sampled_from
from hypothesis.extra import pandas as hpd... | pd.DataFrame(data={'A': [1, np.nan, 5], 'B': [3, np.nan, np.nan]}) | pandas.DataFrame |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
# In[2]:
# Load the training, additional, confidence, and test data
train_data = pd.read_csv('training.csv')
test_data = pd.read_csv('testing.csv')
additional_data = pd.read_csv('additional_training.csv')
confidence = pd.read_c... | pd.DataFrame({'ID': test_data.ID, 'prediction': log_df['prediction']}) | pandas.DataFrame |
import os
import warnings
import pandas as pd
from .. import make_canon_dataset
TEST_FP = os.path.dirname(os.path.abspath(__file__))
DATA_FP = os.path.join(TEST_FP, 'data', 'processed')
def test_read_records(tmpdir):
result = make_canon_dataset.read_records(
os.path.join(DATA_FP, 'crash_joined.json'),
... | pd.testing.assert_frame_equal(result, expected, check_dtype=False) | pandas.testing.assert_frame_equal |
#!/usr/bin/env python
# coding: utf-8
# # Prepare SpaceNet 7 Data for Model Testing
#
# This Python script does the data processing steps (but not the visualization steps) from the ../notebooks/sn7_data_prep.ipynb notebook. It takes the input file location as an argument.
# In[ ]:
import multiprocessing
import p... | pd.DataFrame({'image': im_list, 'label': mask_list}) | pandas.DataFrame |
#########
#File: c:\Users\digan\Dropbox\Dynamic_Networks\repos\ScoreDrivenExponentialRandomGraphs\_research\analysis_for_paper_revision\applic_reddit\0_load_reddit_pre_process.py
#Created Date: Tuesday May 4th 2021
#Author: <NAME>, <<EMAIL>>
#-----
#Last Modified: Thursday May 6th 2021 1:46:42 pm
#Modified By: <NAME>... | pd.concat((df_orig.source, df_orig.target)) | pandas.concat |
# Script to convert labels into categories based on arguments
import argparse
import numpy as np
import pandas as pd
import csv
# Example command: python3 convertHistoneLabels.py --cell_file data/Cell1.test.csv --output_file Cell1Conv.test.csv
# python3 convertHistoneLabels.py --cell_file data/Cell1.test.csv --output... | pd.DataFrame({"hm1": cell1_hm_df["hm1"] - cell2_hm_df["hm1"], "hm2": cell1_hm_df["hm2"] - cell2_hm_df["hm2"], "hm3": cell1_hm_df["hm3"] - cell2_hm_df["hm3"], "hm4": cell1_hm_df["hm4"] - cell2_hm_df["hm4"], "hm5": cell1_hm_df["hm5"] - cell2_hm_df["hm5"]}) | pandas.DataFrame |
import pandas as pd
import numpy as np
import tensorflow as tf
import os, pickle
class Reader(object):
def read(self, data_path):
self.read_data()
self.merge_id()
self.add_reverse()
if self.args.reindex:
self.reindex_kb()
self.gen_t_label()
... | pd.read_csv(path + 'valid.txt', header=None, sep='\t', names=['h', 'r', 't']) | pandas.read_csv |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Country data of B.1.1.7 occurrence.
Function: get_country_data().
@author: @hk_nien
"""
import re
from pathlib import Path
import pandas as pd
import datetime
import numpy as np
def _ywd2date(ywd):
"""Convert 'yyyy-Www-d' string to date (12:00 on that day)."""
... | pd.DataFrame.from_records(records[2:], columns=['sample_date', 'f_b117']) | pandas.DataFrame.from_records |
"""
Wrapper Module to generate molecular descriptors by using other packages
"""
import math
import numpy as np
import os
import pandas as pd
from abc import ABC, abstractmethod
from rdkit import Chem
from rdkit.Chem import AllChem, MACCSkeys
import rdkit.Chem.rdmolops as rdmolops
import rdkit.Chem.rdMolDescriptors a... | pd.DataFrame(desc_dict, index=[0]) | pandas.DataFrame |
"""
Copyright 2018 <NAME>.
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distribut... | pd.to_datetime(df.date) | pandas.to_datetime |
# Copyright (c) 2016-2019, Broad Institute, Inc. All rights reserved.
#
# 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 co... | pandas.DataFrame(matrix, index=labels, columns=labels) | pandas.DataFrame |
#!/usr/bin/env python
# coding: utf-8
# In[24]:
import pandas as pd
import numpy as np
import json
import zipfile
import matplotlib.pyplot as plt
import seaborn as sns
import re
import nltk
import string
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import CountVectorizer
from textblob imp... | pd.read_json('rotten-tomatoes.json.gz', orient='record', lines=True) | pandas.read_json |
"""
Provides helper routines for preprocessing.
"""
# License: MIT
from __future__ import absolute_import, division
import numpy as np
import pandas as pd
import scipy.optimize as so
import scipy.stats as ss
from .validation import (is_integer, is_pandas_dataframe,
is_pandas_series)
def ... | pd.infer_freq(data.index) | pandas.infer_freq |
import os
import glob
import numpy as np
import pylab as pl
import scipy.io as sio
# for_Jyotika.m
from copy import copy, deepcopy
import pickle
import matplotlib.cm as cm
import pdb
import h5py
import pandas as pd
import bct
from collections import Counter
import matplotlib.cm as cm
import sys
import seaborn as sns
i... | pd.read_csv(data_dir+"graph_properties_pandas_null_all.csv") | pandas.read_csv |
#!/home/wli/env python3
# -*- coding: utf-8 -*-
"""
Title: wsi visualization
=================================
Created: 10-31-2019
Python-Version: 3.5
Description:
------------
This module is used to view the WSI, its mask and heatmap overlay.
Note:
-----
The level of display resolution depends on the memory of the ... | pd.DataFrame(df_xml) | pandas.DataFrame |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017 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 pandas as pd
from numpy impo... | pd.Series() | pandas.Series |
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... | tm.assert_frame_equal(result, expected) | pandas._testing.assert_frame_equal |
#import seaborn as sns
#import matplotlib.pyplot as plt
#import matplotlib.axes as ax
#import sklearn
#from sklearn.linear_model import LinearRegression
#from sklearn import datasets, linear_model
#from scipy.optimize import curve_fit
#import os
#import collections
#from statsmodels.stats.outliers_influence import summ... | pd.concat([DataTrain, DataTrain2]) | pandas.concat |
import pandas as pd
import numpy as np
import os
import json
DATA_DIR = "data/"
FILE_NAME = "data.csv"
FINAL_DATA = "rearranged_data.xlsx"
DATA_SPECS = "data_specs.json"
with open(DATA_SPECS, 'r') as f:
DATA_SPECS_DICT = json.load(f)
# Load data
df = pd.read_csv(os.path.join(DATA_DIR, FILE_NAME), delimiter=";")
... | pd.isnull(df["SERIAL"]) | pandas.isnull |
import pandas as pd
import scipy.signal as scisig
import os
import numpy as np
def get_user_input(prompt):
try:
return raw_input(prompt)
except NameError:
return input(prompt)
def getInputLoadFile():
'''Asks user for type of file and file path. Loads corresponding data.
OUTPUT:
... | pd.to_datetime(data['Timestamp'], unit='ms') | pandas.to_datetime |
from imutils import face_utils
import dlib
import cv2
import numpy
import sys
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
# default solver is incredibly slow which is why it was changed to 'lbfgs'.
logisti... | pd.DataFrame([vect]) | pandas.DataFrame |
import pandas
import numpy as np
from statsmodels.tools import data
def test_missing_data_pandas():
"""
Fixes GH: #144
"""
X = np.random.random((10,5))
X[1,2] = np.nan
df = | pandas.DataFrame(X) | pandas.DataFrame |
# %% [markdown]
# ##
import warnings
def noop(*args, **kargs):
pass
warnings.warn = noop
import os
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy
import seaborn as sns
from joblib import Parallel, delayed
from scipy.ndimage import gaussi... | pd.DataFrame(rows) | pandas.DataFrame |
from flask import Flask
from flask import request
from flask import jsonify
import pandas as pd
import numpy as np
import scipy.spatial
app = Flask(__name__)
@app.route('/flask', methods = ['POST'])
def index():
content = request.get_json()
#print(content)
user = content['user']
orgDF = | pd.json_normalize(content, record_path='orgs') | pandas.json_normalize |
import requests
from bs4 import BeautifulSoup as soup
import pandas as pd
import gspread
from gspread_dataframe import set_with_dataframe
print("Modules imported without an error.")
# sending request to the url
data = requests.get(
"https://en.wikipedia.org/wiki/Template:COVID-19_pandemic_data/India_med... | pd.DataFrame(columns=columnstates) | pandas.DataFrame |
#%% [markdown]
# # MASE and alignment
# Investigating the use of MASE as a method for joint embedding, and the effects of
# different alignment techniques
#%% [markdown]
# ## Preliminaries
#%%
import datetime
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from ... | pd.concat((mase_results, ase_results), ignore_index=True) | pandas.concat |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.