Closed jonasvdd closed 2 years ago
Indeed. Actually, @jorisvandenbossche, focusing more on method-chaining is worthwhile to check in general as it would increase consistency.
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.
Wanted to open an issue, but apparently there is already one -> https://github.com/pandas-dev/pandas/issues/19708
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