Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -135,9 +135,9 @@ def generate_ai_dashboard(df, api_key):
|
|
135 |
# Generate data summary
|
136 |
column_info = {col: {
|
137 |
'dtype': str(df[col].dtype),
|
138 |
-
'unique_values': df[col].nunique(),
|
139 |
-
'missing_values': df[col].isna().sum(),
|
140 |
-
'sample': df[col].dropna().sample(min(5, len(df))).tolist()
|
141 |
} for col in df.columns}
|
142 |
|
143 |
# Prepare prompt
|
|
|
135 |
# Generate data summary
|
136 |
column_info = {col: {
|
137 |
'dtype': str(df[col].dtype),
|
138 |
+
'unique_values': int(df[col].nunique()),
|
139 |
+
'missing_values': int(df[col].isna().sum()),
|
140 |
+
'sample': [str(x) for x in df[col].dropna().sample(min(5, len(df))).tolist()]
|
141 |
} for col in df.columns}
|
142 |
|
143 |
# Prepare prompt
|