p2
This commit is contained in:
19
WS24_25/PyCharm/pythonProject/P2/summary.py
Normal file
19
WS24_25/PyCharm/pythonProject/P2/summary.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pandas as pd
|
||||
|
||||
|
||||
def summarize_csv(file_path: str):
|
||||
# Step 1: Load the CSV file using pandas
|
||||
df = pd.read_csv(file_path, delimiter=';')
|
||||
|
||||
# Step 2: Print general information about the data
|
||||
print("Data Info:")
|
||||
print(df.info())
|
||||
|
||||
# Step 3: Print statistical summary of the numerical columns
|
||||
print("\nStatistical Summary:")
|
||||
print(df.describe())
|
||||
|
||||
|
||||
# Usage
|
||||
input_csv_file = 'AmesHousing.csv'
|
||||
summarize_csv(input_csv_file)
|
||||
Reference in New Issue
Block a user