I created following dataframe priceearning_byyear, which is still incomplete:
Afterwards, I would like to "insert"/merge following series price into the above df:
The serie has one row (2021) too much, which I would like to remove when inserting into the above df.
My attempt is:
priceearning_byyear.merge(price.to_frame(), left_index=True)
But I got following error:
MergeError: Must pass right_on or right_index=True
If I use right_index=True, I'll get :
MergeError: Must pass left_on or left_index=True
I don't get it, why it doesn't work. Thank you for any pointer:-)


