The below column in data frame needs to be converted to int:
dsAttendEnroll.District.head()
0 DISTRICT 01
1 DISTRICT 02
2 DISTRICT 03
3 DISTRICT 04
4 DISTRICT 05
Name: District, dtype: object
Using astype gives the below error, how can this be done ?
dsAttendEnroll.District = dsAttendEnroll.District.map(lambda x: x[-2:]).astype(int)
ValueError: invalid literal for long() with base 10: 'LS'
LS...LSdata. Do you want to discard it or split it into a separate column (as suggested below)? IsLSvalid or invalid?