How to copy selected columns from a dataframe to another based on a column condition
Thanks Scott for your reply.
The first option worked!!!
The second option is giving error 'expr must be a string to be evaluated, <class 'pandas.core.series.Series'> given
Code : temp1 = df[['Music', 'Pop', 'Rock']].query(df.Rock == '1.0')
Say if I have a df with columns A,B,C,D.
I wanted to copy df to df1 columns A and B only based on a condition column C = 1.
Thanks for your help!!