The pandas series
has two closely related attributes: Series.index
and Series.index.values
.
The first of these two returns the current index of some pandas index type. It is mutable, and can be used to change the index for the Series (a good thing).
The second returns an numpy.ndarray
. However, it is immutable, and retains the original index values regardless of subsequent changes to the index.
My question: what is the intent of the non-mutable Series.index.values
?
Edit:
Mmmm. just ignore this question - i cannot repeat the confusing behaviours of s.index.values I was seeing last night.