I'm currently trying to merge 2 dataframes based on a "key" that is created as a combination of alphanumeric and special characters. I'm getting a "Value error: can not merge DataFrame with instance of type
I'm aware this topic is covered in the thread below, however, the issue seemed very simple in that case where one of the dataset was not a Dataframe.
Python pandas: "can not merge DataFrame with instance of type <class 'str'>"
I have, on the other hand, checked both the datasets I want to merge are of type "DataFrame". So could it be that the "key" I'm using to combine the two dataframes has special characters in it? For ex, one such key could look like "1078-ORD-XHKG-HKDOct-23ATM". I do have similar keys in both dataframes for the merging to proceed, yet I get a Value error.
The code used to merge is simply-
df_new = pd.merge('df_1', 'df_2', on = 'key', how = 'left')
I have tried using the other ways of merging as suggested in other threads as well. Still doesn't help. Can someone please help?
