mars
mars copied to clipboard
[BUG] mars.dataframe.DataFrame.loc[i:j] semantics is different with pandas
Reporting a bug
import pandas as pd
import mars
import numpy as np
df = pd.DataFrame(np.random.rand(5,3))
sliced_df = df.loc[0:1]
# Out[6]: sliced_df
# 0 1 2
# 0 0.362741 0.466188 0.750695
# 1 0.775940 0.544655 0.711621
mars.new_session()
md = mars.dataframe.DataFrame(np.random.rand(5, 3))
sliced_md = md.loc[0:1]
sliced_md.execute()
# Out[14]: sliced_md
# 0 1 2
# 0 0.851917 0.508231 0.908007
As you can see, mars choose right open, while pandas choose right closed. They contain different behaviours.
Python 3.7.9 & Pandas 1.2.0 & mars 0.7.5