0

I want to split one dataframe into two different data frames based on one of the columns value

Eg: df(parents dataframe)

df has a column MODE with values swiggy , zomato

df1 with all the columns which has common with MODE = swiggy

df2 with all the columns which has common with MODE= Zomato

I know its simple, I am beginner, Please help. Thanks.

0

1 Answer 1

1

df1 = df[df['MODE'] == 'swiggy'] and df2 = df[df['MODE'] == 'Zomato'].

This way, you will be filtering the dataframe based on the MODE column and assigning the resulting dataframe to new variables.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.