1
0

Noticed anamolies in the data so manually corrected with an additional python script.

This commit is contained in:
Shaun Setlock
2023-12-28 21:22:53 -05:00
parent b5421232ea
commit b7410c37fb
6 changed files with 64159 additions and 0 deletions

21
data_repair.py Executable file
View File

@@ -0,0 +1,21 @@
import pandas as pd
file_path = './input/modified/statistics-export-id-30.csv'
df = pd.read_csv(file_path)
# Select only the necessary columns
df = df[['start_ts', 'sum', 'state']]
# Convert 'start_ts' column to datetime
df['start_ts'] = pd.to_datetime(df['start_ts'], unit='s')
# Save the data in the desired format to a text file
output_file_path = './output/repaired_id_30.txt'
with open(output_file_path, 'w') as f:
for index, row in df.iterrows():
f.write(f" - start: \"{row['start_ts']}+00:00\"\n")
f.write(f" state: {row['state']}\n")
f.write(f" sum: {row['sum']}\n")
print(f"Data saved to: {output_file_path}")