intial commit (forked from private repo)

This commit is contained in:
2025-04-11 11:08:28 +02:00
commit 3bdd37f46c
154 changed files with 45901 additions and 0 deletions

13
extracted_cells/cell8.py Normal file
View File

@ -0,0 +1,13 @@
# Ersetzen von '?' durch NaN und dann durch den häufigsten Wert
df_clean = df.copy()
for col in df_clean.columns:
if df_clean[col].dtype == 'object':
# Ersetze '?' durch NaN
df_clean[col] = df_clean[col].replace('?', np.nan)
# Ersetze NaN durch den häufigsten Wert
most_frequent = df_clean[col].mode()[0]
df_clean[col] = df_clean[col].fillna(most_frequent)
df_clean.head(10)