I have imported data into dataframe. Some columns have been formatted as float64 but when I try to convert to int, I get a ValueError and 'cannot convert non-finite values to integer'??
Here is my code. Can anyone advise where I have gone wrong?
Here is my code. Can anyone advise where I have gone wrong?
df_16[['1.1 Large employers and higher managerial and administrative occupations', '1.2 Higher professional occupations', '2. Lower managerial, administrative and professional occupations', '3. Intermediate occupations', '4. Small employers and own account workers', '5. Lower supervisory and technical occupations', '6. Semi-routine occupations', '7. Routine occupations', 'L14.1 Never worked', 'L14.2 Long-term unemployed', 'L15 Full-time students', 'L17 Not classifiable for other reasons']] = df_16[['1.1 Large employers and higher managerial and administrative occupations', '1.2 Higher professional occupations', '2. Lower managerial, administrative and professional occupations', '3. Intermediate occupations', '4. Small employers and own account workers', '5. Lower supervisory and technical occupations', '6. Semi-routine occupations', '7. Routine occupations', 'L14.1 Never worked', 'L14.2 Long-term unemployed', 'L15 Full-time students', 'L17 Not classifiable for other reasons']].round(0).astype(int)