jorisvandenbossche / DS-python-data-analysis

Data manipulation, analysis and visualisation in Python - specialist course Doctoral schools of Ghent University
https://jorisvandenbossche.github.io/DS-python-data-analysis/
BSD 3-Clause "New" or "Revised" License
104 stars 60 forks source link

Remark - case_1_bike_count #153

Closed jonasvdd closed 2 years ago

jonasvdd commented 2 years ago

image

I would propose to use the to_series() method as this allows for method-chaining (instead of encapsulating in the pd.Series constructor), thus increasing readability

stijnvanhoey commented 2 years ago

Indeed. Actually, @jorisvandenbossche, focusing more on method-chaining is worthwhile to check in general as it would increase consistency.

jorisvandenbossche commented 2 years ago

Yes, to_series is better here (I think our first version of the course predates this method :)) Sidenote: pandas should maybe just add a diff() method to Index as well.

jorisvandenbossche commented 2 years ago

Wanted to open an issue, but apparently there is already one -> https://github.com/pandas-dev/pandas/issues/19708