Reputation: 187
what is the difference between the two below code
my_data.iloc[:,2:3]
&
my_data.iloc[:,2]
why the result differ eventhough it seems same?
Upvotes: 1
Views: 42
Reputation: 323236
One output DataFrame
another one is return Series
type(df.iloc[2:3])
<class 'pandas.core.frame.DataFrame'>
type(df.iloc[2])
<class 'pandas.core.series.Series'>
Upvotes: 2