Dec-17-2019, 07:26 AM
hi,after scraping data i tried to clean it and i got the following error message
my code is the following :
and my aim is to get just the year without bracket
Quote:ValueError: Cannot convert non-finite values (NA or inf) to integerwhen i searched i found this error is raised when i have a empty field (but i verified my data and all the fields are not empty)
my code is the following :
test_df.loc[:'year'] = test_df['year'].str[-5,-1].astype(int)and the column of value that i want to clean has this values:
Quote:array(['(2017)', '(I) (2017)'], dtype=object)
and my aim is to get just the year without bracket