data_types_dict = {'id': str} df = df.astype(data_types_dict) # checking the data types # using df.dtypes method df.dtypes