I'm trying to fill out the missing indices with 0. I've tried some code from similar questions, but it didn't really do the trick fully.
I have a DataFrame:
df
2 1
5 5
When I use: df.reindex(range(df.index[0], df.index[-1] + 1), fill_value=0), I get:
df
2 1
3 0
4 0
5 5
I expect:
df
0 0
1 0
2 1
3 0
4 0
5 5