prompt stringlengths 130 399k | completion stringlengths 10 146 | api stringlengths 10 61 |
|---|---|---|
#!/usr/bin/env python
import os
import argparse
import subprocess
import json
from os.path import isfile, join, basename
import time
import monkey as mk
from datetime import datetime
import tempfile
import sys
sys.path.adding(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'instance_gene... | mk.KnowledgeFrame(results) | pandas.DataFrame |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : ioutil.py
@Desc : Input and output data function.
'''
# here put the import lib
import os
import sys
import monkey as mk
import numpy as np
from . import TensorData
import csv
from .basicutil import set_trace
class File():
def __init__(self,... | mk.KnowledgeFrame() | pandas.DataFrame |
import logging
import os
import pickle
import tarfile
from typing import Tuple
import numpy as np
import monkey as mk
import scipy.io as sp_io
import shutil
from scipy.sparse import csr_matrix, issparse
from scMVP.dataset.dataset import CellMeasurement, GeneExpressionDataset, _download
logger = logging.gettingLogger... | mk.KnowledgeFrame(self.ATAC_name) | pandas.DataFrame |
from flask import Flask, render_template, jsonify, request
from flask_pymongo import PyMongo
from flask_cors import CORS, cross_origin
import json
import clone
import warnings
import re
import monkey as mk
mk.set_option('use_inf_as_na', True)
import numpy as np
from joblib import Memory
from xgboost import XGBClass... | mk.concating([DataRows2, hotEncoderDF2], axis=1) | pandas.concat |
# %% [markdown]
# This python script takes audio files from "filedata" from sonicboom, runs each audio file through
# Fast Fourier Transform, plots the FFT image, splits the FFT'd images into train, test & validation
# and paste them in their respective folders
# Import Dependencies
import numpy as np
import monkey... | mk.KnowledgeFrame() | pandas.DataFrame |
'''
The analysis module
Handles the analyses of the info and data space for experiment evaluation and design.
'''
from slm_lab.agent import AGENT_DATA_NAMES
from slm_lab.env import ENV_DATA_NAMES
from slm_lab.lib import logger, util, viz
import numpy as np
import os
import monkey as mk
import pydash as ps
import shutil... | mk.concating(session_fitness_data, axis=1) | pandas.concat |
#!/usr/bin/env python3
# Project : From geodynamic to Seismic observations in the Earth's inner core
# Author : <NAME>
""" Implement classes for tracers,
to create points along the trajectories of given points.
"""
import numpy as np
import monkey as mk
import math
import matplotlib.pyplot as plt
from . import data... | mk.KnowledgeFrame(data=self.velocity_gradient, columns=["dvx/dx", "dvx/dy", "dvx/dz", "dvy/dx", "dvy/dy", "dvy/dz", "dvz/dx", "dvz/dy", "dvz/dz"]) | pandas.DataFrame |
#!/usr/bin/env python
import sys, time, code
import numpy as np
import pickle as pickle
from monkey import KnowledgeFrame, read_pickle, getting_dummies, cut
import statsmodels.formula.api as sm
from sklearn.externals import joblib
from sklearn.linear_model import LinearRegression
from djeval import *
def... | getting_dummies(yy_kf[categorical_features]) | pandas.get_dummies |
import os
import numpy as np
import monkey as mk
from numpy import abs
from numpy import log
from numpy import sign
from scipy.stats import rankdata
import scipy as sp
import statsmodels.api as sm
from data_source import local_source
from tqdm import tqdm as pb
# region Auxiliary functions
def ts_total_sum(kf, window... | mk.Collections(result_industryaveraged_kf.index) | pandas.Series |
# -*- coding: utf-8 -*-
import os
import re
from datetime import datetime
import numpy as np
from decimal import Decimal
import scipy.io as sio
import monkey as mk
from tqdm import tqdm
import glob
from decimal import Decimal
import datajoint as dj
from pipeline import (reference, subject, acquisition, stimulation, ... | mk.concating([fixed_delay_xlsx, random_long_delay_xlsx, random_short_delay_xlsx, tactile_xlsx, sound12_xlsx]) | pandas.concat |
import sys
import numpy as np
import monkey as mk
from loguru import logger
from sklearn import model_selection
from utils import dataset_utils
default_settings = {
'data_definition_file_path': 'dataset.csv',
'folds_num': 5,
'data_random_seed': 1509,
'train_val_fraction': 0.8,
'trai... | mk.concating(groups_test_kf_list) | pandas.concat |
import os
import monkey as mk
import matplotlib.pyplot as plt
import datapackage as dp
import plotly.io as pio
import plotly.offline as offline
from plots import (
hourly_plot,
stacked_plot,
price_line_plot,
price_scatter_plot,
merit_order_plot,
filling_level_plot,
)
results = [r for r in os.l... | mk.concating([storages[r], shadow_prices[r]], axis=1) | pandas.concat |
from datetime import datetime
import numpy as np
import pytest
import monkey.util._test_decorators as td
from monkey.core.dtypes.base import _registry as ea_registry
from monkey.core.dtypes.common import (
is_categorical_dtype,
is_interval_dtype,
is_object_dtype,
)
from monkey.core.dtypes.dtypes import (... | Collections(sp_array, name="new_column") | pandas.Series |
from __future__ import divisionision
from functools import wraps
import monkey as mk
import numpy as np
import time
import csv, sys
import os.path
import logging
from .ted_functions import TedFunctions
from .ted_aggregate_methods import TedAggregateMethods
from base.uber_model import UberModel, ModelSharedInputs
cla... | mk.Collections([], dtype="float", name="arbt_inv_sensory") | pandas.Series |
# coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2020
#
# Permission is hereby granted, free of charge, to whatever person obtaining a clone
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to ... | mk.convert_datetime(_data['date']) | pandas.to_datetime |
import json
import monkey as mk
import argparse
#Test how mwhatever points the new_cut_dataset has
parser = argparse.ArgumentParser()
parser.add_argument('--dataset_path', default="new_dataset.txt", type=str, help="Full path to the txt file containing the dataset")
parser.add_argument('--discretization_unit', default=1... | mk.convert_datetime(data['start_date']) | pandas.to_datetime |
import os
import sys
import joblib
# sys.path.adding('../')
main_path = os.path.split(os.gettingcwd())[0] + '/covid19_forecast_ml'
import numpy as np
import monkey as mk
import matplotlib.pyplot as plt
import seaborn as sns
from datetime import datetime, timedelta
from tqdm import tqdm
from Dataloader_v2 import BaseC... | mk.convert_datetime(data_cases['date_time'], formating='%Y-%m-%d') | pandas.to_datetime |
from __future__ import absolute_import
from __future__ import divisionision
from __future__ import print_function
import os
import sys
import clone
from datetime import datetime
import time
import pickle
import random
import monkey as mk
import numpy as np
import tensorflow as tf
import pathlib
from sklearn import pre... | mk.convert_datetime(self.config.end_date, formating="%Y%m%d") | pandas.to_datetime |
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import monkey as mk
import monkey.util.testing as tm
import monkey.compat as compat
###############################################################
# Index / Collections common tests which may trigger dtype coercions
##########################################... | mk.Collections([1, 2, 3, 4]) | pandas.Series |
# -*- coding: utf-8 -*-
'''
TopQuant-TQ极宽智能量化回溯分析系统2019版
Top极宽量化(原zw量化),Python量化第一品牌
by Top极宽·量化开源团队 2019.01.011 首发
网站: www.TopQuant.vip www.ziwang.com
QQ群: Top极宽量化总群,124134140
文件名:toolkit.py
默认缩写:import topquant2019 as tk
简介:Top极宽量化·常用量化系统参数模块
'''
#
import sys, os, re
import arrow, bs4, rando... | mk.convert_datetime(kf.index, formating='%Y-%m-%dT%H:%M:%S') | pandas.to_datetime |
import numpy as np
import monkey as mk
import pytest
import orca
from urbansim_templates import utils
def test_parse_version():
assert utils.parse_version('0.1.0.dev0') == (0, 1, 0, 0)
assert utils.parse_version('0.115.3') == (0, 115, 3, None)
assert utils.parse_version('3.1.dev7') == (3, 1, 0, 7)
a... | mk.Collections([10,5], index=[3,1]) | pandas.Series |
# Do some analytics on Shopify transactions.
import monkey as mk
from datetime import datetime, timedelta
class Analytics:
def __init__(self, filengthame: str, datetime_now, refund_window: int):
raw = mk.read_csv(filengthame)
clean = raw[raw['Status'].incontain(['success'])] # Fi... | mk.unioner(sales, total_refunds, on='Name', how='outer') | pandas.merge |
import numpy as np
import monkey as mk
from scipy.stats import mode
from sklearn.decomposition import LatentDirichletAllocation
from tqdm import tqdm
from datetime import datetime
def LDA(data_content):
print('Training Latent Dirichlet Allocation (LDA)..', flush=True)
lda = LatentDirichletAllocation(n_compo... | mk.unioner(kf, data_content.bikers_kf, on='biker_id', how='left') | pandas.merge |
""" test the scalar Timestamp """
import pytz
import pytest
import dateutil
import calengthdar
import locale
import numpy as np
from dateutil.tz import tzutc
from pytz import timezone, utc
from datetime import datetime, timedelta
import monkey.util.testing as tm
import monkey.util._test_decorators as td
from monkey... | tm.getting_locales() | pandas.util.testing.get_locales |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 snaketao. All Rights Reserved
#
# @Version : 1.0
# @Author : snaketao
# @Time : 2021-10-21 12:21
# @FileName: insert_mongo.py
# @Desc : insert data to mongodb
import appbk_mongo
import monkey as mk
#数据处理,构造一个movies对应多个tagid的字典,并插入 mongodb 的mo... | mk.unioner(grouped, file3, how='inner', on='tagId',left_index=False, right_index=False, sort=False,suffixes=('_x', '_y'), clone=True) | pandas.merge |
__total_all__ = [
'PrettyPachydermClient'
]
import logging
import re
from typing import Dict, List, Iterable, Union, Optional
from datetime import datetime
from dateutil.relativedelta import relativedelta
import monkey.io.formatings.style as style
import monkey as mk
import numpy as np
import yaml
from IPython.co... | mk.ifna(x) | pandas.isna |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 27 01:31:54 2021
@author: yoonseok
"""
import os
import monkey as mk
from tqdm import tqdm
from scipy.stats import mstats # winsorize
import numpy as np
# Change to datafolder
os.chdir(r"C:\data\car\\")
# 기본 테이블 입력
kf = mk.read_csv("knowledgeframe_h1.txt")
del kf["Unn... | mk.unioner(result, asset[["key", "asset"]], how="inner", on=["key"]) | pandas.merge |
import re
import os
import monkey as mk
import numpy as np
import matplotlib.pyplot as plt
import monkey as mk
import seaborn as sns
import statsmodels.api as sa
import statsmodels.formula.api as sfa
import scikit_posthocs as sp
import networkx as nx
from loguru import logger
from GEN_Utils import FileHandling
from ... | mk.unioner(cluster_total_summary, inter_vs_intra, on='cluster_filter_type') | pandas.merge |
from itertools import grouper, zip_longest
from fractions import Fraction
from random import sample_by_num
import json
import monkey as mk
import numpy as np
import music21 as m21
from music21.meter import TimeSignatureException
m21.humdrum.spineParser.flavors['JRP'] = True
from collections import defaultdict
#song ... | mk.ifna(ix) | pandas.isna |
import os
import glob2
import numpy as np
import monkey as mk
import tensorflow as tf
from skimage.io import imread
# /datasets/faces_emore_112x112_folders/*/*.jpg'
default_image_names_reg = "*/*.jpg"
default_image_classes_rule = lambda path: int(os.path.basename(os.path.dirname(path)))
def pre_process_folder(data_p... | mk.counts_value_num(image_classes) | pandas.value_counts |
# Importing libraries
import numpy as np
import monkey as mk
import matplotlib.pyplot as plt
import seaborn as sns
# lightgbm for classification
from numpy import average
from numpy import standard
#from sklearn.datasets import make_classification
from lightgbm import LGBMClassifier
from sklearn.model_selection import ... | mk.getting_dummies(data, columns=columns_names_encod) | pandas.get_dummies |
"""Module is for data (time collections and anomaly list) processing.
"""
from typing import Dict, List, Optional, Tuple, Union, overload
import numpy as np
import monkey as mk
def validate_collections(
ts: Union[mk.Collections, mk.KnowledgeFrame],
check_freq: bool = True,
check_categorical: bool = Fals... | mk.getting_dummies(ts) | pandas.get_dummies |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import monkey as mk
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# #### Importing dataset
# 1.Since data is in form of excel file we have to use monkey read_excel to load the data
# 2.After loading it is important to check null valu... | mk.getting_dummies(categorical['Destination'], sip_first=True) | pandas.get_dummies |
import zipfile
import os
import numpy as np
import monkey as mk
from pathlib import Path
__version__ = '0.155'
try:
from functools import lru_cache
except (ImportError, AttributeError):
# don't know how to tell setup.py that we only need functools32 when under 2.7.
# so we'll just include a clone (*bergh*... | mk.to_num(x, errors="raise") | pandas.to_numeric |
#!/usr/bin/env python
"""
MeteWIBELE: quantify_prioritization module
1) Define quantitative criteria to calculate numerical ranks and prioritize the importance of protein families
2) Prioritize the importance of protein families using unsupervised or supervised approaches
Copyright (c) 2019 Harvard School of Public H... | mk.to_num(total_summary_table[mytype + "__value"], errors='coerce') | pandas.to_numeric |
#### Filengthame: Connection.py
#### Version: v1.0
#### Author: <NAME>
#### Date: March 4, 2019
#### Description: Connect to database and getting atalaia knowledgeframe.
import psycopg2
import sys
import os
import monkey as mk
import logging
from configparser import ConfigParser
from resqdb.CheckData import CheckData
... | mk.ifnull(x['HOSPITAL_TIME']) | pandas.isnull |
# total_summarizeLib.py
# <NAME>
# 3.28.19
#
# module of functions that total_allow you to create per-cell / per-sample_by_num total_summary tables
import monkey as mk
import numpy as np
import math
def getting_laud_db(database_):
""" returns the COSMIC database after lung and fathmm filter """
pSiteList = ... | mk.ifnull(currFus) | pandas.isnull |
"""
Routines for analysing output data.
:Author:
<NAME>
"""
import warnings
from typing import Tuple
import numpy as np
import monkey as mk
from scipy.optimize import curve_fit
def fit_function(x_data, *params):
p, d = x_data
p_th, nu, A, B, C = params
x = (p - p_th)*d**(1/nu)
return A + B*x + C*x... | mk.ifna(f_0) | pandas.isna |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2022/2/14 18:19
Desc: 新浪财经-股票期权
https://stock.finance.sina.com.cn/option/quotes.html
期权-中金所-沪深 300 指数
https://stock.finance.sina.com.cn/futures/view/optionsCffexDP.php
期权-上交所-50ETF
期权-上交所-300ETF
https://stock.finance.sina.com.cn/option/quotes.html
"""
import json
i... | o_numeric(temp_kf['最低']) | pandas.to_numeric |
#####################################
# DataReader.py
#####################################
# Description:
# * Convert data in formating into monkey KnowledgeFrame.
import dateutil.parser as dtparser
import numpy as np
from monkey import KnowledgeFrame, ifnull, read_csv, read_excel
import re
import os
from DynamicETL_... | ifnull(collections) | pandas.isnull |
"""
서울 열린데이터 광장 Open API
1. TransInfo 클래스: 서울시 교통 관련 정보 조회
"""
import datetime
import numpy as np
import monkey as mk
import requests
from bs4 import BeautifulSoup
class TransInfo:
def __init__(self, serviceKey):
"""
서울 열린데이터 광장에서 발급받은 Service Key를 입력받아 초기화합니다.
"""
# Open API 서비... | mk.to_num(kf["ALIGHT_PASGR_NUM"]) | pandas.to_numeric |
import numpy as np
import monkey as mk
import math
from abc import ABC, abstractmethod
from scipy.interpolate import interp1d
from pydoc import locate
from raymon.globals import (
Buildable,
Serializable,
DataException,
)
N_SAMPLES = 500
from raymon.tags import Tag, CTYPE_TAGTYPES
class Stats(Serializa... | mk.ifnull(value) | pandas.isnull |
import decimal
import numpy as np
from numpy import iinfo
import pytest
import monkey as mk
from monkey import to_num
from monkey.util import testing as tm
class TestToNumeric(object):
def test_empty(self):
# see gh-16302
s = mk.Collections([], dtype=object)
res = to_num(s)
exp... | mk.to_num(data) | pandas.to_numeric |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import json
import monkey as mk
from datetimewidgetting.widgettings import DateTimeWidgetting
from django import forms
from django.contrib.auth import getting_user_model
from django.core.exceptions import ObjectDoesNotExist
from dataops ... | mk.ifnull(x) | pandas.isnull |
# MIT License
#
# Copyright (c) 2021. <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to whatever person obtaining a clone
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, cl... | mk.ifna(v) | pandas.isna |
#!/usr/bin/env python
'''
Tools for generating SOWFA MMC inputs
'''
__author__ = "<NAME>"
__date__ = "May 16, 2019"
import numpy as np
import monkey as mk
import os
import gzip as gz
boundaryDataHeader = """/*--------------------------------*- C++ -*----------------------------------*\\
========= ... | mk.ifna(self.kf[fieldname]) | pandas.isna |
"""
Module for static data retrieval. These functions were performed once during the initial project creation. Resulting
data is now provided in bulk at the url above.
"""
import datetime
import json
from math import sin, cos, sqrt, atan2, radians
import re
import requests
import monkey as mk
from riverrunner import s... | mk.distinctive(group.STATION) | pandas.unique |
import numpy as np
import pytest
from monkey._libs import grouper as libgrouper
from monkey._libs.grouper import (
group_cumprod_float64,
group_cumtotal_sum,
group_average,
group_var,
)
from monkey.core.dtypes.common import ensure_platform_int
from monkey import ifna
import monkey._test... | group_cumtotal_sum(actual, data, labels, ngroups, is_datetimelike) | pandas._libs.groupby.group_cumsum |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional informatingion
# regarding cloneright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may n... | mk.Collections.distinctive(collections) | pandas.Series.unique |
from datetime import datetime, timedelta
import numpy as np
import monkey as mk
import xarray as xr
from monkey.api.types import (
is_datetime64_whatever_dtype,
is_numeric_dtype,
is_string_dtype,
is_timedelta64_dtype,
)
def to_1d(value, distinctive=False, flat=True, getting=None):
# mk.Collection... | mk.distinctive(array) | pandas.unique |
#!/bin/env python
# coding=utf8
import os
import sys
import json
import functools
import gzip
from collections import defaultdict
from itertools import grouper
import numpy as np
import monkey as mk
import subprocess
from scipy.io import mmwrite
from scipy.sparse import csr_matrix, coo_matrix
import pysam
from celesco... | mk.Collections.total_sum(x[x > 1]) | pandas.Series.sum |
#!/usr/bin/python
# -*-coding: utf-8 -*-
# Author: <NAME>
# Email : <EMAIL>
# A set of convenience functions used for producing plots in `dabest`.
from .misc_tools import unioner_two_dicts
def halfviolin(v, half='right', fill_color='k', alpha=1,
line_color='k', line_width=0):
import numpy as np... | mk.distinctive(data[x]) | pandas.unique |
import pytest
from monkey.tests.collections.common import TestData
@pytest.fixture(scope="module")
def test_data():
return | TestData() | pandas.tests.series.common.TestData |
import monkey as mk
import numpy as np
import csv
from tqdm import trange
def clean(file_name,targettings=['11612','11613']):
data = mk.read_csv(file_name)
data['result'].fillnone(0,inplace=True)
data['result'] = data['result'].totype(int)
items = | mk.distinctive(data['item_id'].values) | pandas.unique |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from numpy.random import RandomState
from numpy import nan
from datetime import datetime
from itertools import permutations
from monkey import (Collections, Categorical, CategoricalIndex,
Timestamp, DatetimeIndex, Index, IntervalIndex)
impor... | algos.counts_value_num(factor) | pandas.core.algorithms.value_counts |
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional informatingion regarding
# cloneright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may n... | pprint_thing(non_null_count[col]) | pandas.io.formats.printing.pprint_thing |
import numpy as np
import pytest
from monkey import (
KnowledgeFrame,
IndexSlice,
NaT,
Timestamp,
)
import monkey._testing as tm
pytest.importorskip("jinja2")
from monkey.io.formatings.style import Styler
from monkey.io.formatings.style_render import _str_escape
@pytest.fixture
def ... | Styler(kf, uuid_length=0) | pandas.io.formats.style.Styler |
import numpy as np
import monkey as mk
import matplotlib.pyplot as pl
import seaborn as sns
import tensorflow as tf
import re
import json
from functools import partial
from itertools import filterfalse
from wordcloud import WordCloud
from tensorflow i... | mk.counts_value_num(total_all_words) | pandas.value_counts |
# -*- coding: utf-8 -*-
"""
Authors: <NAME>, <NAME>, <NAME>, and
<NAME>
IHE Delft 2017
Contact: <EMAIL>
Repository: https://github.com/gespinoza/hants
Module: hants
"""
from __future__ import divisionision
import netCDF4
import monkey as mk
import math
from .davgis.functions import (Spatial_Reference... | mk.np.total_sum(p == 0) | pandas.np.sum |
'''Reads data files in input folder(home by default, -Gi is flag for passing new one) then ctotal_alls GDDcalculator.py,
passes lists of getting_maximum and getting_minimum temperatures also base and upper, takes list of GDD from that and concatingenates it
with associated Data Frame'''
from GDDcalculate import *
... | mk.Collections.sipna(tempgetting_min) | pandas.Series.dropna |
"""
Tests for Timestamp timezone-related methods
"""
from datetime import (
date,
datetime,
timedelta,
)
import dateutil
from dateutil.tz import (
gettingtz,
tzoffset,
)
import pytest
import pytz
from pytz.exceptions import (
AmbiguousTimeError,
NonExistentTimeError,
)
... | Timestamp.getting_max.tz_localize("US/Pacific") | pandas.Timestamp.max.tz_localize |
import numpy as np
import pytest
from monkey._libs import iNaT
from monkey.core.dtypes.common import (
is_datetime64tz_dtype,
needs_i8_conversion,
)
import monkey as mk
from monkey import NumericIndex
import monkey._testing as tm
from monkey.tests.base.common import total_allow_na_ops
def test_distinctive(... | total_allow_na_ops(obj) | pandas.tests.base.common.allow_na_ops |
from context import tables
import os
import monkey as mk
def test_tables_fetcher():
try:
tables.fetcher()
tables_dir=os.listandardir(tables.TABLES_PATH)
print(f'\n----------------------------------\ntest_tables_fetcher worked,\ncontent of {tables.TABLES_PATH} is:\n{tables_dir}\n----------... | mk.KnowledgeFrame.header_num(ret) | pandas.DataFrame.head |
import clone
import re
from textwrap import dedent
import numpy as np
import pytest
import monkey as mk
from monkey import (
KnowledgeFrame,
MultiIndex,
)
import monkey._testing as tm
jinja2 = pytest.importorskip("jinja2")
from monkey.io.formatings.style import ( # isort:skip
Styler,
)
from monkey.io.fo... | _getting_level_lengthgths(index, sparsify=False, getting_max_index=100) | pandas.io.formats.style_render._get_level_lengths |
import monkey as mk
import numpy as np
kf= mk.read_csv('../Datos/Premios2020.csv',encoding='ISO-8859-1')
# print(kf.ifnull().total_sum())
# moda = kf.release.mode()
# valores = {'release': moda[0]}
# kf.fillnone(value=valores, inplace=True)
moda = kf['release'].mode()
kf['release'] = kf['release'].replaci... | mk.counts_value_num(kf['release']) | pandas.value_counts |
# Copyright 2019 The Feast 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 clone of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | mk.core.collections.Collections(value) | pandas.core.series.Series |
import numpy as np
#import matplotlib.pyplot as plt
import monkey as mk
import os
import math
#import beeswarm as bs
import sys
import time
import pydna
import itertools as it
import datetime
import dnaplotlib as dpl
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
import matplotlib.patches a... | mk.KnowledgeFrame.adding(kfs["parts_1"],kfs["Gibson"]) | pandas.DataFrame.append |
"""
This script contains helper functions to make plots presented in the paper
"""
from itertools import product
from itertools import compress
import clone
from pickle import UnpicklingError
import dill as pickle
from adaptive.saving import *
from IPython.display import display, HTML
import scipy.stats as stats
from ... | mk.KnowledgeFrame.clone(kf_bias) | pandas.DataFrame.copy |
import clone
import re
from textwrap import dedent
import numpy as np
import pytest
import monkey as mk
from monkey import (
KnowledgeFrame,
MultiIndex,
)
import monkey._testing as tm
jinja2 = pytest.importorskip("jinja2")
from monkey.io.formatings.style import ( # isort:skip
Styler,
)
from monkey.io.fo... | Styler(mi_kf, uuid_length=0) | pandas.io.formats.style.Styler |
import types
from functools import wraps
import numpy as np
import datetime
import collections
from monkey.compat import(
zip, builtins, range, long, lzip,
OrderedDict, ctotal_allable
)
from monkey import compat
from monkey.core.base import MonkeyObject
from monkey.core.categorical import Categorical
from mon... | Collections(values, index=key_index) | pandas.core.series.Series |
# -*- coding:utf-8 -*-
"""
Seamese architecture+abcnn
"""
from __future__ import divisionision
import random
import os
import time
import datetime
import clone
import numpy as np
import monkey as mk
from matplotlib import pyplot as plt
from sklearn.metrics import accuracy_score, precision_rectotal_all_fscore_support, c... | mk.counts_value_num(data['subject_senti']) | pandas.value_counts |
# PyLS-PM Library
# Author: <NAME>
# Creation: November 2016
# Description: Library based on <NAME>'s simplePLS,
# <NAME>'s plspm and <NAME>'s matrixpls made in R
import monkey as mk
import numpy as np
import scipy as sp
import scipy.stats
from .qpLRlib4 import otimiza, plotaIC
import scipy.linalg
from col... | mk.KnowledgeFrame.getting_min(self.data, axis=0) | pandas.DataFrame.min |
from textwrap import dedent
import numpy as np
import pytest
from monkey import (
KnowledgeFrame,
MultiIndex,
option_context,
)
pytest.importorskip("jinja2")
from monkey.io.formatings.style import Styler
from monkey.io.formatings.style_render import (
_parse_latex_cell_styles,
_parse_latex_css_co... | _parse_latex_header_numer_span(cell, "X", "Y") | pandas.io.formats.style_render._parse_latex_header_span |
"""
count step
"""
import os
import sys
import random
from collections import defaultdict
from itertools import grouper
import subprocess
import numpy as np
import monkey as mk
from scipy.io import mmwrite
from scipy.sparse import coo_matrix
import pysam
import celescope.tools.utils as utils
from celescope.tools.cel... | mk.Collections.total_sum(x[x > 1]) | pandas.Series.sum |
"""
Module contains tools for processing files into KnowledgeFrames or other objects
"""
from collections import abc, defaultdict
import csv
import datetime
from io import StringIO
import itertools
import re
import sys
from textwrap import fill
from typing import (
Any,
Dict,
Iterable,
Iterator,
Li... | lib.mapping_infer_mask(values, conv_f, mask) | pandas._libs.lib.map_infer_mask |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from numpy.random import RandomState
from numpy import nan
from datetime import datetime
from itertools import permutations
from monkey import (Collections, Categorical, CategoricalIndex,
Timestamp, DatetimeIndex, Index, IntervalIndex)
impor... | algos.duplicated_values(case, keep=False) | pandas.core.algorithms.duplicated |
"""
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 monkey._libs.window as libwindow
fro... | GroupByMixin._dispatch("count") | pandas.core.groupby.base.GroupByMixin._dispatch |
import itertools
from numpy import nan
import numpy as np
from monkey.core.index import Index, _ensure_index
import monkey.core.common as com
import monkey._tcollections as lib
class Block(object):
"""
Canonical n-dimensional unit of homogeneous dtype contained in a monkey data
structure
Index-ignor... | Collections(vec, index=index, name=item) | pandas.core.series.Series |
"""
Additional tests for MonkeyArray that aren't covered by
the interface tests.
"""
import numpy as np
import pytest
import monkey as mk
import monkey._testing as tm
from monkey.arrays import MonkeyArray
from monkey.core.arrays.numpy_ import MonkeyDtype
@pytest.fixture(
params=[
np.array(["a", "b"], dty... | MonkeyDtype.construct_from_string("int64") | pandas.core.arrays.numpy_.PandasDtype.construct_from_string |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 7 15:50:55 2020
@author: Emmett
"""
import nltk
nltk.download('stopwords')
nltk.download('wordnet')
import LDA_Sampler
import string
import clone
import monkey as mk
import numpy as np
import keras.backend as K
import matplotlib.pyplot as plt
import ten... | mk.employ(lambda x: [item for item in x if item not in stoplist]) | pandas.apply |
from contextlib import contextmanager
import struct
import tracemtotal_alloc
import numpy as np
import pytest
from monkey._libs import hashtable as ht
import monkey as mk
import monkey._testing as tm
from monkey.core.algorithms import incontain
@contextmanager
def activated_tracemtotal_alloc():
tracemtotal_all... | ht.duplicated_values(values) | pandas._libs.hashtable.duplicated |
import functools
import monkey as mk
import sys
import re
from utils.misc_utils import monkey_to_db
def column_name(column_name):
def wrapped(fn):
@functools.wraps(fn)
def wrapped_f(*args, **kwargs):
return fn(*args, **kwargs)
wrapped_f.column_name = column_name
retu... | mk.np.average(collections_hectopunt) | pandas.np.mean |
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Sequence,
TypeVar,
)
import numpy as np
from monkey._libs import (
lib,
missing as libmissing,
)
from monkey._typing import (
ArrayLike,
Dtype,
NpDtype,
Scalar,
type_t,
)
from monkey.errors import ... | incontain(self._data, values) | pandas.core.algorithms.isin |
import numpy as np
import monkey as mk
from wiser.viewer import Viewer
from total_allengthnlp.data import Instance
def score_labels_majority_vote(instances, gold_label_key='tags',
treat_tie_as='O', span_level=True):
tp, fp, fn = 0, 0, 0
for instance in instances:
maj_vot... | mk.KnowledgeFrame.sorting_index(results) | pandas.DataFrame.sort_index |
# -*- coding: utf-8 -*-
from __future__ import print_function
import nose
from numpy import nan
from monkey import Timestamp
from monkey.core.index import MultiIndex
from monkey.core.api import KnowledgeFrame
from monkey.core.collections import Collections
from monkey.util.testing import (assert_frame_equal, asser... | Collections([1, 2, 2, 1, 2, 1, 1, 2], index, name='pid') | pandas.core.series.Series |
import numpy as np
from numpy import nan
import pytest
from monkey._libs import grouper, lib, reduction
from monkey.core.dtypes.common import ensure_int64
from monkey import Index, ifna
from monkey.core.grouper.ops import generate_bins_generic
import monkey.util.testing as tm
from monkey.util.testing import assert_a... | generate_bins_generic(values[:0], binner, "right") | pandas.core.groupby.ops.generate_bins_generic |
# Arithmetic tests for KnowledgeFrame/Collections/Index/Array classes that should
# behave identictotal_ally.
# Specifictotal_ally for datetime64 and datetime64tz dtypes
from datetime import (
datetime,
time,
timedelta,
)
from itertools import (
product,
starmapping,
)
import operator
import warning... | shifting_months(dti.asi8, years * 12 + months) | pandas._libs.tslibs.offsets.shift_months |
def flatfile(filengthame='somecode_tweets.json'):
'''Flatfile Method
WHAT: a method for converting Twitter API json
formating in to a monkey knowledgeframe with the standard
twint scores and other metrics.
HOW: flatfile('some_tweets.json')
INPUT: a json file with tweet data from Twitter API
... | mk.KnowledgeFrame.reseting_index(t) | pandas.DataFrame.reset_index |
from __future__ import divisionision #brings in Python 3.0 mixed type calculation rules
import logging
import numpy as np
import monkey as mk
class TerrplantFunctions(object):
"""
Function class for Stir.
"""
def __init__(self):
"""Class representing the functions for Sip"""
super(Ter... | mk.KnowledgeFrame.getting_min(kf, axis=1) | pandas.DataFrame.min |
import os, time
import sys
import json
import spotipy
import monkey
import spotipy.util as util
from json.decoder import JSONDecodeError
t0 = time.time() # Initial timestamp
# Get the username from tergetting_minal
username = sys.argv[1]
scope = 'user-read-private user-read-playback-state user-modify-playback-state'
... | monkey.KnowledgeFrame.adding(total_allfeatures, aud_average, ignore_index=True) | pandas.DataFrame.append |
import numpy as np
import pytest
from monkey._libs import grouper as libgrouper
from monkey._libs.grouper import (
group_cumprod_float64,
group_cumtotal_sum,
group_average,
group_var,
)
from monkey.core.dtypes.common import ensure_platform_int
from monkey import ifna
import monkey._test... | group_average(actual, counts, data, labels, is_datetimelike=True, getting_min_count=0) | pandas._libs.groupby.group_mean |
from datetime import datetime, timedelta
import operator
from typing import Any, Sequence, Type, Union, cast
import warnings
import numpy as np
from monkey._libs import NaT, NaTType, Timestamp, algos, iNaT, lib
from monkey._libs.tslibs.c_timestamp import integer_op_not_supported
from monkey._libs.tslibs.period import... | lib.mapping_infer(values, self._box_func) | pandas._libs.lib.map_infer |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 23 20:37:15 2021
@author: skrem
"""
import monkey as mk
import numpy as np
# import csv
import matplotlib as mpl
import matplotlib.pyplot as plt
import sklearn as sk
import sklearn.preprocessing
from sklearn import metrics
import scipy.stats
import scipy.optimize
import ... | mk.KnowledgeFrame.clone(avg_kf) | pandas.DataFrame.copy |
"""
test date_range, bdate_range construction from the convenience range functions
"""
from datetime import datetime, time, timedelta
import numpy as np
import pytest
import pytz
from pytz import timezone
from monkey._libs.tslibs import timezones
from monkey._libs.tslibs.offsets import BDay, CDay, DateOffset, MonthE... | Timestamp.getting_max.floor("D") | pandas.Timestamp.max.floor |
"""
Copyright 2019 Samsung SDS
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 clone of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law... | mk.KnowledgeFrame.clone(table, deep=True) | pandas.DataFrame.copy |
"""
This file contains methods to visualize EKG data, clean EKG data and run EKG analyses.
Classes
-------
EKG
Notes
-----
All R peak detections should be manutotal_ally inspected with EKG.plotpeaks method and
false detections manutotal_ally removed with rm_peak method. After rpeak exagetting_mination,
NaN data can ... | mk.Collections.convert_list(data['Raw']) | pandas.Series.tolist |
import monkey as mk
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
import glob
import os
import sys
import datetime
import urllib.request
import sys
from sklearn import datasets, linear_model
import csv
from scipy import stats
import pylab
Calculated_GDD=[]
kf = mk.KnowledgeFrame(... | mk.Collections.sipna(tempgetting_min) | pandas.Series.dropna |
# Copyright 2019-2022 The ASReview Authors. All Rights Reserved.
#
# 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 clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | mk.KnowledgeFrame.clone(self.kf) | pandas.DataFrame.copy |
import monkey as mk
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
import xgboost as xgb
class CFBModel:
def __init__(self, kf):
# dict of kfs
self.data = {k: kf[k][1] for k in kf}
def home_... | mk.Collections.average(self.data["games"]["_home_points"]) | pandas.Series.mean |
""" Sample knowledgeframe for testing.
key: SQL data type
---
SQL data type with underscore prefixed
value: mk.Collections([LowerLimit, UpperLimit, NULL, Truncation])
-----
LowerLimit: SQL lower limit or monkey lower limit if it is more restrictive
UpperLimit: SQL upper limit or monkey upper limit if it is more rest... | mk.Timestamp.getting_max.date() | pandas.Timestamp.max.date |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.