>
> In my opinion, when you did `df[20:50,:]`, you constructed a new 
> DataFrame, which had no longer anything to do with the original `df`. So 
> you cannot expect it to know the original position in `df`. And when you 
> print it, the row number (instead of index) is generated on the fly, just 
> let you know which value is at which line of the output.
>
> I think what needed here is just a formatted `print()` for DataFrame, 
> which can toggle the row number index.
>

When I do `df[20:50,:]`, the result is a subset of the original DataFrame 
`df`, so I should expect to keep track of the index in `df`. It doesn't 
take much to see why that is useful (an index often refers to a person, 
geographical entity, discrete period of time, etc).

Reply via email to