From the course: Faster pandas

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Identify bottleneck

Challenge: Identify bottleneck

From the course: Faster pandas

Start my 1-month free trial

Challenge: Identify bottleneck

(upbeat music) - [Instructor] We have a CSV file with fake data from real time bidding system. Our code calculate the median difference between the highest price and the second to highest price in every bid. So we have the median diff that gets the name of the CSV file, we read the CSV file, we group by the ID and get the maximum price, and we group by ID and we get the second to maximum price, and this is the function we wrote on the top you can see it on line four. And then we calculate the diffs and within the median of the diffs. Find out where the code is spending its time. Use bids.csv.xz for data.

Contents