Python cumsum() | Solving Python Optimization Questions On a Data Science Interview

preview_player
Показать описание
In this video, we'll take a close look at one of the larger families of data science questions concerning optimization. We’ll use the cumulative sum or cumsum() function to solve this complex python optimization question.

Link to the question:

______________________________________________________________________

______________________________________________________________________

Timeline:

Intro: (0:00​​​)
Understanding the data: (1:19)
Formulate the approach: How to use cumsum(): (2:04)
Formulate the approach: Data Preparation: (07:05)
Code execution: (08:51)
Conclusion: (18:19​​)

______________________________________________________________________

About The Platform:

______________________________________________________________________

Contact:

If you have any questions, comments, or feedback, please leave them here!
______________________________________________________________________
Рекомендации по теме
Комментарии
Автор

There can be an edge case that the code missed, a train arriving just before the end of the day and departing at the start of another day, for example, arrival at 23:58 and departure at 00:02 would give a wrong answer. Nevertheless, this is a great way of solving the question after accounting for the edge case and was very helpful. Thanks.

shivamroy
Автор

Very clever. Never thought cumsum() can be used to solve questions like this. Also it takes a genius to mark arrival as 1 and departure as -1.

jianhongsong
Автор

Cumulative Sum: -_-
Cumsum: Neuron Activation

vishwaschaudhary
Автор

Hey bro can you help me in this question;
Question ID: 9629. Find how many hosts are verified by the Airbnb staff and how many aren't.

AkshayKumar-uzxo
visit shbcf.ru