Python: Append from one dataframe to a new dataframe
Let's say this is your dataframe structure and name:
dataframe = pd.DataFrame(record, columns = ['Name', 'Age', 'Stream', 'Percentage']
Accordingly, the new dataframe can be created as :
rslt_df = dataframe[dataframe['Name'].isin(name_list)]
alternatively, you can use :
rslt_df = dataframe.loc[dataframe['Name'].isin(name_list)]
I have a dataframe which has 10 000 rows.
I need to extract the rows into a new dataframe according to a condition (where name is in name_list)
What is the easiest way to do this