I have 2 dataframes with exactly similar columns.
Except that the data type definitions are not.
I want to ensure that both dataframes share similar data types.
For example, let's assume only 1 column for both dataframes.
Dataframe_A
KPI
10
144
14
..
Dataframe_B
KPI
10
144
14
..
Both dataframes have the same column which is KPI.
However KPI from Dataframe A is defined as string but KPI from Dataframe B is defined as numeric.
I have hundreds of columns.
Is there a faster way than redefining the column type one by one?
I want to use one of the dataframe as reference. For example Dataframe B should follow Dataframe A column types.
Thanks!
Current solution is not ideal, as I need to define all the columns one by one.