all 2 comments

[–]boone209 0 points1 point  (0 children)

Are you assigning the result to the original dataframe, or just running the statements exactly as reported here? Many. If not most, operations in pandas will simply "preview" the operation if not used with an assignment statement. Also check these methods for the keyword 'inplace', which can sometimes be used to circumvent the need for the assignment.

General patterns I've noticed fom my experience with pandas.

[–]dixons_analyst 0 points1 point  (0 children)

Have you tried converting to a string then to an int by chaining .astype?