I have the following dataframe and when I apply melt function:
numerics = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64']
df_rm_features_melted = df_rm_features.melt(
id_vars=['id', 'date'],
value_vars=df_rm_features.select_dtypes(include=numerics).columns
)
I get the error: InvalidIndexError: Reindexing only valid with uniquely valued Index objects
id date factoring lglc overdue_60 distress max_dpd tr_op
0288 12/1/2018 0 1 1 1 0 0
0288 1/1/2019 0 0 0 0 10 1
0288 2/1/2019 0 0 0 0 2 1
0288 3/1/2019 0 0 0 0 52 1
0288 4/1/2019 0 0 0 1 2 0