This file contains 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 os | |
from PIL import Image | |
import argparse | |
def replace_path(file_path_png, file_path_jpg, directory, full_check=True): | |
"""Replace the file path of the original .png to the new .jpg file inside all the .md files. If no "directory" is defined, it will replace at the current folder level. | |
Args: | |
file_path_png (str): Full path to the .png file. |
This file contains 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 os | |
from datetime import datetime | |
import csv | |
import pandas as pd | |
from pathlib import Path | |
# Inputs | |
directory = 'C:\OneNote' | |
name_length = 15 |
This file contains 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 json | |
data = json.load(open("bitwarden_export_20221019000142.json", encoding='utf-8')) | |
totp_keepass = "TimeOtp-Secret-Base32" | |
# data['items'][2]['fields'][0]['name'] == totp_keepass | |
i = 0 | |
for index1, value1 in enumerate(data['items']): | |
if 'fields' in value1: | |
# print('value1', value1, "\n"*5) |
This file contains 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
# After https://www.linkedin.com/posts/pablo-rosa-2b1183aa_datascience-dataanalytics-python-activity-6937455012306386944-xdx1?utm_source=linkedin_share&utm_medium=member_desktop_web | |
import pandas as pd | |
df = pd.DataFrame(data={'First Row': [1,2,3], 'secnond row':[4,5,6], 'THIRD_ROW':[7,8,9]}) | |
def clean_col(name): | |
return ( | |
name.strip().lower().replace(" ", "_") | |
) |
This file contains 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
while True: | |
try: | |
# do stuff | |
except SomeSpecificException: | |
continue | |
break |
This file contains 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
# %% | |
x = 0 | |
print(x) | |
# %% | |
def no_global(): | |
x = 2 | |
return x |
This file contains 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 | |
df = pd.read_excel(open('Example.xlsx', 'rb'), sheet_name='Data') | |
start_time = '20:15' | |
end_time = '9:15' | |
index = pd.DatetimeIndex(df['Date_Time']) | |
df = df.iloc[index.indexer_between_time(start_time, end_time)] |