4 ms·
To do that, the code would look something like: mask = events["Date"].year == 2020 events[mask].groupby("EventType").agg(first_date=("Date", min), last_date=("
by hervature 5y ago
To do that, the code would look something like:
mask = events["Date"].year == 2020
events[mask].groupby("EventType").agg(first_date=("Date", min), last_date=("Date", max), count=("Date", len))
Anyway, I don't understand why terseness is even desirable. We're doing DS and ML, no project never comes down to keystrokes but ability to search the docs and debug does matter.
- Bootvis 5y agoIt helps in quickly improving your understanding of the data by being able to answer simple but important questions quicker. In this contrived example I would want to know: - How many events by type - When did they happen - Are there any breaks in the count, why? - Some statistics on these events like average, min, max and so on. Terseness helps me in doing this fast.