SIENTIAPDE-1645: code snapshot (part 1)

This commit is contained in:
vitor-aignosi
2026-07-16 13:29:23 -03:00
commit 40f26bcf17
114 changed files with 18654 additions and 0 deletions

24
t.py Normal file
View File

@@ -0,0 +1,24 @@
# %%
from pandas import read_csv, to_datetime
df = read_csv('data-1780946658143.csv')
# %%
df.head()
# %%
# normalize timestamp to naive "yyyy-MM-dd HH:mm:ss" (drop the "+00" UTC offset)
df['timestamp'] = to_datetime(df['timestamp'], utc=True).dt.tz_localize(None)
df['timestamp'] = df['timestamp'].dt.strftime('%Y-%m-%d %H:%M:%S')
# %%
# pivot the dataframe
df = df.pivot(index='timestamp', columns='variable', values='value')
# %%
df.head()
# %%
df.to_csv('data-1780946658143-pivot.csv')
# %%