Greggs Menu
Greggs Menu

Reputation: 1

How can I create parent IDs for rows in a Pandas DataFrame based on multiple conditions?

I have a DataFrame where each row represents an event, and I need to generate a parent ID column that groups related rows based on specific conditions. For example, rows with similar timestamps or matching category values should have the same parent ID. The dataset I am working with includes menu data similar to the Greggs menu, where items might need to be grouped based on category, availability, or pricing rules. What is the best approach in Pandas to efficiently assign parent IDs while ensuring proper grouping?

Upvotes: 0

Views: 21

Answers (0)

Related Questions