TypeError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_108972\3489082683.py in
----> 1 ande.ANDE.resample(“M”).last()
~\anaconda3\lib\site-packages\pandas\core\series.py in resample(self, rule, axis, closed, label, convention, kind, loffset, base, on, level, origin, offset)
5426 offset: TimedeltaConvertibleTypes | None = None,
5427 ) → Resampler:
→ 5428 return super().resample(
5429 rule=rule,
5430 axis=axis,
~\anaconda3\lib\site-packages\pandas\core\generic.py in resample(self, rule, axis, closed, label, convention, kind, loffset, base, on, level, origin, offset)
8311
8312 axis = self._get_axis_number(axis)
→ 8313 return get_resampler(
8314 self,
8315 freq=rule,
~\anaconda3\lib\site-packages\pandas\core\resample.py in get_resampler(obj, kind, **kwds)
1421 “”"
1422 tg = TimeGrouper(**kwds)
→ 1423 return tg._get_resampler(obj, kind=kind)
1424
1425
~\anaconda3\lib\site-packages\pandas\core\resample.py in _get_resampler(self, obj, kind)
1597 return TimedeltaIndexResampler(obj, groupby=self, axis=self.axis)
1598
→ 1599 raise TypeError(
1600 "Only valid with DatetimeIndex, "
1601 "TimedeltaIndex or PeriodIndex, "
TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of ‘Index’
When I use ande.ANDE.resample(“M”).last(), it doesn’t work. May I know how to fix this?