ERROR while adding a new column in existing data frame #69
bakhtawar-ishaq
started this conversation in
General
Replies: 2 comments 1 reply
-
ADD inverted comas on each category |
Beta Was this translation helpful? Give feedback.
1 reply
-
Thankyou so much Usma. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I used this code to add new column to dataset:
df["age_groups"]= pd.cut(df["age"],[0,10,18,30,50,80],labels=["Kids,Child,Youth,Middle aged,Old"])
But it is not working and showing error which says:
"ValueError: Bin labels must be one fewer than the number of bin edges"
can anyone tell why?
Beta Was this translation helpful? Give feedback.
All reactions