just like code show below, I want to get the return values of value_counts() ,but c[i] just return the wrong order.so what's the best solution to get the value in right order
Name: 3000, dtype: int64
The problem stems from the mixed types serving as the index for the series. The value True is really 1, and the value False is really 0. So when you query c, it finds the value associated with c[False]. One fix might be to force True and False values to be stored as strings rather than booleans.
A better fix uses iloc.
>>> c.iloc 98
How is the data generated, though? The integer mixed in with booleans is confusing. Is that supposed to be there?