Multiple Ways to Get the First Row for Each Group in Pandas

Use case Sometimes you just want to capture the first (or last) event of something. Let’s say, you have a list of clients and want to capture their first purchase. This is useful if you want a list of new paying customers. Dataset We’re thinking about customers here, so let’s get the Online Retail Dataset from the UCI Machine Learning Repository. We can download this dataset directly using Pandas. >>> import pandas as pd >>> customers = pd....

<span title='2020-12-03 19:12:26 -0600 -0600'>December 3, 2020</span>&nbsp;·&nbsp;7 min&nbsp;·&nbsp;Franccesco Orozco

The 4 Hard Truths Data Science Blogs Don't Teach You About

The wrong path to data science Let me give you some context first. A few years ago, I was on the road to data science. I wanted to learn everything about this field, the sole idea of building something intelligent that can help someone predict something amazed me. Inspired by this idea, I decided I wanted to become a data scientist, and like many others, I jumped from engineering to this new landscape....

<span title='2020-11-02 18:55:01 +0000 UTC'>November 2, 2020</span>&nbsp;·&nbsp;8 min&nbsp;·&nbsp;Franccesco Orozco