You should ensure that the column only contains values that can be safely converted to integers. If you have non-integer values, you'll need to clean or preprocess the data before using astype(int).