Home | My New Hugo Project

Python Pandas - how to copy dtypes to a new dataframe copy.

2022-05-25

obs1 is the source dataframe

 

“astype” actually copies the dataframe with type data and column data

 

new_data = obs1.astype(obs1.dtypes.to_dict())
new_data = new_date[0:1,:]