Posted on:

15 Nov 2026

0

df_comp.set_index("date", inplace=True) -> keyword to be deprecated in the future

Got this warning when I tried to run the line of code above under the "Using Dates as Indices" lecture:


Pandas4Warning: The inplace keyword in DataFrame.set_index is deprecated and will be removed in a future version (PDEP-8).
See https://pandas.pydata.org/docs/dev/whatsnew/v3.1.0.html#deprecation-inplace for more details.
  df_comp.set_index("date", inplace=True)

0 answers ( 0 marked as helpful)

Submit an answer