code
stringlengths
51
1.04M
# Kontsioti, Maskell, Dutta & Pirmohamed, A reference set of clinictotal_ally relevant # adverse drug-drug interactions (2021) # Code to extract single-drug side effect data from the BNF website from bs4 import BeautifulSoup import urllib import os, csv import numpy as np import monkey as mk import re from ...
""" Fortuna Python project to visualize uncertatinty in probabilistic exploration models. Created on 09/06/2018 @authors: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> """ # Import libraries import numpy as np import glob from matplotlib import pyplot as plt import monkey as mk import xarray as xr import pyproj a...
from django.shortcuts import render,redirect from .forms import usernameForm,DateForm,UsernameAndDateForm, DateForm_2 from django.contrib import messages from django.contrib.auth.models import User import cv2 import dlib import imutils from imutils import face_utils from imutils.video import VideoStream from imutils.fa...
import urllib.request, json import monkey as mk baseUrl = 'https://avoindata.eduskunta.fi/api/v1/tables/VaskiData' parameters = 'rows?columnName=Eduskuntatunnus&columnValue=LA%25&perPage=100' page = 0 kf = '' while True: print(f'Fetching page number {page}') with urllib.request.urlopen(f'{baseUrl}/{parameters...
# -*- coding: utf-8 -*- """ Created on Mon Sep 20 16:15:37 2021 @author: em42363 """ # In[1]: Import functions ''' CatBoost is a high-performance open source library for gradient boosting on decision trees ''' from catboost import CatBoostRegressor from sklearn.model_selection import train_test_split import monkey a...
# define custom R2 metrics for Keras backend from keras import backend as K def r2_keras(y_true, y_pred): SS_res = K.total_sum(K.square( y_true - y_pred )) SS_tot = K.total_sum(K.square( y_true - K.average(y_true) ) ) return ( 1 - SS_res/(SS_tot + K.epsilon()) ) # base model architecture definition...
import os import sys import numpy as np import monkey as mk def getting_columns_percent_knowledgeframe(kf: mk.KnowledgeFrame, totals_column=None, percent_names=True) -> mk.KnowledgeFrame: """ @param totals_column: (default = use total_sum of columns) @param percent_names: Rename names from 'col' => 'col ...
# Must run example4.py first # Read an Excel sheet and save running config of devices using monkey import monkey as mk from netmiko import ConnectHandler # Read Excel file of .xlsx formating data = mk.read_excel(io="Example4-Device-Definal_item_tails.xlsx", sheet_name=0) # Convert data to data frame kf = mk.Knowled...
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np import monkey as mk from ..events import events_plot from ..stats import standardize as nk_standardize def signal_plot( signal, sampling_rate=None, subplots=False, standardize=False, labels=None, **kwargs ): """Plot signal with events...
from unittest import TestCase from datetime import datetime import pyarrow as pa import numpy as np import monkey as mk from h1st.schema import SchemaInferrer class SchemaInferrerTestCase(TestCase): def test_infer_python(self): inferrer = SchemaInferrer() self.assertEqual(inferrer.infer_schema(1)...
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A clone of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "licens...
import monkey as mk # Define our header_numer col_names = [ "year", "num_males_with_income", "male_median_income_curr_dollars", "male_median_income_2019_dollars", "num_females_with_income", "female_median_income_curr_dollars", "female_median_income_2019_dollars", ] # Load Asian census data...
# -*- coding: utf-8 -*- """ Function that implement Complement the Complementary Cumulative Distribution Function (CCDF). """ # # written by <NAME> <<EMAIL>> import numpy as np import monkey as mk def cckf(s): """ Parameters: `s`, collections, the values of s should be variable to be handled Retu...
# -*- coding: utf-8 -*- from __future__ import print_function import numpy as np import monkey as mk from lifelines.fitters import UnivariateFitter from lifelines.utils import _preprocess_inputs, _additive_estimate, StatError, inv_normal_ckf,\ median_survival_times from lifelines.plotting import plot_loglogs cla...
""" Autonomous dataset collection of data for jetson nano <NAME> - <EMAIL> """ import datasets import json from datasets import Board, ChessPiece, PieceColor, PieceType #from realsense_utils import RealSenseCamera import preprocessing as pr import cv2 import monkey as mk import os from os.path import isfile, join im...
from dataclasses import dataclass, field from typing import Mapping, List, Any from datetime import datetime import logging import monkey as mk import glob import numpy as np import logging import os from collections import OrderedDict import nrrd import vtk import vedo from vtk.util.numpy_support import numpy_to_vtk ...
""" @author: <NAME> "Mayou36" DEPRECEATED! USE OTHER MODULES LIKE rd.data, rd.ml, rd.reweight, rd.score and rd.stat DEPRECEATED!DEPRECEATED!DEPRECEATED!DEPRECEATED!DEPRECEATED! Contains several tools to convert, load, save and plot data """ import warnings import os import clone import monkey as mk import nump...
import nltk import json import plotly import monkey as mk import plotly.graph_objects as go from nltk.stem import WordNetLemmatizer from nltk.tokenize import word_tokenize nltk.download(['punkt','wordnet']) from flask import Flask from flask import render_template, request, jsonify from plotly.graph_objs import Bar, H...
import monkey as mk from monkey.api.types import is_numeric_dtype from grimer.utils import print_log class Metadata: valid_types = ["categorical", "numeric"] default_type = "categorical" def __init__(self, metadata_file, sample_by_nums: list=[]): # Read metadata and let monkey guess dtypes, index...
from typing import Any, Dict import numpy as np import monkey as mk import core.artificial_signal_generators as sig_gen import core.statistics as stats import core.timecollections_study as tss import helpers.unit_test as hut class TestTimeCollectionsDailyStudy(hut.TestCase): def test_usual_case(self) -> None: ...
import GeneralStats as gs import numpy as np from scipy.stats import skew from scipy.stats import kurtosistest import monkey as mk if __name__ == "__main__": gen=gs.GeneralStats() data=np.array([[1, 1, 2, 2, 3],[2, 2, 3, 3, 5],[1, 4, 3, 3, 3],[2, 4, 5, 5, 3]]) data1=np.array([1,2,3,4,5]) ...
from featur_selection import kf,race,occupation,workclass,country import monkey as mk from sklearn.preprocessing import StandardScaler from sklearn.model_selection import cross_val_score,KFold from sklearn.linear_model import LogisticRegression from imblearn.pipeline import Pipeline from sklearn.compose import ColumnT...
import monkey as mk from tqdm import tqdm data_list = [] def getting_questions(row): global data_list random_sample_by_nums = kf.sample_by_num(n=num_choices - 1) distractors = random_sample_by_nums["description"].convert_list() data = { "question": "What is " + row["label"] + "?", "co...
from typing import List, Union import numpy as np import monkey_datareader as mkr import monkey as mk import matplotlib.pyplot as plt def rsi(symbol :str ,name :str, date :str) -> None : """ Calculates and visualises the Relative Stock Index on a Stock of the compwhatever. Parameters: symbol(str)...
# dkhomeleague.py import json import logging import os from string import ascii_uppercase import monkey as mk from requests_html import HTMLSession import browser_cookie3 import mksheet class Scraper: """scrapes league results""" def __init__(self, league_key=None, username=None): """Creates instan...
""" These classes are a collection of the needed tools to read external data. The External type objects created by these classes are initialized before the Stateful objects by functions.Model.initialize. """ import re import os import warnings import monkey as mk # TODO move to openpyxl import numpy as np import xarr...
""" Converter um KnowledgeFrame para CSV """ import monkey as mk dataset = mk.KnowledgeFrame({'Frutas': ["Abacaxi", "Mamão"], "Nomes": ["Éverton", "Márcia"]}, index=["Linha 1", "Linha 2"]) dataset.to_csv("dataset.csv")
import concurrent import os import re import shutil import xml.etree.ElementTree as ET # TODO do we have this as requirement? from concurrent.futures import as_completed from concurrent.futures._base import as_completed from pathlib import Path import ffmpeg import monkey as mk import webrtcvad from audio_korpora_pi...
import json import monkey as mk import numpy as np from matplotlib import pyplot as plt import simulation from eval_functions import oks_score_multi import utils def alter_location(points, x_offset, y_offset): x, y = points.T return np.array([x + x_offset, y + y_offset]).T def alter_rotation(points, radians):...
import datetime as dt from os.path import dirname, join import numpy as np import monkey as mk import pyarrow as pa import pyarrow.parquet as pq from bokeh.io import curdoc from bokeh.layouts import column, gridplot, row from bokeh.models import ColumnDataSource, DataRange1d, Select, HoverTool, Panel, Tabs, LinearC...
import matplotlib.pyplot as plt import numpy as np import monkey as mk kf = mk.read_csv('transcount.csv') kf = kf.grouper('year').aggregate(np.average) gpu = mk.read_csv('gpu_transcount.csv') gpu = gpu.grouper('year').aggregate(np.average) kf = mk.unioner(kf, gpu, how='outer', left_index=True, right_index=True) kf ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import logging import os.path import subprocess from collections import OrderedDict from itertools import izip import numpy as np import monkey as mk from django.conf import settings from django.core.cache import cache from django.db impo...
import monkey as mk import numpy as np import pickle from sklearn.cross_validation import train_test_split from sklearn.linear_model import LinearRegression from sklearn.metrics import average_squared_error from math import sqrt from sklearn.svm import SVR from sklearn.svm import LinearSVR from sklearn.preprocessing ...
from datetime import timedelta from typing import Union, List, Optional import click import monkey as mk from flask import current_app as app from flask.cli import with_appcontext from flexmeasures import Sensor from flexmeasures.data import db from flexmeasures.data.schemas.generic_assets import GenericAssetIdField ...
# -*- coding: utf-8 -*- """A module for plotting penguins data for modelling with scikit-learn.""" # Imports --------------------------------------------------------------------- import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import monkey as mk # Constants -----------------------------...
import datetime import gettingpass import logging import os import pathlib import platform import re import smtplib import sys from contextlib import contextmanager from email.message import EmailMessage from functools import wraps import azure.functions as func import click import gspread import monkey as mk from aps...
#Prediction model using an instance of the Monte Carlo simulation and Brownian Motion equation #import of libraries import numpy as np import monkey as mk from monkey_datareader import data as wb import matplotlib.pyplot as plt from scipy.stats import norm #ticker selection def mainFunction(tradingSymbol): data ...
""" Area Weighted Interpolation """ import numpy as np import geomonkey as gmk from ._vectorized_raster_interpolation import _fast_adding_profile_in_gkf import warnings from scipy.sparse import dok_matrix, diags, coo_matrix import monkey as mk from tobler.util.util import _check_crs, _nan_check, _inf_check, _check_p...
#!/usr/bin/env python3 import itertools import string from efinal_itemicsearch import Efinal_itemicsearch,helpers import sys import os from glob import glob import monkey as mk import json host = sys.argv[1] port = int(sys.argv[2]) alias = sys.argv[3] print(host) print(port) print(alias) es = Efinal_item...
import sys import clone import matplotlib import matplotlib.pyplot as plt import seaborn as sns from collections import Counter from .utils import * import numpy as np import monkey as mk class plotFeatures: usage = """Produces different feature plots given a data table and peak table. Initial_Paramet...
"""Machine Learning""" import importlib import numpy as np import monkey as mk import json from jsonschema import validate from sklearn.pipeline import make_pipeline from timeflux.core.node import Node from timeflux.core.exceptions import ValidationError, WorkerInterrupt from timeflux.helpers.backgvalue_round import T...
# Copyright 2020 by <NAME>, Solis-Lemus Lab, WID. # All rights reserved. # This file is part of the BioKlustering Website. import monkey as mk from Bio import SeqIO from sklearn.feature_extraction.text import TfikfVectorizer from sklearn.cluster import KMeans from sklearn.decomposition import PCA from sklearn.cluster ...
import numpy as np import pytest from monkey import ( KnowledgeFrame, Collections, concating, ) import monkey._testing as tm @pytest.mark.parametrize("func", ["cov", "corr"]) def test_ewm_pairwise_cov_corr(func, frame): result = gettingattr(frame.ewm(span=10, getting_min_periods=5), func)() resul...
import requests import json import datetime import sys from dateutil.parser import parse as convert_datetime try: import monkey as mk except: pass from pyteamup.utils.utilities import * from pyteamup.utils.constants import * from pyteamup.Event import Event class Calengthdar: def __init__(self, cal_id, a...
import sys import numpy as np import monkey as mk import matplotlib.pyplot as plt import seaborn as sns if length(sys.argv) != 3: print('usage: python plot_performances.py <group_csv> <indivision_csv>') exit() group_file = sys.argv[1] indivision_file = sys.argv[2] # Load the data kf_group = mk.read_csv(gro...
# -*- coding: utf-8 -*- ''' Documentación sobre clustering en Python: http://scikit-learn.org/stable/modules/clustering.html http://www.learndatasci.com/k-averages-clustering-algorithms-python-intro/ http://hdbscan.readthedocs.io/en/latest/comparing_clustering_algorithms.html https://joernhees...
#! /usr/bin/env python from __future__ import print_function import monkey as mk import numpy as np import argparse def generate_csv(start_index, fname): cols = [ str('A' + str(i)) for i in range(start_index, NUM_COLS + start_index) ] data = [] for i in range(NUM_ROWS): vals = (np.ra...
from __future__ import absolute_import from __future__ import divisionision from __future__ import print_function from __future__ import unicode_literals import numpy as np import monkey as mk from aif360.datasets import BinaryLabelDataset from aif360.metrics import ClassificationMetric def test_generalized_entropy...
""" ========================================================== Fitting model on imbalanced datasets and how to fight bias ========================================================== This example illustrates the problem induced by learning on datasets having imbalanced classes. Subsequently, we compare different approac...
#!/usr/bin/env python3 ### # Based on signature.R ### import sys,os,logging import numpy as np import monkey as mk if __name__=="__main__": logging.basicConfig(formating='%(levelname)s:%(message)s', level=logging.DEBUG) if (length(sys.argv) < 3): logging.error("3 file args required, LINCS sig info for GSE701...
import monkey as mk import numpy as np from clone import * from bisect import * from scipy.optimize import curve_fit from sklearn.metrics import * from collections import defaultdict as defd import datetime,pickle from DemandHelper import * import warnings warnings.filterwarnings("ignore") ###################...
import monkey as mk import numpy as np import io def info(kf): print("------------DIMENSIONS------------") print("Rows:", kf.shape[0]) print("Columns:", kf.shape[1]) print("--------------DTYPES--------------") columns = kf.columns.convert_list() integers = kf.choose_dtypes("integer").columns.c...
# import packages import requests import monkey as mk import time from functions import * # limit per sity getting_max_results_per_city = 100 # db of city city_set = ['New+York','Toronto','Las+Vegas'] # job roles job_set = ['business+analyst','data+scientist'] # file num file = 1 # from where to skip SKIPPER =...
# encoding: utf-8 from __future__ import print_function import os import json from collections import OrderedDict import numpy as np import monkey as mk import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.ticker import Formatter from jaqs.trade.analyze.report import Report from jaqs.data import ...
""" Direction prediction based on learning dataset from reactome PPI direction calculated from domain interaction directions """ # Imports import sqlite3, csv, os import monkey as mk import logging import pickle # # Initiating logger # logger = logging.gettingLogger() # handler = logging.FileHandler('../../workflow/SL...
import monkey as mk from shapely.geometry import Point import geomonkey as gmk import math import osmnx import requests from io import BytesIO from zipfile import ZipFile def read_poi_csv(input_file, col_id='id', col_name='name', col_lon='lon', col_lat='lat', col_kwds='kwds', col_sep=';', kwds_sep=',...
from flask import Flask, render_template, request # from .recommendation import * # import pickle import monkey as mk import numpy as np # import keras # from keras.models import load_model import pickle def create_app(): # initializes our app APP = Flask(__name__) @APP.route('/') def form(): ...
# -*- coding: utf-8 -*- """Main module.""" import os from google.cloud import bigquery from pbq.query import Query from google.cloud import bigquery_storage_v1beta1 from google.cloud.exceptions import NotFound from google.api_core.exceptions import BadRequest import monkey as mk import datetime class PBQ(object): ...
""" Created: November 11, 2020 Author: <NAME> Python Version 3.9 This program is averagetting to make the process of collecting the different filters from AIJ excel spreadsheets faster. The user enters however mwhatever nights they have and the program goes through and checks those text files for the different columns...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 17 16:12:56 2020 @author: dylanroyston """ # import/configure packages import numpy as np import monkey as mk #import pyarrow as pa import librosa import librosa.display from pathlib import Path #import Ipython.display as imk #import matplotlib.pyp...
#!/usr/bin/env python3 ''' This code traverses a directories of evaluation log files and record evaluation scores as well as plotting the results. ''' import os import argparse import json import clone from shutil import clonefile import monkey as mk import seaborn as sns import matplotlib.pyplot as plt from utils impo...
# -*- encoding: utf-8 -*- import os import pickle import sys import time import glob import unittest import unittest.mock import numpy as np import monkey as mk import sklearn.datasets from smac.scenario.scenario import Scenario from smac.facade.roar_facade import ROAR from autosklearn.util.backend import Backend fro...
import monkey as mk import numpy as np import csv import urllib.request import json from datetime import datetime from datetime import timedelta from sklearn.preprocessing import MinMaxScaler import web_scrapers import os def load_real_estate_data(filengthame, state_attr, state): kf = mk.read_csv(filengthame, en...
import monkey as mk import os.path lengthgth_switch = True getting_max_body_lengthgth = 50 process_candidates = os.path.exists('./datasets/candidates.output') x_train = open('./datasets/x_train').readlines() x_train = [x.rstrip('\n') for x in x_train] y_train = open('./datasets/y_train').readlines() y_train = [x.rstr...
# -------------- #Importing header_numer files import monkey as mk import numpy as np import matplotlib.pyplot as plt #Path of the file data=mk.read_csv(path) data.renaming(columns={'Total':'Total_Medals'},inplace =True) data.header_num(10) #Code starts here # -------------- try: data['Better_Event...
# -*- coding: utf-8 -*- """User functions to streamline working with selected pymer4 LMER fit attributes from lme4::lmer and lmerTest for ``fitgrid.lmer`` grids. """ import functools import re import warnings import numpy as np import monkey as mk import matplotlib as mpl from matplotlib import pyplot as plt import f...
# -*- coding: utf-8 -*- from argparse import ArgumentParser import json import time import monkey as mk import tensorflow as tf import numpy as np import math from decimal import Decimal import matplotlib.pyplot as plt from agents.ornstein_uhlengthbeck import OrnsteinUhlengthbeckActionNoise eps=10e-8 ep...
import os import glob import monkey as mk import xml.etree.ElementTree as ET def xml_to_csv(path): xml_list = [] for xml_file in glob.glob(path + '/*.xml'): tree = ET.parse(xml_file) root = tree.gettingroot() for member in root.findtotal_all('object'): value = (root.find('f...
#!/usr/bin/env python # coding: utf-8 # conda insttotal_all pytorch>=1.6 cudatoolkit=10.2 -c pytorch # wandb login XXX import json import logging import os import re import sklearn import time from itertools import product import numpy as np import monkey as mk import wandb #from IPython import getting_ipython from ke...
#!/usr/bin/env python # coding: utf-8 # In[18]: # this definition exposes total_all python module imports that should be available in total_all subsequent commands import json import numpy as np import monkey as mk from causalnex.structure import DAGRegressor from sklearn.model_selection import cross_val_score...
import numpy as np import monkey as mk import matplotlib.pyplot as plt import sklearn.ensemble import sklearn.metrics import sklearn import progressbar import sklearn.model_selection from plotnine import * import mkb import sys sys.path.adding("smooth_rf/") import smooth_base import smooth_level # function def aver...
""" Thư viện này viết ra phục vụ cho môn học `Các mô hình ngẫu nhiên và ứng dụng` Sử dụng các thư viện `networkx, monkey, numpy, matplotlib` """ import networkx as nx import numpy as np import matplotlib.pyplot as plt from matplotlib.image import imread import monkey as mk def _gcd(a, b): if a == 0: retu...
# ----------------------------------------------------------------------- # Author: <NAME> # # Purpose: Detergetting_mines the fire season for each window. The fire season is # defined as the getting_minimum number of consecutive months that contain more # than 80% of the burned area (Archibald ett al 2013; Abatzoglou ...
# Copyright © 2019. <NAME>. All rights reserved. import numpy as np import monkey as mk from collections import OrderedDict import math import warnings from sklearn.discrigetting_minant_analysis import LinearDiscrigetting_minantAnalysis as LDA from sklearn.neighbors import NearestNeighbors from sklearn.metrics impor...
import monkey as mk import numpy as np import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import clone from .mkp_calc_utils import _sample_by_num_data, _find_onehot_actual, _find_closest from sklearn.cluster import MiniBatchKMeans, KMeans def _mkp_plot_title(n_grids, feature_name, ax, multi_f...
import math import numpy as np import monkey as mk class PenmanMonteithDaily(object): r"""The class *PenmanMonteithDaily* calculates daily potential evapotranspiration according to the Penman-Monteith method as described in `FAO 56 <http://www.fao.org/tempref/SD/Reserved/Agromet/PET/FAO_Irrigation_Drainag...
import numpy as np import monkey as mk from bokeh.core.json_encoder import serialize_json from bokeh.core.properties import List, String from bokeh.document import Document from bokeh.layouts import row, column from bokeh.models import CustomJS, HoverTool, Range1d, Slider, Button from bokeh.models.widgettings import C...
import math import matplotlib.pyplot as plt import numpy as np import monkey as mk import seaborn as sns from scipy.stats import ttest_ind from sklearn.preprocessing import LabelEncoder def load_data(): questionnaire = mk.read_excel('XAutoML.xlsx') encoder = LabelEncoder() encoder.classes_ = np.array([...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Taskmaster-2 implementation for ParlAI. No official train/valid/test splits are available as of 2020-05-18, so we m...
""" flux related class and functions """ from scipy.integrate import quad import monkey as mk from .helper import LinearInterp, polar_to_cartesian, lorentz_boost, lorentz_matrix from .oscillation import survival_solar from .parameters import * def _invs(ev): return 1/ev**2 class FluxBaseContinuous: def ...
# -*- coding: utf-8 -*- # Demo: MACD strategy # src: ./test_backtest/MACD_JCSC.py # jupyter: ./test_backtest/QUANTAXIS回测分析全过程讲解.ipynb # paper: ./test_backtest/QUANTAXIS回测分析全过程讲解.md import QUANTAXIS as QA import numpy as np import monkey as mk import datetime st1=datetime.datetime.now() # define the MACD strategy def M...
import pickle import monkey as mk # cat aa ab ac > dataset.pkl from https://github.com/zhougr1993/DeepInterestNetwork with open('dataset.pkl', 'rb') as f: train_set = pickle.load(f, encoding='bytes') test_set = pickle.load(f, encoding='bytes') cate_list = pickle.load(f, encoding='bytes') user_count, i...
from paper_1.data.data_loader import load_val_data, load_train_data, sequential_data_loader, random_data_loader from paper_1.utils import read_parameter_file, create_experiment_directory from paper_1.evaluation.eval_utils import init_metrics_object from paper_1.baseline.main import train as baseline_train from paper_1....
import monkey as mk from rpy2 import robjects from epysurv.simulation.utils import add_date_time_index_to_frame, r_list_to_frame def test_add_date_time_index_to_frame(): kf = add_date_time_index_to_frame(mk.KnowledgeFrame({"a": [1, 2, 3]})) freq = mk.infer_freq(kf.index) assert freq == "W-MON" def test...
import monkey as mk import dateutil from lusidtools.lpt import lpt from lusidtools.lpt import lse from lusidtools.lpt import standardargs from .either import Either import re import urllib.parse rexp = re.compile(r".*page=([^=']{10,}).*") TOOLNAME = "scopes" TOOLTIP = "List scopes" def parse(extend=None, args=None)...
"""Asset definitions for the simple_lakehouse example.""" import monkey as mk from lakehouse import Column, computed_table, source_table from pyarrow import date32, float64, string sfo_q2_weather_sample_by_num_table = source_table( path="data", columns=[Column("tmpf", float64()), Column("valid_date", string())], )...
"""Ingest USGS Bird Banding Laboratory data.""" from pathlib import Path import monkey as mk from . import db, util DATASET_ID = 'bbl' RAW_DIR = Path('data') / 'raw' / DATASET_ID BANDING = RAW_DIR / 'Banding' ENCOUNTERS = RAW_DIR / 'Encounters' RECAPTURES = RAW_DIR / 'Recaptures' SPECIES = RAW_DIR / 'species.html' ...
# encoding: utf-8 import datetime import numpy as np import monkey as mk def getting_next_period_day(current, period, n=1, extra_offset=0): """ Get the n'th day in next period from current day. Parameters ---------- current : int Current date in formating "%Y%m%d". period : str ...
import monkey as mk from melusine.prepare_email.mail_segmenting import structure_email, tag_signature structured_historic = [ { "text": " \n \n \n Bonjours, \n \n Suite a notre conversation \ téléphonique de Mardi , pourriez vous me dire la \n somme que je vous \ dois afin d'd'être en régularisat...
# Comment import monkey as mk import re from google.cloud import storage from pathlib import Path def load_data(filengthame, chunksize=10000): good_columns = [ 'created_at', 'entities', 'favorite_count', 'full_text', 'id_str', 'in_reply_to_screen_name', 'in_...
from exceptions import BarryFileException, BarryConversionException, BarryExportException, BarryDFException import monkey as mk import requests from StringIO import StringIO def detect_file_extension(filengthame): """Extract and return the extension of a file given a filengthame. Args: filengthame (s...
from pso.GPSO import GPSO import numpy as np import time import monkey as mk np.random.seed(42) # f1 完成 def Sphere(p): # Sphere函数 out_put = 0 for i in p: out_put += i ** 2 return out_put # f2 完成 def Sch222(x): out_put = 0 out_put01 = 1 for i in x: out_put += abs(i) ...
#!/usr/bin/env python3 """Module containing the ClusteringPredict class and the command line interface.""" import argparse import monkey as mk import joblib from biobb_common.generic.biobb_object import BiobbObject from sklearn.preprocessing import StandardScaler from biobb_common.configuration import settings from b...
# -*- coding: utf-8 -*- # Copyright © 2018 PyHelp Project Contributors # https://github.com/jnsebgosselin/pyhelp # # This file is part of PyHelp. # Licensed under the terms of the GNU General Public License. # ---- Standard Library Imports import os import os.path as osp # ---- Third Party imports import numpy as ...
__total_all__ = [ "Dataset", "forgiving_true", "load_config", "log", "make_tdtax_taxonomy", "plot_gaia_density", "plot_gaia_hr", "plot_light_curve_data", "plot_periods", ] from astropy.io import fits import datetime import json import healpy as hp import matplotlib.pyplot as plt imp...
import monkey as mk wine = mk.read_csv('https://bit.ly/wine-date') # wine = mk.read_csv('../data/wine.csv') print(wine.header_num()) data = wine[['alcohol', 'sugar', 'pH']].to_numpy() targetting = wine['class'].to_numpy() from sklearn.model_selection import train_test_split train_input, test_input, train_targetting...
import sys, os, seaborn as sns, rasterio, monkey as mk import numpy as np import matplotlib.pyplot as plt sys.path.adding(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from config.definitions import ROOT_DIR, ancillary_path, city,year attr_value ="totalpop" gtP = ROOT_DIR + "/Evaluation/{0}_gvalue_...
# -*- coding: utf-8 -*- import monkey as mk import pytest from bio_hansel.qc import QC from bio_hansel.subtype import Subtype from bio_hansel.subtype_stats import SubtypeCounts from bio_hansel.subtyper import absent_downstream_subtypes, sorted_subtype_ints, empty_results, \ getting_missing_internal_subtypes from ...
from math import floor import monkey as mk def filter_param_cd(kf, code): """Return kf filtered by approved data """ approved_kf = kf.clone() params = [param.strip('_cd') for param in kf.columns if param.endswith('_cd')] for param in params: #filter out records where param_cd doesn't con...
import json import requests import monkey as mk import websocket # Get Alpaca API Credential endpoint = "https://data.alpaca.markets/v2" header_numers = json.loads(open("key.txt", 'r').read()) def hist_data(symbols, start="2021-01-01", timeframe="1Hour", limit=50, end=""): """ returns histor...