I want to select rows listed in my list from a dataframe. When I use the command :
list1 = ['Row2-Column2','Row3-Column2']
df2 = df1[df1.columns.isin(list1)]
where df1 is
Row1_Column1 Row1-Column2 Row1-Column3 Row1-Column4 2 Row1-Column6
Row2_Column1 Row2-Column2 Row2-Column3 Row2-Column4 3 Row2-Column6
Row3_Column1 Row3-Column2 Row3-Column3 Row3-Column4 1 Row3-Column6
Row4_Column1 Row4-Column2 Row4-Column3 Row4-Column4 2 Row4-Column6
i am getting the error:
Item wrong length 1 instead of 3
Please let me know where I am getting wrong.
Thanks
SS