This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Config: | |
# MODE | |
PROD = True | |
IS_SANDBOX_ENV = True | |
TRAINING = False # Prepare data for training/inference if True/False. No Training or Inference executed. Use DO_TRAIN or DO_SERVE. | |
DO_TRAIN = False # Run model training if True | |
DO_SERVE = True # Run model predict if True | |
GENERATE_DATA = True # generate, features, targets if True | |
PRINT_CHECKS = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<999950]0.0,"K";[<999950000]0.0,,"M";0.0,,,"B" | |
# Convert | |
# 7000 -> 7K | |
# 2000000 -> 2M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
def reduce(df): | |
cols = df.dtypes.index.tolist() | |
types = df.dtypes.values.tolist() | |
for i,t in enumerate(types): | |
if 'int' in str(t): | |
if df[cols[i]].min() > np.iinfo(np.int8).min and df[cols[i]].max() < np.iinfo(np.int8).max: | |
df[cols[i]] = df[cols[i]].astype(np.int8) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python number formatter into string with unit | |
def human_format(num, precision=2, suffixes=['', 'K', 'M', 'G', 'T', 'P']): | |
m = sum([abs(num/1000.0**x) >= 1 for x in range(1, len(suffixes))]) | |
return f'{num/1000.0**m:.{precision}f}{suffixes[m]}' | |
print('the answer is %s' % human_format(7454538)) | |
# prints 'the answer is 7.45M' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo hwclock -s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### README | |
# This Python scripts exports all the OneNote notebooks linked to your Microsoft account to HTML files. | |
## Output | |
# The notebooks will each become a subdirectory of the `output` folder, with further subdirectories | |
# for the sections within each notebook and the pages within each section. Each page is a directory | |
# containing the HTML file `main.html` and two directories `images` and `attachments` (if necessary) | |
# for the images and attachments. Any sub-pages will be subdirectories within this one. | |
## Setup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ScriptLab Search Wiki | |
description: Search Wikipedia based on the selected text. | |
host: POWERPOINT | |
api_set: {} | |
script: | |
content: | | |
$("#insert").click(run); | |
Office.onReady((info) => { | |
console.log(info.host); |