Skip to content

Commit 285641b

Browse files
committed
convert bool to category and int64 to float
1 parent 9374fff commit 285641b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
File renamed without changes.

src/assets/synthetic-data.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def run():
151151
))
152152
153153
dtypes_dict = real_data.dtypes.to_dict()
154-
dtypes_dict = {k: 'float' if v == 'float64' else 'category' if v == 'O' else v for k, v in dtypes_dict.items()}
154+
dtypes_dict = {k: 'float' if (v == 'float64' or v == 'int64') else 'category' if (v == 'O' or v =='bool') else v for k, v in dtypes_dict.items()}
155155
if isDemo:
156156
dtypes_dict['sex'] = 'category'
157157
real_data['sex'] = real_data['sex'].map({1: 'male', 2: 'female'})
@@ -160,6 +160,9 @@ def run():
160160
'type': 'heading',
161161
'headingKey': 'syntheticData.columnsInDataset'
162162
}))
163+
print("dtypes_dict:", dtypes_dict)
164+
165+
163166
dataInfo = []
164167
for column in real_data.columns:
165168
dataInfo.append({

0 commit comments

Comments
 (0)