I am trying to find the mistake in my code:
import pandas as pd data = [[2012, 'Female'], [2013, 'Male'], [2014, 'Female']] df = pd.DataFrame(data, columns=['year', 'sex']) df.sex=df.sex.astype("int64")
This is the error I receive:
ValueError: invalid literal for int() with base 10: 'Female'
This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.