Reputation: 600
I have a dataframe with multiple columns and one of the columns book_no has multiple numbers separated by comma. I want to count those and assign it to a columns called as total_books_by_each_user. Example:
data['book_no']
1,2,3,5,10,11
Any possible solution to do this?
I tried this, but didn't work.
data.book_no.count(",") + 1
book number is of object type.
Upvotes: 2
Views: 185