Is this a better way than pd.get_dummies
?
#20
Programmer-RD-AI
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
Hey there, It depends what you're trying to do. To me, the pandas Have you test the function versus the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
def object_to_int(data,column): index = -1 all_info = [] info_dict = {} for info in data[column]: if info not in info_dict: index = index + 1 info_dict[info] = index for info in data[column]: all_info.append(info_dict[info]) return (index,all_info,info_dict)
Is the above way better than
pd.get_dummies
?Beta Was this translation helpful? Give feedback.
All reactions