Issue
I am new to python I was trying to automate some processes through pandas.
df['x'] = df['ID'].map(df5.set_index('x')['y'])
I want to make it generic like:
df['x'] = df['ID'].map(df5.set_index('x')[iloc[:,[5]]])
Solution
You are close, need seelct 6th column without []
:
df['x'] = df['ID'].map(df5.set_index('x').iloc[:,5])
Answered By - jezrael
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.