forked from avinashkranjan/Amazing-Python-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutomated_Data_Reporting.py
29 lines (22 loc) · 1010 Bytes
/
Automated_Data_Reporting.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import pandas as pd
def generate_data_report(data_file_path, report_file_path):
df = pd.read_csv(data_file_path)
summary_statistics = df.describe()
column_means = df.mean()
column_max_values = df.max()
column_min_values = df.min()
with open(report_file_path, 'w') as report_file:
report_file.write("Data Report\n")
report_file.write("Summary Statistics:\n")
report_file.write(str(summary_statistics) + "\n\n")
report_file.write("Column Means:\n")
report_file.write(str(column_means) + "\n\n")
report_file.write("Column Maximum Values:\n")
report_file.write(str(column_max_values) + "\n\n")
report_file.write("Column Minimum Values:\n")
report_file.write(str(column_min_values))
if __name__ == "__main__":
data_file_path = "path/to/your/data.csv"
report_file_path = "path/to/your/report.csv"
generate_data_report(data_file_path, report_file_path)
print("Data report generated successfully!")