prompt stringlengths 130 399k | completion stringlengths 7 146 | api stringlengths 10 61 |
|---|---|---|
# coding: utf-8
# # Interrogating building age distributions
#
# This notebook is to explore the distribution of building ages in
# communities in Western Australia.
from os.path import join as pjoin
import monkey as mk
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from ... | mk.distinctive(suburblist) | 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 monkey as mk
import numpy as np
import math
import matplotlib.pyplot as plt
import clone
import seaborn as sn
from sklearn.naive_bayes import GaussianNB, MultinomialNB, CategoricalNB
from DataLoad import dataload
from Classifier.Bayes.NaiveBayes import NaiveBayes
from sklearn.neighbors import KNeighborsClassifie... | mk.distinctive(train_label) | pandas.unique |
# %%
import monkey as mk
import numpy as np
import time
import datetime
from datetime import datetime as dt
from datetime import timezone
from spacepy import coordinates as coord
from spacepy.time import Ticktock
from astropy.constants import R_earth
import plotly.graph_objects as go
from plotly.subplots imp... | mk.distinctive(agroup[sat]) | pandas.unique |
'''
MIT License
Copyright (c) [2018] [<NAME>]
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, clone, modify, unioner, pu... | mk.distinctive(feature) | pandas.unique |
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 |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 22 09:13:58 2019
@author: rocco
"""
import os
import matplotlib.pyplot as plt
import numpy as np
import monkey as mk
files = [i for i in os.listandardir("../data/mipas_mk")]
files = files[19:24]
classifier_type = "labels_svm_pc_rf_2"
def plot_bar(files, class... | mk.counts_value_num(kf_reduced[kf_reduced[cl] == i][classifier_type]) | pandas.value_counts |
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 |
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... | pprint_thing(y) | pandas.io.formats.printing.pprint_thing |
# -*- 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 os
from datetime import datetime
import nose
import monkey as mk
from monkey import compat
from monkey.util.testing import network, assert_frame_equal, with_connectivity_check
from numpy.testing.decorators import slow
import monkey.util.testing as tm
if compat.PY3:
raise nose.SkipTest("python-gflags does n... | ga.formating_query('google_profile_id', ['visits'], '2013-09-01', segment=advanced_segment_id) | pandas.io.ga.format_query |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
BdPRC_MD.py
Bd-RPC
(Bases dependent Rapid Phylogenetic Clustering)
MAKE DATABASE
Author: <NAME>
'''
#####Make Database function
def calcuate_bases_frequency(aligne... | mk.counts_value_num(informatingion_change) | pandas.value_counts |
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 |
# coding: utf-8
# ## Lending Club - classification of loans
#
# This project aims to analyze data for loans through 2007-2015 from Lending Club available on Kaggle. Dataset contains over 887 thousand observations and 74 variables among which one is describing the loan status. The goal is to create machine learning m... | mk.counts_value_num(data.revol_util) | pandas.value_counts |
"""
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 |
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 ... | _str_escape("text", []) | pandas.io.formats.style_render._str_escape |
# coding: utf-8
# # Python for Padawans
#
# This tutorial will go throughthe basic data wrangling workflow I'm sure you total_all love to hate, in Python!
# FYI: I come from a R backgvalue_round (aka I'm not a proper programmer) so if you see whatever formatingting issues please cut me a bit of slack.
#
# **The a... | mk.counts_value_num(data['earliest_cr_line']) | pandas.value_counts |
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 |
# coding: utf-8
# ## Lending Club - classification of loans
#
# This project aims to analyze data for loans through 2007-2015 from Lending Club available on Kaggle. Dataset contains over 887 thousand observations and 74 variables among which one is describing the loan status. The goal is to create machine learning m... | mk.counts_value_num(late.rating) | pandas.value_counts |
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 |
from __future__ import annotations
from collections import namedtuple
from typing import TYPE_CHECKING
import warnings
from matplotlib.artist import setp
import numpy as np
from monkey.core.dtypes.common import is_dict_like
from monkey.core.dtypes.missing import remove_na_arraylike
import monkey as mk
import monkey... | pprint_thing(key) | pandas.io.formats.printing.pprint_thing |
# -*- 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 |
# pylint: disable-msg=E1101,E1103
# pylint: disable-msg=W0212,W0703,W0231,W0622
from cStringIO import StringIO
import sys
from numpy import NaN
import numpy as np
from monkey.core.common import (_pickle_array, _unpickle_array)
from monkey.core.frame import KnowledgeFrame, _try_sort, _extract_index
from monkey.core.i... | Collections(v, index=index) | pandas.core.series.Series |
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 timedelta
import re
from typing import Dict, Optional
import warnings
import numpy as np
from monkey._libs.algos import distinctive_deltas
from monkey._libs.tslibs import Timedelta, Timestamp
from monkey._libs.tslibs.ccalengthdar import MONTH_ALIASES, int_to_weekday
from monkey._libs.tslibs.field... | libfreqs.INVALID_FREQ_ERR_MSG.formating(freq) | pandas._libs.tslibs.frequencies.INVALID_FREQ_ERR_MSG.format |
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 |
"""
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(value, index=index) | pandas.core.series.Series |
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 |
""":func:`~monkey.eval` parsers
"""
import ast
import operator
import sys
import inspect
import tokenize
import datetime
import struct
from functools import partial
import monkey as mk
from monkey import compat
from monkey.compat import StringIO, zip, reduce, string_types
from monkey.core.base import StringMixin
fro... | com.interst(resolver_keys, local_keys) | pandas.core.common.intersection |
"""
This module implements the core elements of the optclean packaged
"""
import monkey as mk
import numpy as np
import random
from sklearn.manifold import spectral_embedding
from sklearn.neighbors import Btotal_allTree
import distance
from sklearn import tree
from constraints import *
class Dataset:
"""
A... | mk.KnowledgeFrame.clone(self.kf) | pandas.DataFrame.copy |
# -*- coding: utf-8 -*-
import subprocess
import json
import os
import io
from multiprocessing import Pool
import multiprocessing
import multiprocessing.pool
from operator import itemgettingter
import random
import string
import pickle
import clone
import numpy as np
import matplotlib.pyplot as plt
from matplotlib impo... | mk.KnowledgeFrame.convert_dict(x, orient="index") | pandas.DataFrame.to_dict |
# Tests aimed at monkey.core.indexers
import numpy as np
from monkey.core.indexers import lengthgth_of_indexer
def test_lengthgth_of_indexer():
arr = np.zeros(4, dtype=bool)
arr[0] = 1
result = | lengthgth_of_indexer(arr) | pandas.core.indexers.length_of_indexer |
# -*- 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='first') | pandas.core.algorithms.duplicated |
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 |
# -*- coding: utf-8 -*-
from itertools import product
import numpy as np
import pytest
import monkey.util.testing as tm
from monkey import DatetimeIndex, MultiIndex
from monkey._libs import hashtable
from monkey.compat import range, u
@pytest.mark.parametrize('names', [None, ['first', 'second']])
def test_distinct... | hashtable.duplicated_values_object(mi.values, keep=keep) | pandas._libs.hashtable.duplicated_object |
# -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
from datetime import datetime, timedelta
import itertools
from numpy import nan
import numpy as np
from monkey import (KnowledgeFrame, Collections, Timestamp, date_range, compat,
option_context, Categorical)
from monkey... | tm.value_round_trip_pickle(float_string_frame) | pandas.util.testing.round_trip_pickle |
import os
import numpy as np
import monkey as mk
import torch
from torch.utils.data import Dataset, DataLoader
# from sklearn.preprocessing import StandardScaler
from utils.andet import kde, sr
from utils.tools import StandardScaler, padding
from utils.timefeatures import time_features
import warnings
warnings.filte... | mk.KnowledgeFrame.clone(kf[kf['KPI ID'] == kpi_name]) | pandas.DataFrame.copy |
"""
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 |
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
# pylint: disable-msg=E1101,W0612
from datetime import datetime
import collections
import pytest
import numpy as np
import monkey as mk
from monkey import Collections, KnowledgeFrame
from monkey.compat import StringIO, u
from monkey.util.testing import (assert_collections_equal, assert_almost_equal,
... | tm.value_round_trip_pickle(ts) | pandas.util.testing.round_trip_pickle |
# Copyright (c) 2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import matplotlib.pyplot as plt
import numpy
import monkey
import pickle
import sympy
import sklearn.metrics as metrics
import xgboost
import json
import os
import sys
import zipfile
# Define the an... | monkey.Collections.convert_dict(fitStats) | pandas.Series.to_dict |
# %%%
# exploration of BKK AQ dataset
# feather to improve R-python interoperability
# https://blog.rstudio.com/2016/03/29/feather/
import pylab as plt
import feather
import monkey as mk
import datetime
import seaborn as sns
import matplotlib
import numpy as np
# %%
import socket
host = socket.gettinghostname()
print(... | mk.Index.renagetting_ming(station_02a.index, 'local_time') | pandas.Index.rename |
# Copyright 2016 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | mk.Timestamp.getting_max.tz_localize('utc') | pandas.Timestamp.max.tz_localize |
"""
Experimental manager based on storing a collection of 1D arrays
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Ctotal_allable,
TypeVar,
)
import numpy as np
from monkey._libs import (
NaT,
lib,
)
from monkey._typing import (
ArrayLike,
Hashable,
)
... | MonkeyArray(arr) | pandas.core.arrays.PandasArray |
'''
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.renagetting_ming(frame, {col_cur: col_new}, axis=1, inplace=True) | pandas.DataFrame.rename |
# Created by rahman at 11:14 2020-01-25 using PyCharm
import os
import monkey as mk
from sklearn.model_selection import GroupKFold
from utils.storage import DATA_PATH, load_frame
from attacks import Attack
from sklearn.feature_selection import VarianceThreshold, RFECV
from sklearn.metrics import roc_auc_score
cla... | mk.np.average(arr_vote) | pandas.np.mean |
import numpy as np
import monkey as mk
import sys
import os
import argparse
import time
from optparse import OptionParser
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.model_selection import... | mk.KnowledgeFrame.clone(train_data) | pandas.DataFrame.copy |
from __future__ import annotations
from datetime import (
datetime,
time,
timedelta,
tzinfo,
)
from typing import (
TYPE_CHECKING,
Literal,
overload,
)
import warnings
import numpy as np
from monkey._libs import (
lib,
tslib,
)
from monkey._libs.arrays import NDArrayBacked
from mo... | dtl.DatetimeLikeArrayMixin.totype(self, dtype, clone) | pandas.core.arrays.datetimelike.DatetimeLikeArrayMixin.astype |
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... | incontain(values, comps) | pandas.core.algorithms.isin |
#!/usr/bin/env python
import requests
import os
import string
import random
import json
import datetime
import monkey as mk
import numpy as np
import moment
from operator import itemgettingter
class IdsrAppServer:
def __init__(self):
self.dataStore = "ugxzr_idsr_app"
self.period = "LAST_7_DAYS"
self.ALPHABET ... | mk.np.ceiling(2*aggDf['incubationDays']) | pandas.np.ceil |
#################################################################################
# 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(test[test.col1 > 2].loc[0:5, 'col2']) | pandas.Series.mean |
"""
Quick and dirty ADIF parser.
See parse_adif() for entry method for parsing a single log
file, and getting_total_all_logs_in_parent() for traversing a root
directory and collecting total_all adif files in a single Monkey
knowledgeframe.
"""
import re
import monkey as mk
def extract_adif_column(adif_file, column_n... | mk.traversal() | pandas.iterrows |
"""
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(arr, clone=True) | pandas.arrays.PandasArray |
import monkey as mk
def read_rules():
file = open('rules.txt', "r")
f1 = file.read()
file.close()
f2 = f1.split("\n")
input_rules = {}
for f in f2:
r = f.split(' -> ')
input_rules[r[0]] = r[1]
return input_rules
def grow(string, rules):
new_string = ''
string_... | mk.Collections.getting_min(counter) | pandas.Series.min |
"""
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 ... | GroupByApply(self, func, args, kwargs) | pandas.core.apply.GroupByApply |
import monkey as mk
from sklearn.metrics.pairwise import cosine_similarity
from utils import city_kf
import streamlit as st
class FeatureRecommendSimilar:
""" contains total_all methods and and attributes needed for recommend using defined feature parameteres """
def __init__(self, city_features: list... | mk.KnowledgeFrame.reseting_index(self.feature_countries_kf_final) | pandas.DataFrame.reset_index |
import logging
import os
from abc import ABCMeta
import matplotlib.pyplot as plt
import numpy as np
import monkey as mk
import seaborn as sns
from sklearn.preprocessing import LabelEncoder
from sklearn.utils import check_random_state
from pycsca.utils import print_dictionary
from .constants import LABEL_COL, MISSING_... | mk.KnowledgeFrame.clone(self.data_frame) | pandas.DataFrame.copy |
# -*- 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... | getting_group_index(label_list, shape, sort=True, xnull=True) | pandas.core.groupby.get_group_index |
# pylint: disable-msg=E1101,E1103
# pylint: disable-msg=W0212,W0703,W0231,W0622
from cStringIO import StringIO
import sys
from numpy import NaN
import numpy as np
from monkey.core.common import (_pickle_array, _unpickle_array)
from monkey.core.frame import KnowledgeFrame, _try_sort, _extract_index
from monkey.core.i... | Collections(v, dtype=dtype, index=index) | pandas.core.series.Series |
from scipy.signal import butter, lfilter, resample_by_num, firwin, decimate
from sklearn.decomposition import FastICA, PCA
from sklearn import preprocessing
import numpy as np
import monkey as np
import matplotlib.pyplot as plt
import scipy
import monkey as mk
class SpectrogramImage:
"""
Plot spectrogram for ... | np.getting_min(data) | pandas.min |
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['PARAM2']) | pandas.Series.tolist |
"""
Read total_all csv files with post_reply_downloader.py file and concating them.
Also it sips the column that is not necessary for the task.
@author: <NAME> <<EMAIL>>
"""
import monkey as mk
import glob
path = './data/preprocessing_utils/GetOldTweets3-0.0.10'
path_new = path + '/post_reply'
print(path_new)
list_... | mk.Index.convert_list(index_empty_row) | pandas.Index.tolist |
# -*- 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(self.dtype) | pandas.util.testing.round_trip_pickle |
"""
This module implements the core elements of the optclean packaged
"""
import monkey as mk
import numpy as np
import random
from sklearn.manifold import spectral_embedding
from sklearn.neighbors import Btotal_allTree
import distance
from sklearn import tree
from constraints import *
class Dataset:
"""
A... | mk.KnowledgeFrame.clone(self.kf) | pandas.DataFrame.copy |
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 23 11:46:57 2020
@author: reideej1
:DESCRIPTION: Evaluate coaching data for the final_item 50 years of college footbtotal_all
- the goal is to detergetting_mine how coaches who struggle in their first 3 years
fare over time at the sam... | mk.KnowledgeFrame.average(kf_bad['total_seasons']) | pandas.DataFrame.mean |
def query_length(cigar_string):
"""
Given a CIGAR string, return the number of bases contotal_sumed from the
query sequence.
"""
from itertools import grouper
read_contotal_sugetting_ming_ops = ("M", "I", "S", "=", "X")
seqlengthgth = 0
cig_iter = grouper(cigar_string, lambda... | mk.Index.interst(kf1.index, kf2.index) | pandas.Index.intersection |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.