Last active
August 18, 2023 11:43
-
-
Save nonchris/bb6afd3e331782d339a5e0071eb94a09 to your computer and use it in GitHub Desktop.
things i did
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
""" | |
Things I did and always look up how I did it. | |
Feel free to suggest futher things you always forget :) | |
""" | |
# date format | |
f'{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}' | |
# current directory | |
f"{os.getcwd()}/{file_name}" | |
# numpy array from csv (boulder scraper) | |
percentage, time = np.loadtxt(f, | |
delimiter=";", | |
skiprows=1, | |
comments="#", | |
dtype={ | |
'names': ('percentage', 'time'), | |
'formats': ('i4', 'M8[m]')}, | |
converters={ | |
0: lambda i: i if i != b'None' else -10, | |
1: lambda t: dt.datetime.fromtimestamp(float(t))}, | |
usecols=(0, 1), | |
unpack=True | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment