You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When df.index.inferred_type is 'floating', df.ix[start:end] uses only label-based indexing only when bothstart and end are floating on the getitem side but when eitherstart or end are floating on the setitem side (where start and end are both either integers or floats within epsilon of integers)
In [2]: df=p.DataFrame(["a", "b", "c", "d"], index=[1.00, 2.00, 3.00, 4.00])
In [3]: df.ix[1.0:4] # uses positional indexing to get last three rowsOut[3]:
02b3c4dIn [4]: df.ix[1.0:4.0] # uses label-based indexing to get all four rowsOut[4]:
01a2b3c4dIn [5]: df.ix[1.0:4] ="y"# uses label-based indexing to set all four rowsIn [6]: dfOut[6]:
01y2y3y4yIn [7]: df.ix[1.0:4.0] ="z"# uses label-based indexing to set all four rowsIn [8]: dfOut[8]:
01z2z3z4z
The text was updated successfully, but these errors were encountered:
Seems like changing the getitem behavior to match setitem breaks lots of unit tests, while the reverse does not, so I will go with the latter...
Results after fix:
In [2]: df=p.DataFrame(["a", "b", "c", "d"], index=[1.00, 2.00, 3.00, 4.00])
In [3]: df.ix[1.0:4] # uses positional indexing to get last three rowsOut[3]:
02b3c4dIn [4]: df.ix[1.0:4.0] # uses label-based indexing to get all four rowsOut[4]:
01a2b3c4dIn [5]: df.ix[1.0:4] ="y"# uses positional indexing to set last three rowsIn [6]: dfOut[6]:
01a2y3y4yIn [7]: df.ix[1.0:4.0] ="z"# uses label-based indexing to set all four rowsIn [8]: dfOut[8]:
01z2z3z4z
When df.index.inferred_type is 'floating', df.ix[start:end] uses only label-based indexing only when both start and end are floating on the getitem side but when either start or end are floating on the setitem side (where start and end are both either integers or floats within epsilon of integers)
The text was updated successfully, but these errors were encountered: