My attempt: df['uid'] = df.uid.astype(int)
Which works...! However, Python doesn't like it:
A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead
My question - what's the "best practice" of how to do this simple code?
Research so far:
Pandas: change data type of columns
A value is trying to be set on a copy of a slice from a DataFrame Warning
Attempts:
- df[df['uid']].astype(int)
...some of the links say to use iloc but I can't see how that can be used here...