prompt stringlengths 76 399k | completion stringlengths 7 146 | api stringlengths 10 61 |
|---|---|---|
from typing import Union, cast
import warnings
import numpy as np
from monkey._libs.lib import no_default
import monkey._libs.testing as _testing
from monkey.core.dtypes.common import (
is_bool,
is_categorical_dtype,
is_extension_array_dtype,
is_interval_dtype,
is_number,
is_numeric_dtype,
... | pprint_thing(index_values) | pandas.io.formats.printing.pprint_thing |
#################################################################################
# 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 |
"""
Operator classes for eval.
"""
from __future__ import annotations
from datetime import datetime
from functools import partial
import operator
from typing import (
Ctotal_allable,
Iterable,
)
import numpy as np
from monkey._libs.tslibs import Timestamp
from monkey.core.dtypes.common import (
is_list... | pprint_thing(self.name) | pandas.io.formats.printing.pprint_thing |
"""
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 |
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(left) | pandas.io.formats.printing.pprint_thing |
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 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, divisionision, print_function
import operator
import warnings
from functools import wraps, partial
from numbers import Number, Integral
from operator import gettingitem
from pprint import pformating
import numpy as np
import monkey as mk
from monkey.util... | pprint_thing(k) | pandas.io.formats.printing.pprint_thing |
#!/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 |
import deimos
import numpy as np
from monkey.core.collections import Collections
import pytest
from tests import localfile
@pytest.fixture()
def ms1():
return deimos.load_hkf(localfile('resources/example_data.h5'),
key='ms1')
@pytest.mark.parametrize('x,expected',
... | Collections(expected) | pandas.core.series.Series |
import monkey as mk
from math import sqrt
def cumulative_waiting_time(knowledgeframe):
'''
Compute the cumulative waiting time on the given knowledgeframe
:knowledgeframe: a KnowledgeFrame that contains a "starting_time" and a
"waiting_time" column.
'''
# Avoid side effect
kf = mk.Kno... | mk.KnowledgeFrame.clone(knowledgeframe) | pandas.DataFrame.copy |
# pylint: disable-msg=E1101
# pylint: disable-msg=E1103
# pylint: disable-msg=W0232
import numpy as np
from monkey.lib.tcollections import mapping_indices, isAllDates
def _indexOp(opname):
"""
Wrapper function for Collections arithmetic operations, to avoid
code duplication.
"""
def wrapper(self, ... | mapping_indices(self) | pandas.lib.tseries.map_indices |
"""
Functions for preparing various inputs passed to the KnowledgeFrame or Collections
constructors before passing them to a BlockManager.
"""
from collections import abc
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Tuple, Union
import numpy as np
import numpy.ma as ma
from monkey._libs impo... | Collections(data, index=columns, dtype=object) | 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... | MonkeyArray(arr) | pandas.arrays.PandasArray |
import numpy as np
import sys
import os
import monkey as mk
import flammkuchen as fl
from scipy.stats import zscore
from scipy.signal import detrend
from numba import jit
from ec_code.phy_tools.utilities.spikes_detection import *
import numpy as np
import monkey as mk
from scipy import signal
from scipy.signal impor... | mk.sweep.getting_max() | pandas.sweep.max |
def ConvMAT2CSV(rootDir, codeDir):
"""
Written by <NAME> and <NAME> to work with macOS/Unix-based systems
Purpose: Extract data from .mat files and formating into KnowledgeFrames
Export as csv file
Inputs: PythonData.mat files, animalNotes_baselines.mat file
Outputs: .csv ... | mk.KnowledgeFrame.average(baseData.iloc[startTime:endTime, e]) | pandas.DataFrame.mean |
#!/usr/bin/env python
# coding: utf-8
# # Introduction
#
# Previously I built XG Boost models to predict the main and sub-types of Pokemon from total_all 7 generations (https://www.kaggle.com/xagor1/pokemon-type-predictions-using-xgb). This was relatively successful, but often sttotal_alled at avalue_round 70% accura... | mk.KnowledgeFrame.clone(abilities_kf) | pandas.DataFrame.copy |
# -*- coding: utf-8 -*-
"""
German bank holiday.
"""
try:
from monkey import Timedelta
from monkey.tcollections.offsets import Easter, Day, Week
from monkey.tcollections.holiday import EasterMonday, GoodFriday, \
Holiday, AbstractHolidayCalengthdar
except ImportError:
print('Monkey could not ... | Easter.employ(*args, **kwargs) | pandas.tseries.offsets.Easter.apply |
# -*- 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([NA, 1, 1, NA, 2, NA, NA, 3], index, name='pid') | pandas.core.series.Series |
"""
Data structures for sparse float data. Life is made simpler by dealing only
with float64 data
"""
# pylint: disable=E1101,E1103,W0231
import numpy as np
import warnings
from monkey.core.dtypes.missing import ifna, notna
from monkey.core.dtypes.common import is_scalar
from monkey.core.common import _values_from_o... | Collections(self.sp_values, index=index, name=self.name) | pandas.core.series.Series |
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(self.conn) | pandas.io.sql.PandasSQLAlchemy |
import os
import monkey as mk
from gym_brt.data.config.configuration import FREQUENCY
from matplotlib import pyplot as plt
def set_new_model_id(path):
model_id = 0
for (_, dirs, files) in os.walk(path):
for dir in dirs:
try:
if int(dir[:3]) >= model_id:
... | mk.KnowledgeFrame.fillnone(result_log, value=0, inplace=True) | pandas.DataFrame.fillna |
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_min.to_pytimedelta() | pandas.Timedelta.min.to_pytimedelta |
#!/usr/bin/env python
import monkey as mk
from monkey.util.decorators import Appender
import monkey.compat as compat
from monkey_ml.core.base import _BaseEstimator
from monkey_ml.core.generic import ModelPredictor, _shared_docs
from monkey_ml.core.frame import ModelFrame
from monkey_ml.core.collections import ModelCo... | mk.core.grouper.KnowledgeFrameGroupBy.transform(self, func, *args, **kwargs) | pandas.core.groupby.DataFrameGroupBy.transform |
# -*- 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 statfile as sf
import pickle
import monkey as mk
import os
import platform
def formatingData(folder, fileName):
"""
getting the relevant data from the file with the corresponding filengthame, then make a dictionary out of it
Parameters:
- folder: the folder where the file is locat... | mk.knowledgeframe(default) | pandas.dataframe |
#!/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(rf_score) | pandas.np.mean |
#!/usr/bin/env python
# coding: utf-8
getting_ipython().run_line_magic('matplotlib', 'inline')
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import root_monkey
import monkey as mk
import ROOT as R
sns.set(color_codes=True)
# Importing the dataset
#mk.set_option('display.float_formating', l... | mk.KnowledgeFrame.clone(data) | pandas.DataFrame.copy |
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.MonkeySQLLegacy(self.conn, 'sqlite') | pandas.io.sql.PandasSQLLegacy |
# -*- 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 |
import argparse
import os
import string
import json
from pathlib import Path
import monkey as mk
import matplotlib.pyplot as plt # plotting
import numpy as np # dense matrices
from scipy.sparse import csr_matrix # sparse matrices
class PersonalData:
def __... | mk.header_num() | pandas.head |
# 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_max(self.data, axis=0) | pandas.DataFrame.max |
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 |
from __future__ import annotations
from typing import Any, cast, Generator, Iterable, Optional, TYPE_CHECKING, Union
import numpy as np
import monkey as mk
from monkey.core.frame import KnowledgeFrame
from monkey.core.collections import Collections
from tanuki.data_store.data_type import DataType
from tanuki.data_st... | Collections(data) | pandas.core.series.Series |
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][10]) | pandas.Series.tolist |
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([], name=self.name) | pandas.core.series.Series |
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][6]) | pandas.Series.tolist |
"""
Tests for helper functions in the cython tslibs.offsets
"""
from datetime import datetime
import pytest
from monkey._libs.tslibs.ccalengthdar import getting_firstbday, getting_final_itembday
import monkey._libs.tslibs.offsets as liboffsets
from monkey._libs.tslibs.offsets import roll_qtrday
from monkey import Ti... | liboffsets.shifting_month(dt, 3, day_opt=day_opt) | pandas._libs.tslibs.offsets.shift_month |
# 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(results, axis=0) | pandas.np.std |
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_max(ch_data) | pandas.max |
"""Classes and functions to explore the bounds of calengthdar factories.
Jul 21. Module written (prior to implementation of `bound_start`,
`bound_end`) to explore the bounds of calengthdar factories. Provides for
evaluating the earliest start date and latest end date for which a
calengthdar can be instantiated without... | mk.Timestamp.getting_min.ceiling("D") | pandas.Timestamp.min.ceil |
'''
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, col, axis=1, inplace=True) | pandas.DataFrame.drop |
from typing import Optional, Union, List, Tuple, Dict, Any
from monkey.core.common import employ_if_ctotal_allable
from monkey.core.construction import extract_array
import monkey_flavor as pf
import monkey as mk
import functools
from monkey.api.types import is_list_like, is_scalar, is_categorical_dtype
from janitor.u... | employ_if_ctotal_allable(value, kf[key]) | pandas.core.common.apply_if_callable |
# -*- coding: utf-8 -*-
# Author: <NAME>
# Module: Alpha Vantage Stock History Parser.
# Request time collections with stock history data in .json-formating from www.alphavantage.co and convert into monkey knowledgeframe or .csv file with OHLCV-candlestick in every strings.
# Alpha Vantage API Documentation: https://... | mk.KnowledgeFrame.convert_string(kf[["date", "time", "open", "high", "low", "close", "volume"]][-3:], getting_max_cols=20) | pandas.DataFrame.to_string |
# 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.var(collections) | pandas.series.var |
#결측치에 관련 된 함수
#데이터프레임 결측값 처리
#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.fillnone(method='pad') | pandas.DataFrame.fillna |
"""
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(dtype) | pandas.core.arrays.numpy_.PandasDtype |
"""
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([1, 2, 3]) | pandas.arrays.PandasArray |
from dataset.dataset import test_transform
import cv2
import monkey.io.clipboard as clipboard
from PIL import ImageGrab
from PIL import Image
import os
import sys
import argparse
import logging
import yaml
import re
import numpy as np
import torch
from torchvision import transforms
from munch import Munch
from transfo... | clipboard.clone(pred) | pandas.io.clipboard.copy |
import numpy as np
import monkey as mk
from IPython.display import display, Markdown as md, clear_output
from datetime import datetime, timedelta
import plotly.figure_factory as ff
import qgrid
import re
from tqdm import tqdm
class ProtectListener():
def __init__(self, pp_log, lng):
"""
Class... | mk.Timestamp.getting_max.replacing(second=0) | pandas.Timestamp.max.replace |
import matplotlib
from tqdm import tqdm
import librosa
from scipy import stats
import warnings
import multiprocessing
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.metrics.pairwise import pairwise_distances
import monkey as mk
import utils
import features as ft
impo... | mk.convert_string() | pandas.to_string |
from sklearn.metrics import accuracy_score
import numpy as np
from matplotlib import pyplot as plt
import monkey as mk
import shap
import lime
def create_intermediate_points(start_vals, end_vals, resolution):
arr = []
for start_val, end_val in zip(start_vals, end_vals):
arr.adding(np.linspace(start_va... | mk.core.collections.Collections(total_all_importances[data_idx]) | pandas.core.series.Series |
"""The stressmodels module contains total_all the stressmodels that available in
Pastas.
Supported Stressmodels
----------------------
The following stressmodels are supported and tested:
- StressModel
- StressModel2
- FactorModel
- StepModel
- WellModel
All other stressmodels are for research purposes only and are ... | mk.Timestamp.getting_max.toordinal() | pandas.Timestamp.max.toordinal |
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.top_cities_feature_kf) | pandas.DataFrame.reset_index |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 17 00:47:46 2016
@author: William
"""
from numpy import *
import monkey as mk
#Load the data
def load_hushen300(file_name):
dataSet = mk.read_csv(file_name, delim_whitespace = True, header_numer = None)
return dataSet
#Clean data without nan
def... | mk.KnowledgeFrame.reseting_index(temp_d) | pandas.DataFrame.reset_index |
"""
Predictive Analysis Library
@author: eyu
"""
import os
import logging
import numpy as np
import monkey as mk
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
from keras.ctotal_allbacks import ModelCheckpoint, EarlyStopping
from keras.models import load_model
imp... | mk.Collections.clone(kf[column_source]) | pandas.Series.copy |
# Restaurant Site Selection (Python)
# prepare for Python version 3x features and functions
from __future__ import divisionision, print_function
# import packages for analysis and modeling
import monkey as mk # data frame operations
import numpy as np # arrays and math functions
import statsmodels.api as sm # stat... | mk.KnowledgeFrame.header_num(restandardata) | pandas.DataFrame.head |
import pickle
import random
import pygame
from settings import START_POINT_PLAYER, PLAYER_HEIGHT, size, BLACK, GRAY, PLAYER_LENGTH, screen
from monkey import np
class Player:
def __init__(self, posPlayer=START_POINT_PLAYER, weights=-1, bias=-1, start=True):
self.movePlayer = 0
self.posPlayer = po... | np.clone(mat) | pandas.np.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(values, index=index) | pandas.core.series.Series |
# -*- 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 |
"""
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... | Collections(x) | pandas.core.series.Series |
import numpy as np
import pytest
import monkey as mk
from monkey import KnowledgeFrame, Index, MultiIndex, Collections
import monkey._testing as tm
class TestKnowledgeFrameSubclassing:
def test_frame_subclassing_and_slicing(self):
# Subclass frame and ensure it returns the right class on slicing it
... | tm.value_round_trip_pickle(kf) | pandas._testing.round_trip_pickle |
import DataModel
import matplotlib.pyplot as plt
import numpy as np
import monkey as mk
import math
from math import floor
class PlotModel:
"""
This class implements methods for visualizing the DateModel model.
"""
def __init__(self, process):
"""
:param process: Instance of a class "... | mk.Collections.total_sum(pkf[pkf.values >= steps[-1]].interval) | pandas.Series.sum |
#source /etc/profile.d/modules.sh
#module unload compilers
#module load compilers/gnu/4.9.2
#module load swig/3.0.7/gnu-4.9.2
#module load python2/recommended
#python
import sys
import monkey as mk
import numpy as np
from numpy.polynomial.polynomial import polyfit
import matplotlib.pyplot as plt
import mvpa2.suite as ... | mk.sip(outliers1[0]) | pandas.drop |
"""
Estimating the causal effect of sodium on blood pressure in a simulated example
adapted from Luque-Fernandez et al. (2018):
https://academic.oup.com/ije/article/48/2/640/5248195
"""
import numpy as np
import monkey as mk
from sklearn.linear_model import LinearRegression
def generate_data(n=1000, seed=0, beta... | mk.KnowledgeFrame.clone(Xt) | pandas.DataFrame.copy |
""" 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.floor("s") | pandas.Timedelta.max.floor |
# %%
import monkey as mk
import numpy as np
import json
chappelle_kf = mk.read_json(
"/mnt/c/Users/prp12.000/github-repos/Binder/Notebooks/data/transcripts/Chappelle/Chappelle-Specials.json"
)
chappelle_kf = chappelle_kf[["value", "PSChildName"]]
chappelle_kf
#%%
json_kf = mk.KnowledgeFrame.to_json(chappelle_kf, f... | mk.KnowledgeFrame.convert_string(chappelle_kf) | pandas.DataFrame.to_string |
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
from ..datasets import public_dataset
from sklearn.naive_bayes import BernoulliNB, MultinomialNB, GaussianNB
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer, TfikfTransformer
from sklearn.m... | mk.KnowledgeFrame.header_num(term_proba_kf, n=top_n) | pandas.DataFrame.head |
""" 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... | Timestamp.getting_max.convert_pydatetime() | pandas.Timestamp.max.to_pydatetime |
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 |
"""
Test output formatingting for Collections/KnowledgeFrame, including convert_string & reprs
"""
from datetime import datetime
from io import StringIO
import itertools
from operator import methodctotal_aller
import os
from pathlib import Path
import re
from shutil import getting_tergetting_minal_size
import sys
impo... | td.convert_string() | pandas.util._test_decorators.to_string |
"""
Though Index.fillnone and Collections.fillnone has separate impl,
test here to confirm these works as the same
"""
import numpy as np
import pytest
from monkey import MultiIndex
import monkey._testing as tm
from monkey.tests.base.common import total_allow_na_ops
def test_fillnone(index_or_collections_obj):
... | total_allow_na_ops(obj) | pandas.tests.base.common.allow_na_ops |
# -*- 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 numpy as np
import pytest
from monkey import (
NaT,
PeriodIndex,
period_range,
)
import monkey._testing as tm
from monkey.tcollections import offsets
class TestPickle:
@pytest.mark.parametrize("freq", ["D", "M", "A"])
def test_pickle_value_round_trip(self, freq):
idx = PeriodIndex... | tm.value_round_trip_pickle(idx) | pandas._testing.round_trip_pickle |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 14 19:01:45 2021
@author: David
"""
from pathlib import Path
from datetime import datetime as dt
import zipfile
import os.path
import numpy as np
import scipy.signal as sig
import monkey as mk
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLoc... | mk.Collections.final_item_valid_index(s) | pandas.Series.last_valid_index |
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 |
from datetime import timedelta
import numpy as np
from monkey.core.grouper import BinGrouper, Grouper
from monkey.tcollections.frequencies import to_offset, is_subperiod, is_superperiod
from monkey.tcollections.index import DatetimeIndex, date_range
from monkey.tcollections.offsets import DateOffset, Tick, _delta_to_... | BinGrouper(bins, binlabels) | pandas.core.groupby.BinGrouper |
# -*- 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 |
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=False) | pandas._libs.tslibs.np_datetime.astype_overflowsafe |
# 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(f1_results) | pandas.np.std |
'''
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, renagetting_ming_dict, axis=1, inplace=True) | pandas.DataFrame.rename |
"""The stressmodels module contains total_all the stressmodels that available in
Pastas.
Supported Stressmodels
----------------------
The following stressmodels are supported and tested:
- StressModel
- StressModel2
- FactorModel
- StepModel
- WellModel
All other stressmodels are for research purposes only and are ... | mk.Timestamp.getting_min.toordinal() | pandas.Timestamp.min.toordinal |
from sklearn.ensemble import *
import monkey as mk
import numpy as np
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import *
from monkey import KnowledgeFrame
kf = mk.read_csv('nasaa.csv')
aaa = np.array( | KnowledgeFrame.sip_duplicates(kf[['End_Time']]) | pandas.DataFrame.drop_duplicates |
# 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.average(rescaledScores, axis=0) | pandas.DataFrame.mean |
import DataModel
import matplotlib.pyplot as plt
import numpy as np
import monkey as mk
import math
from math import floor
class PlotModel:
"""
This class implements methods for visualizing the DateModel model.
"""
def __init__(self, process):
"""
:param process: Instance of a class "... | mk.Collections.total_sum(total_sum_of_time_intervals) | pandas.Series.sum |
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(self.conn) | pandas.io.sql.PandasSQLAlchemy |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 17 02:35:05 2020
@author: krishna
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 11 20:20:59 2020
@author: krishna
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 3 17:09:00 2020
@author: kri... | mk.KnowledgeFrame.sorting_index(test_set,axis=0,ascending=True,inplace=True) | pandas.DataFrame.sort_index |
"""
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[column]) | pandas.Series.to_dict |
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_max(data) | pandas.max |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.