This commit is contained in:
2024-09-30 19:27:17 +02:00
parent 9a1615c1ea
commit 1c3f79605b
6 changed files with 58653 additions and 2 deletions

View File

@@ -3,5 +3,5 @@
<component name="Black"> <component name="Black">
<option name="sdkName" value="Python 3.12 (pythonProject)" /> <option name="sdkName" value="Python 3.12 (pythonProject)" />
</component> </component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (pythonProject)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (pythonProject)" project-jdk-type="Python SDK" />
</project> </project>

View File

@@ -5,7 +5,7 @@
<excludeFolder url="file://$MODULE_DIR$/.venv" /> <excludeFolder url="file://$MODULE_DIR$/.venv" />
<excludeFolder url="file://$MODULE_DIR$/venv" /> <excludeFolder url="file://$MODULE_DIR$/venv" />
</content> </content>
<orderEntry type="jdk" jdkName="Python 3.11 (pythonProject)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.8 (pythonProject)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
import json
def csv_to_json(input_file: str, output_file: str):
data = []
# Step 1: Read the CSV file manually
with open(input_file, 'r') as file:
lines = file.readlines()
# Step 2: Parse the first line to get the headers
headers = lines[0].strip().split(';')
# Step 3: Parse the subsequent lines to get the data
for line in lines[1:]:
values = line.strip().split(';')
# Create a dictionary for each row
row_dict = {headers[i]: values[i] for i in range(len(headers))}
data.append(row_dict)
# Step 4: Save the data to a JSON file
with open(output_file, 'w') as json_file:
json.dump(data, json_file, indent=4)
# Usage
input_csv_file = 'AmesHousing.csv'
output_json_file = 'AmesHousing.json'
csv_to_json(input_csv_file, output_json_file)

View 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)