These are the two dfs
Rating = ['A', 'AAA', 'AA', 'BBB', 'BB', 'B']
val = [4560.0, 64.0, 456.0, 34.0, 534.0, 54.0]
df = pd.DataFrame(dict(zip(Rating,val)),index=[0]).T
df.columns = ['values']
df1 = pd.DataFrame(['AA','AA','AA','AA','A','A'],columns=['Rating'])
df1.set_index('Rating',inplace=True)
df1 = df1.merge(df,left_index=True,right_index=True)
I used merge which work, but problem is it doesnt preserve the sequence of my original df1 dataFrame
df1 = df1.merge(df,left_index=True,right_index=True)
How can I run merge and preserve the sequence as well?
edited################
I want the sequencing to be what was in the original df i.e. ['AA','AA','AA','AA','A','A']
