I have data in different columns but I don\'t know how to extract it to save it in another variable.
index a b c 1 2 3 4 2 3 4 5
One different and easy approach : iterating rows
df1= pd.DataFrame() #creating an empty dataframe for index,i in df.iterrows(): df1.loc[index,'A']=df.loc[index,'A'] df1.loc[index,'B']=df.loc[index,'B'] df1.head()