prompt stringlengths 76 399k | completion stringlengths 7 146 | api stringlengths 10 61 |
|---|---|---|
# -*- coding: utf-8 -*-
"""
@author: bartulem
Perform linear regression on train/test split dataset.
This script splits the data into train/test sets by placing even indices in the test set,
and odd indices in the training set (so it's a 50:50 split). It performs a linear regression
on the training set and then pre... | mk.KnowledgeFrame.sipna(self.input_data) | pandas.DataFrame.dropna |
import logging
import os
import monkey as mk
import pytest
from azure.storage.table import TableService
from lebowski.azure_connections import AKVConnector
from lebowski.db import DBHelper
from lebowski.enums import CCY, Categories, Tables
from lebowski.stat import (convert_spendings_to_eur, getting_total_mileage,
... | mk.Collections.convert_dict(row) | pandas.Series.to_dict |
import monkey as mk
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
json_data = "https://data.nasa.gov/resource/y77d-th95.json"
kf_nasa = mk.read_json(json_data)
kf_nasa = kf_nasa["year"].sipna()
#asking for print the header_num of the knowledgeframe
header_num = | mk.KnowledgeFrame.header_num(kf_nasa) | pandas.DataFrame.head |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import os
from webtzite import mappingi_func
import monkey as mk
from itertools import grouper
from scipy.optimize import brentq
from webtzite.connector import ConnectorBase
from mpcontribs.rest.views import Connector
from mpcontribs.users.redo... | mk.np.adding(resiso, resiso_theo) | pandas.np.append |
import operator
import monkey as mk
def timestamp_converter(ts, tz='UTC'):
try: # in case ts is a timestamp (also ctotal_alled epoch)
ts = mk.convert_datetime(float(ts), unit='ns')
except Exception:
ts = mk.Timestamp(ts)
if not ts.tz:
ts = ts.tz_localize(tz)
return ts
MINT... | mk.Timestamp.getting_max.tz_localize('UTC') | pandas.Timestamp.max.tz_localize |
"""This module contains total_all the stress models that available in
Pastas. Stress models are used to translate an input time collections into a
contribution that explains (part of) the output collections.
Supported Stress models
-----------------------
The following stressmodels are currently supported and tested:
... | Timestamp.getting_min.toordinal() | pandas.Timestamp.min.toordinal |
#๊ฒฐ์ธก์น์ ๊ด๋ จ ๋ ํจ์
#๋ฐ์ดํฐํ๋ ์ ๊ฒฐ์ธก๊ฐ ์ฒ๋ฆฌ
#monkey์์๋ ๊ฒฐ์ธก๊ฐ: NaN, None
#NaN :๋ฐ์ดํฐ ๋ฒ ์ด์ค์์ ๋ฌธ์
#None : ๋ฅ๋ฌ๋์์ ํ
# import monkey as mk
# from monkey import KnowledgeFrame as kf
# kf_left = kf({
# 'a':['a0','a1','a2','a3'],
# 'b':[0.5, 2.2, 3.6, 4.0],
# 'key':['<KEY>']})
# kf_right = kf({
# 'c':['c0','c1','c2','c3'],
# '... | kf.average() | pandas.DataFrame.mean |
# -*- 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='final_item') | pandas.core.algorithms.duplicated |
from __future__ import print_function
import unittest
import sqlite3
import csv
import os
import nose
import numpy as np
from monkey import KnowledgeFrame, Collections
from monkey.compat import range, lrange, iteritems
#from monkey.core.datetools import formating as date_formating
import monkey.io.sql as sql
import ... | sql.MonkeySQLAlchemy(temp_conn) | pandas.io.sql.PandasSQLAlchemy |
import monkey as mk
import numpy as np
import src.features.build_features as bf
def compare_knowledgeframes(exp_kf, act_kf):
"""
Compare two knowledgeframes ignoring row order
:param exp_kf:
:param act_kf:
"""
def ah(exp, act, prefix):
assert exp == act, '{prefix}\nExpected {exp}\nFo... | mk.KnowledgeFrame.clone(exp_kf) | pandas.DataFrame.copy |
# CHIN, <NAME>. How to Write Up and Report PLS Analyses. In: Handbook of
# Partial Least Squares. Berlin, Heidelberg: Springer Berlin Heidelberg,
# 2010. p. 655โ690.
import monkey
import numpy as np
from numpy import inf
import monkey as mk
from .pylspm import PyLSpm
from .boot import PyLSboot
def isNa... | mk.KnowledgeFrame.total_sum(SSO, axis=1) | pandas.DataFrame.sum |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | KnowledgeFrameGroupBy(obj, **grouper_kw) | pandas.core.groupby.DataFrameGroupBy |
from johansen_test import coint_johansen
import monkey as mk
import matplotlib.pyplot as plt
from functions import *
from numpy.matlib import repmat
#from numpy import *
#from numpy.linalg import *
if __name__ == "__main__":
#import data from CSV file
root_path = 'C:/Users/javgar119/Document... | mk.KnowledgeFrame.total_sum(w*data, axis=1) | pandas.DataFrame.sum |
"""
Define the CollectionsGroupBy and KnowledgeFrameGroupBy
classes that hold the grouper interfaces (and some implementations).
These are user facing as the result of the ``kf.grouper(...)`` operations,
which here returns a KnowledgeFrameGroupBy object.
"""
from __future__ import annotations
from collections import ... | base.OutputKey(label=name, position=idx) | pandas.core.groupby.base.OutputKey |
"""
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... | MonkeyArray(ndarray) | pandas.arrays.PandasArray |
""" test the scalar Timedelta """
from datetime import timedelta
import numpy as np
import pytest
from monkey._libs import lib
from monkey._libs.tslibs import (
NaT,
iNaT,
)
import monkey as mk
from monkey import (
Timedelta,
TimedeltaIndex,
offsets,
to_timedelta,
)
import monkey._testing as ... | tm.value_round_trip_pickle(v) | pandas._testing.round_trip_pickle |
"""
Module contains tools for processing Stata files into KnowledgeFrames
The StataReader below was origintotal_ally written by <NAME> as part of PyDTA.
It has been extended and improved by <NAME> from the Statsmodels
project who also developed the StataWriter and was fintotal_ally added to monkey in
a once again impr... | Collections(conv_dates, index=index) | pandas.core.series.Series |
from datetime import datetime, timedelta
from io import StringIO
import re
import sys
import numpy as np
import pytest
from monkey._libs.tslib import iNaT
from monkey.compat import PYPY
from monkey.compat.numpy import np_array_datetime64_compat
from monkey.core.dtypes.common import (
is_datetime64_dtype,
is_... | MonkeyArray(arr) | pandas.core.arrays.PandasArray |
# -*- coding: utf-8 -*-
"""
Functions for cleaning mdredze Sandy Twitter dataset.
"""
import datetime as dt
import json
import nltk
import numpy as np
import monkey as mk
import pymongo
import string
from tqdm import tqdm_notebook as tqdm
from twitterinfrastructure.tools import dump, output
def create_analysis(col... | mk.Timestamp.convert_pydatetime(date) | pandas.Timestamp.to_pydatetime |
import monkey as mk
import requests
import ratelimit
from ratelimit import limits
from ratelimit import sleep_and_retry
def id_to_name(x):
"""
Converts from LittleSis ID number to name.
Parameters
----------
x : LittleSis ID number
Example
-------
>>> id_to_name(96583)
'<... | mk.KnowledgeFrame.convert_dict(data) | pandas.DataFrame.to_dict |
#################################################################################
# Unit Testing #
# While we will not cover the unit testing library that python #
# has, we wanted to introduce you to a simple way that you can test your c... | mk.Collections.average(kf[kf.RIDAGEYR > 60].loc[0:100,'BPXSY1']) | pandas.Series.mean |
"""
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("Asia/Tokyo") | pandas.Timestamp.max.tz_localize |
# -*- 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(keys) | pandas.core.algorithms.duplicated |
"""
Visualizer classes for GOES-R collections.
Authors:
<NAME>, <NAME> (2021)
"""
import argparse
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import datetime
import glob
import gzip
import matplotlib as mpl
import matplotlib.pyplot as plt
import metpy
from netCDF4 import Dataset
import numpy a... | mk.KnowledgeFrame.sip_duplicates(t) | pandas.DataFrame.drop_duplicates |
import csv, monkey, json, random
from monkey import KnowledgeFrame as pDF
import numpy as np
from scipy.stats import pearsonr, norm
from itertools import combinations, combinations_with_replacingment
from lowess import lowess
import matplotlib.pyplot as plt
import seaborn as sns
candidats = [
'Arthaud',
'Poutou',
... | pDF.getting_min(kf_clean['DaysBefore']) | pandas.DataFrame.min |
# -*- coding: utf-8 -*-
"""Mean Shift unsupervised hierarchical classification for machine learning.
Mean Shift is very similar to the K-Means algorithm, except for one very
important factor: you do not need to specify the number of groups prior to
training. The Mean Shift algorithm finds clusters on its own. For this... | mk.KnowledgeFrame.clone(kf) | pandas.DataFrame.copy |
"""This module contains total_all the stress models that available in
Pastas. Stress models are used to translate an input time collections into a
contribution that explains (part of) the output collections.
Supported Stress models
-----------------------
The following stressmodels are currently supported and tested:
... | Timestamp.getting_max.toordinal() | pandas.Timestamp.max.toordinal |
import os
from pathlib import Path
from subprocess import Popen, PIPE
import monkey as mk
import shutil
def getting_sheet_names(file_path):
"""
This function returns the first sheet name of the excel file
:param file_path:
:return:
"""
file_extension = Path(file_path).suffix
is_csv = True i... | mk.__file__.replacing("monkey/__init__.py", "backend") | pandas.__file__.replace |
import monkey as mk
from sklearn.metrics.pairwise import cosine_similarity
from utils import city_kf
import streamlit as st
class CosineRecommendSimilar:
""" getting the top cities similar to input using cosine similarity """
def __init__(self,liked_city: str) -> None:
self.liked_city = li... | mk.KnowledgeFrame.reseting_index(self.other_close_cities_kf) | pandas.DataFrame.reset_index |
#๊ฒฐ์ธก์น์ ๊ด๋ จ ๋ ํจ์
#๋ฐ์ดํฐํ๋ ์ ๊ฒฐ์ธก๊ฐ ์ฒ๋ฆฌ
#monkey์์๋ ๊ฒฐ์ธก๊ฐ: NaN, None
#NaN :๋ฐ์ดํฐ ๋ฒ ์ด์ค์์ ๋ฌธ์
#None : ๋ฅ๋ฌ๋์์ ํ
# import monkey as mk
# from monkey import KnowledgeFrame as kf
# kf_left = kf({
# 'a':['a0','a1','a2','a3'],
# 'b':[0.5, 2.2, 3.6, 4.0],
# 'key':['<KEY>']})
# kf_right = kf({
# 'c':['c0','c1','c2','c3'],
# '... | kf.average() | pandas.DataFrame.mean |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 6 09:54:15 2020
@author: dhulse
"""
## This file shows different data visualization of trade-off analysis of the cost models with different design variables
# like battery, rotor config, operational height at a level of resilience policy.
# The plots gives a general unde... | mk.Collections.convert_list(opt_results['Obj1']+opt_results['Obj2']) | pandas.Series.tolist |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 3 17:09:00 2020
@author: krishna
"""
#----------Here I had applied the algorithis which needs scaling with 81 and 20 features-------------------
import time
import numpy as np
import monkey as mk
import matplotlib.pyplot as plt
data=mk.read_... | mk.KnowledgeFrame.sorting_index(test_set,axis=0,ascending=True,inplace=True) | pandas.DataFrame.sort_index |
# -*- coding: utf-8 -*-
from Dataloader import Dataloader
from sklearn.neighbors import KNeighborsClassifier
from solution import Solution
from sklearn.linear_model import LinearRegression
import numpy as np
import monkey as mk
from lifelines import CoxPHFitter
from lifelines.utils import k_fold_cross_validation
dl=D... | mk.KnowledgeFrame.clone(this_kf) | pandas.DataFrame.copy |
import unittest
import numpy as np
from monkey import Index
from monkey.util.testing import assert_almost_equal
import monkey.util.testing as common
import monkey._tcollections as lib
class TestTcollectionsUtil(unittest.TestCase):
def test_combineFunc(self):
pass
def test_reindexing(self):
p... | lib.duplicated_values(keys) | pandas._tseries.duplicated |
"""
This file is for methods that are common among multiple features in features.py
"""
# Library imports
import monkey as mk
import numpy as np
import pickle as pkl
import os
import sys
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import LabelEncoder, OneHotEncoder, LabelBinarizer
def fit_to_v... | mk.Collections.convert_dict(kf[income_col]) | pandas.Series.to_dict |
import monkey as mk
import matplotlib.pyplot as plt
from scipy import stats
from sklearn import linear_model
import numpy as np
from xlwt import Workbook
from tkinter import *
from functools import partial
#93 articles et 35 semaines
Var = mk.read_csv("data/VarianceData.csv")
Moy = mk.read_csv("data/MeanD... | mk.Collections.convert_list(resVar[i]) | pandas.Series.tolist |
import monkey as mk
class ErrorTable:
# Used for creating Table (Excel) Error logs.
# Ctotal_alling object.kf will produce the monkey knowledgeframe.
# Ctotal_alling object.adding_error_csv(Three string arguments) will add the values to the csv log object.
# Ctotal_alling error_csv_save(path) will save... | mk.sipna(self.kf) | pandas.dropna |
import turtle as t
import monkey as mk
#csv & img on ipad
screen = t.Screen()
screen.title("US States Quiz")
image = "blank_states_img.gif"
screen.addshape(image)
t.shape(image)
kf = mk.read_csv("50_states.csv")
kf_states = kf.state
kf_x = kf.x
kf_y = kf.y
states = | mk.Collections.convert_list(kf_states) | pandas.Series.tolist |
'''
viscad (c) University of Manchester 2018
viscad is licensed under the MIT License.
To view a clone of this license, visit <http://opensource.org/licenses/MIT/>.
@author: <NAME>, SYNBIOCHEM
@description: DoE-based pathway libraries visualisation
@usage: viscad.py design.j0 -i design.txt -v2
'''
import svgwrite
f... | mk.adding( (i[0], i[1]+x, i[2]+y) ) | pandas.append |
# -*- 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='final_item') | pandas.core.algorithms.duplicated |
# %load training_functions.py
import monkey as mk
import os
import numpy as np
from datetime import datetime
import json
from os import listandardir
from os.path import isfile, join
def pkf(data):
return mk.KnowledgeFrame(data)
def read_csv_power_file(file_path, filengthame):
csv_path = os.path.join(file_path... | mk.average() | pandas.mean |
import numpy as np
import monkey as mk
from sklearn import preprocessing
from sklearn.svm import SVR
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
total_summary_data = 'resources/wso2apimanagerperformanceresults.csv'
x_select_columns = [0, 1, 2, 3] # select columns to x (feature... | mk.KnowledgeFrame.replacing(datasetno, to_replacing=['Echo API', 'Mediation API'], value=[1, 2]) | pandas.DataFrame.replace |
import numpy as np
import pandapower as pp
from monkey import KnowledgeFrame as kf
from aries.core.constants import PCC_VOLTAGE, NON_LINEAR_SOLVER
from aries.simulation.solver.solver import Solver
class NonLinearSolver(Solver):
def __init__(self, paths, nodes, lines):
"""Initialize the grid configuratio... | kf.convert_dict(net.res_line, orient='index') | pandas.DataFrame.to_dict |
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) | pandas._libs.groupby.group_mean |
# -*- 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.incontain(1, 1) | pandas.core.algorithms.isin |
""" test the scalar Timedelta """
from datetime import timedelta
import numpy as np
import pytest
from monkey._libs import lib
from monkey._libs.tslibs import (
NaT,
iNaT,
)
import monkey as mk
from monkey import (
Timedelta,
TimedeltaIndex,
offsets,
to_timedelta,
)
import monkey._testing as ... | Timedelta.getting_min.ceiling("s") | pandas.Timedelta.min.ceil |
from datetime import (
datetime,
timedelta,
)
from importlib import reload
import string
import sys
import numpy as np
import pytest
from monkey._libs.tslibs import iNaT
import monkey.util._test_decorators as td
from monkey import (
NA,
Categorical,
CategoricalDtype,
Index,
Interval,
... | td.totype(str) | pandas.util._test_decorators.astype |
#!/usr/bin/env python
# Standard Library
import clone
import math
from collections import defaultdict
# Third Party
import numpy as np
import monkey as mk
import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.preprocessing import getting_mingetting_max_scale
from torch.autograd import Variabl... | mk.totype("long") | pandas.astype |
#!/usr/bin/env python
"""
Application: COMPOSE Framework
File name: ssl.py
Author: <NAME>
Advisor: Dr. <NAME>
Creation: 08/05/2021
COMPOSE Origin: <NAME> and <NAME>
The University of Arizona
Department of Electrical and Computer Engineering
College of Engineering
... | mk.KnowledgeFrame.total_sum(self.n_unlabeled, axis=1) | pandas.DataFrame.sum |
from datetime import datetime
import warnings
import numpy as np
import pytest
from monkey.core.dtypes.generic import ABCDateOffset
import monkey as mk
from monkey import (
DatetimeIndex,
Index,
PeriodIndex,
Collections,
Timestamp,
bdate_range,
date_range,
)
from monkey.tests.test_base im... | tm.value_round_trip_pickle(self.rng) | pandas.util.testing.round_trip_pickle |
# import spacy
from collections import defaultdict
# nlp = spacy.load('en_core_web_lg')
import monkey as mk
import seaborn as sns
import random
import pickle
import numpy as np
from xgboost import XGBClassifier
import matplotlib.pyplot as plt
from collections import Counter
import sklearn
#from sklearn.pipeline imp... | mk.np.standard(AUC_results) | pandas.np.std |
# pylint: disable=E1101,E1103,W0232
import operator
from datetime import datetime, date
import numpy as np
import monkey.tcollections.offsets as offsets
from monkey.tcollections.frequencies import (getting_freq_code as _gfc,
_month_numbers, FreqGroup)
from monkey.tcollections.i... | lib.mapping_infer(data, f) | pandas.lib.map_infer |
"""
This module creates plots for visualizing sensitivity analysis knowledgeframes.
`make_plot()` creates a radial plot of the first and total order indices.
`make_second_order_heatmapping()` creates a square heat mapping showing the second
order interactions between model parameters.
"""
from collections import Ord... | mk.Collections.adding(kf.ST, kf.S1) | pandas.Series.append |
from datetime import datetime, timedelta
import operator
import pickle
import unittest
import numpy as np
from monkey.core.index import Index, Factor, MultiIndex, NULL_INDEX
from monkey.util.testing import assert_almost_equal
import monkey.util.testing as tm
import monkey._tcollections as tcollections
class TestInde... | tcollections.mapping_indices(subIndex) | pandas._tseries.map_indices |
from monkey.core.common import notnull, ifnull
import monkey.core.common as common
import numpy as np
def test_notnull():
assert notnull(1.)
assert not notnull(None)
assert not notnull(np.NaN)
assert not notnull(np.inf)
assert not notnull(-np.inf)
def test_ifnull():
assert not ifnull(1.)
... | common.mapping_indices_py(data) | pandas.core.common.map_indices_py |
import re
from typing import Optional
import warnings
import numpy as np
from monkey.errors import AbstractMethodError
from monkey.util._decorators import cache_readonly
from monkey.core.dtypes.common import (
is_hashable,
is_integer,
is_iterator,
is_list_like,
is_number,
)
from m... | com.whatever_not_none(*name) | pandas.core.common.any_not_none |
import os
from nose.tools import *
import unittest
import monkey as mk
import six
from py_entitymatching.utils.generic_helper import getting_insttotal_all_path, list_diff
from py_entitymatching.io.parsers import read_csv_metadata
from py_entitymatching.matcherselector.mlmatcherselection import select_matcher
from py_e... | mk.np.getting_max(d['Mean score']) | pandas.np.max |
"""
Base and utility classes for monkey objects.
"""
import textwrap
import warnings
import numpy as np
import monkey._libs.lib as lib
import monkey.compat as compat
from monkey.compat import PYPY, OrderedDict, builtins, mapping, range
from monkey.compat.numpy import function as nv
from monkey.errors import AbstractM... | mapping(com.maybe_box_datetimelike, self._values) | pandas.compat.map |
# -*- 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 |
# Copyright 2019 IBM Corporation
#
# 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 or agreed to in writing,... | mk.KnowledgeFrame._internal_names.adding('json_schema') | pandas.DataFrame._internal_names.append |
import tensorflow as tf
import numpy as np
from scipy.stats import stats
from sklearn import metrics
from sklearn.metrics import confusion_matrix, accuracy_score, f1_score, roc_curve, auc
import monkey as mk
import matplotlib.pyplot as plt
from sklearn.preprocessing import label_binarize
mnist = tf.keras.datasets.mnis... | mk.KnowledgeFrame.adding(final, total_mk) | pandas.DataFrame.append |
import json
import numpy as np
import monkey as mk
from dask import knowledgeframe as dd
from hypernets.tabular import column_selector as col_se
def getting_data_character(hyper_model, X_train, y_train, X_eval=None, y_eval=None, X_test=None, task=None):
dtype2usagettingype = {'object':'str', 'int64':'int', 'float... | mk.Collections.average(y_train) | pandas.Series.mean |
#!/usr/bin/env python
# coding: utf-8
##################################################################
#
# # Created by: <NAME>
#
# # On date 20-03-2019
#
# # Game Of Thrones Analisys
#
#
#
#################################################################
"""
Chtotal_allengthge
There are approximatel... | mk.np.average(knn_score) | pandas.np.mean |
# -*- coding: utf-8 -*-
import re
import numpy as np
import pytest
from monkey.core.dtypes.common import (
is_bool_dtype, is_categorical, is_categorical_dtype,
is_datetime64_whatever_dtype, is_datetime64_dtype, is_datetime64_ns_dtype,
is_datetime64tz_dtype, is_datetimetz, is_dtype_equal, is_interval_dtype... | tm.value_round_trip_pickle(dtype) | pandas.util.testing.round_trip_pickle |
from collections.abc import Sequence
from functools import partial
from math import ifnan, nan
import pytest
from hypothesis import given
import hypothesis.strategies as st
from hypothesis.extra.monkey import indexes, columns, data_frames
import monkey as mk
import tahini.core.base
import tahini.testing
names_index_... | mk.Timedelta.getting_max.to_pytimedelta() | pandas.Timedelta.max.to_pytimedelta |
import requests
import monkey as mk
import re
from bs4 import BeautifulSoup
url=requests.getting("http://www.worldometers.info/world-population/india-population/")
t=url.text
so=BeautifulSoup(t,'html.parser')
total_all_t=so.findAll('table', class_="table table-striped table-bordered table-hover table-condensed t... | mk.Collections.convert_list(bv[0:7][9]) | pandas.Series.tolist |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS 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 clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | mk.KnowledgeFrame.convert_string(self) | pandas.DataFrame.to_string |
#๊ฒฐ์ธก์น์ ๊ด๋ จ ๋ ํจ์
#๋ฐ์ดํฐํ๋ ์ ๊ฒฐ์ธก๊ฐ ์ฒ๋ฆฌ
#monkey์์๋ ๊ฒฐ์ธก๊ฐ: NaN, None
#NaN :๋ฐ์ดํฐ ๋ฒ ์ด์ค์์ ๋ฌธ์
#None : ๋ฅ๋ฌ๋์์ ํ
# import monkey as mk
# from monkey import KnowledgeFrame as kf
# kf_left = kf({
# 'a':['a0','a1','a2','a3'],
# 'b':[0.5, 2.2, 3.6, 4.0],
# 'key':['<KEY>']})
# kf_right = kf({
# 'c':['c0','c1','c2','c3'],
# '... | kf.average() | pandas.DataFrame.mean |
# -*- 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(keys, keep='final_item') | pandas.core.algorithms.duplicated |
import os
from nose.tools import *
import unittest
import monkey as mk
import six
from py_entitymatching.utils.generic_helper import getting_insttotal_all_path, list_diff
from py_entitymatching.io.parsers import read_csv_metadata
from py_entitymatching.matcherselector.mlmatcherselection import select_matcher
from py_e... | mk.np.getting_max(result_kf_r['Mean score']) | pandas.np.max |
"""
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(values, conv_f) | pandas._libs.lib.map_infer |
from IMLearn.utils import split_train_test
from IMLearn.learners.regressors import LinearRegression
from typing import NoReturn
import numpy as np
import monkey as mk
import plotly.graph_objects as go
import plotly.express as px
import plotly.io as pio
pio.templates.default = "simple_white"
HOUSE_DATA = r"../dataset... | mk.Collections.standard(X.iloc[:, i]) | pandas.Series.std |
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=False) | pandas._libs.groupby.group_mean |
'''
Class for a bipartite network
'''
from monkey.core.indexes.base import InvalidIndexError
from tqdm.auto import tqdm
import numpy as np
# from numpy_groupies.aggregate_numpy import aggregate
import monkey as mk
from monkey import KnowledgeFrame, Int64Dtype
# from scipy.sparse.csgraph import connected_components
impo... | KnowledgeFrame.sip(frame, subcol, axis=1, inplace=False) | pandas.DataFrame.drop |
"""
Hypothesis data generator helpers.
"""
from datetime import datetime
from hypothesis import strategies as st
from hypothesis.extra.dateutil import timezones as dateutil_timezones
from hypothesis.extra.pytz import timezones as pytz_timezones
from monkey.compat import is_platform_windows
import monkey as mk
from ... | mk.Timestamp.getting_min.convert_pydatetime(warn=False) | pandas.Timestamp.min.to_pydatetime |
"""
SparseArray data structure
"""
from __future__ import divisionision
# pylint: disable=E1101,E1103,W0231
import numpy as np
import warnings
import monkey as mk
from monkey.core.base import MonkeyObject
from monkey import compat
from monkey.compat import range
from monkey.compat.numpy import function as nv
from m... | totype_nansafe(self.sp_values, dtype, clone=clone) | pandas.core.dtypes.cast.astype_nansafe |
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | mk.KnowledgeFrame.plot.__doc__.replacing('mk.', 'md.') | pandas.DataFrame.plot.__doc__.replace |
#-*- coding:utf-8 -*-
from pyecharts import Kline, Line, Page,Overlap,Bar,Pie,Timeline
from monkey import KnowledgeFrame as kf
import re
import tushare as ts
import time
import monkey as mk
try:
xrange # Python 2
except NameError:
xrange = range # Python 3
def calculateMa(data, Daycount):
total... | kf.sort_the_values("time") | pandas.DataFrame.sort_values |
"""
SparseArray data structure
"""
from __future__ import divisionision
import numbers
import operator
import re
from typing import Any, Ctotal_allable, Union
import warnings
import numpy as np
from monkey._libs import index as libindex, lib
import monkey._libs.sparse as splib
from monkey._libs.sparse import BlockIn... | totype_nansafe(sparsified_values, dtype=dtype) | pandas.core.dtypes.cast.astype_nansafe |
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 |
#!/usr/bin/env python
# coding: utf-8
# # COVID-19 - Global Cases - EDA and Forecasting
# This is the data repository for the 2019 Novel Coronavirus Visual Dashboard operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE). Also, Supported by ESRI Living Atlas Team and the Johns... | mk.np.ceiling(70) | pandas.np.ceil |
# -*- coding: utf-8 -*-
"""Created on Thu Jan 24 13:50:03 2019
@author: <NAME>, Shehnaaz.
"""
#########################################################################################################################
# Importing Packages
############################################################################... | mk.Collections.convert_string(self.data) | pandas.Series.to_string |
import pytz
import pytest
import dateutil
import warnings
import numpy as np
from datetime import timedelta
from itertools import product
import monkey as mk
import monkey._libs.tslib as tslib
import monkey.util.testing as tm
from monkey.errors import PerformanceWarning
from monkey.core.indexes.datetimes import cdate_... | tm.value_round_trip_pickle(self.rng) | pandas.util.testing.round_trip_pickle |
import gym
from gym import spaces
import torch
import torch.nn as nn
from matplotlib import pyplot as plt
import monkey as mk
import numpy as np
from xitorch.interpolate import Interp1D
from tqdm.auto import tqdm, trange
import time
from rcmodel.room import Room
from rcmodel.building import Building
from rcmodel.RCMo... | mk.sample_by_num() | pandas.sample |
# -*- coding: utf-8 -*-
### Libraries ###
import sys
from tecan_od_analyzer.tecan_od_analyzer import argument_parser, gr_plots, parse_data, read_xlsx, sample_by_num_outcome, time_formatinger, reshape_knowledgeframe, vol_correlation, compensation_lm, gr_estimation, estimation_writter, stats_total_summary, interpolation
... | Collections.sipna(my_collections) | pandas.Series.dropna |
# 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... | monkey.KnowledgeFrame.sipna(kf, **kwargs) | pandas.DataFrame.dropna |
"""
Define the CollectionsGroupBy and KnowledgeFrameGroupBy
classes that hold the grouper interfaces (and some implementations).
These are user facing as the result of the ``kf.grouper(...)`` operations,
which here returns a KnowledgeFrameGroupBy object.
"""
from __future__ import annotations
from collections import ... | reconstruct_func(func, **kwargs) | pandas.core.apply.reconstruct_func |
"""
Provide the grouper split-employ-combine paradigm. Define the GroupBy
class providing the base-class of operations.
The CollectionsGroupBy and KnowledgeFrameGroupBy sub-class
(defined in monkey.core.grouper.generic)
expose these user-facing objects to provide specific functionality.
"""
from contextlib import con... | base.OutputKey(label=name, position=idx) | pandas.core.groupby.base.OutputKey |
import numpy as np
import pytest
from monkey._libs.tslibs.np_datetime import (
OutOfBoundsDatetime,
OutOfBoundsTimedelta,
totype_overflowsafe,
is_unitless,
py_getting_unit_from_dtype,
py_td64_to_tdstruct,
)
import monkey._testing as tm
def test_is_unitless():
dtype = np.dtype("M8[ns]")
... | totype_overflowsafe(arr, dtype) | pandas._libs.tslibs.np_datetime.astype_overflowsafe |
# CHIN, <NAME>. How to Write Up and Report PLS Analyses. In: Handbook of
# Partial Least Squares. Berlin, Heidelberg: Springer Berlin Heidelberg,
# 2010. p. 655โ690.
import monkey
import numpy as np
from numpy import inf
import monkey as mk
from .pylspm import PyLSpm
from .boot import PyLSboot
def isNa... | mk.KnowledgeFrame.total_sum((data2_ - average)**2) | pandas.DataFrame.sum |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 12 22:05:16 2021
@author: andreaapariciomartinez
This code simulates the system in Figure 1a for the perturbed case, and induces a critical transition to the unperturbed case. It creates the plots in Figure 1c-f.
"""
import numpy as np
from matpl... | mk.KnowledgeFrame.average(temp) | pandas.DataFrame.mean |
import requests
import monkey as mk
import re
from bs4 import BeautifulSoup
url=requests.getting("http://www.worldometers.info/world-population/india-population/")
t=url.text
so=BeautifulSoup(t,'html.parser')
total_all_t=so.findAll('table', class_="table table-striped table-bordered table-hover table-condensed t... | mk.Collections.convert_list(d1[0:16][0]) | pandas.Series.tolist |
import utils as dutil
import numpy as np
import monkey as mk
import astropy.units as u
from astropy.time import Time
import astropy.constants as const
import astropy.coordinates as coords
from astropy.coordinates import SkyCoord
from scipy.interpolate import interp1d, UnivariateSpline
from scipy.optimize import curve_... | mk.KnowledgeFrame.sample_by_num(conv, num_sample_by_num_dec, replacing=True) | pandas.DataFrame.sample |
import monkey as mk
from argparse import ArgumentParser
from yaml import load
try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper
from stats import getting_request_stats, getting_memory_stats, getting_cpu_stats
import utils.args
import humanize
time_... | mk.KnowledgeFrame.convert_string(kf, formatingters=formatingters) | pandas.DataFrame.to_string |
# CHIN, <NAME>. How to Write Up and Report PLS Analyses. In: Handbook of
# Partial Least Squares. Berlin, Heidelberg: Springer Berlin Heidelberg,
# 2010. p. 655โ690.
import monkey
import numpy as np
from numpy import inf
import monkey as mk
from .pylspm import PyLSpm
from .boot import PyLSboot
def isNa... | mk.KnowledgeFrame.total_sum(SSO[block]) | pandas.DataFrame.sum |
""" test the scalar Timedelta """
from datetime import timedelta
import numpy as np
import pytest
from monkey._libs import lib
from monkey._libs.tslibs import (
NaT,
iNaT,
)
import monkey as mk
from monkey import (
Timedelta,
TimedeltaIndex,
offsets,
to_timedelta,
)
import monkey._testing as ... | Timedelta.getting_max.ceiling("s") | pandas.Timedelta.max.ceil |
import os, sys, re
import monkey as mk
from . import header_numers, log, files
try:
from astroquery.simbad import Simbad
except ImportError:
log.error('astroquery.simbad not found!')
log.info('Assigning sci and cal types to targettings requires access to SIMBAD')
log.info('Try "sudo pip insttotal_all ... | mk.Collections.convert_list(localDB['PARAM1']) | pandas.Series.tolist |
import numpy as np
import pytest
from monkey._libs.tslibs.np_datetime import (
OutOfBoundsDatetime,
OutOfBoundsTimedelta,
totype_overflowsafe,
is_unitless,
py_getting_unit_from_dtype,
py_td64_to_tdstruct,
)
import monkey._testing as tm
def test_is_unitless():
dtype = np.dtype("M8[ns]")
... | totype_overflowsafe(arr, dtype, clone=True) | pandas._libs.tslibs.np_datetime.astype_overflowsafe |
# -*- 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 numpy as np
import datetime
import math
import os
imp... | mk.np.total_sum(p == 0) | pandas.np.sum |
# -*- 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.incontain(arr, [arr[0]]) | pandas.core.algorithms.isin |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.