0

enter image description here

In the above image, I colored some rows with the same colors, so I want to create new data frames with the values of the same color. as you can see, the values of the same color are the same as an example - 0.8 multiple and CE option type values rows, in this entire data frame these same values come in 2 times, so I want to create these 3 rows new data frame, and like the same i want to do for all rows.

1 Answer 1

2

Below is some code that may help you.

df_dictionary = dict(tuple(your_dataframe.groupby('columns_to_groupby')))

This will produce a dictionary whose keys are the grouped values (in your case, "CE, PE, etc...") and whose values are the dataframes split by the grouping specified. Hope this helps.

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

2 Comments

Thank You. It's solved my problem.
Perfect, glad to hear that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.