Why use a double square bracket in Pandas?
In python, []
returns a Pandas series
object while the [[]]
returns a data frame.
For the fit()
function, it expects the X to be a data frame with 1 or more features. hence, [[]]
are used.
In python, []
returns a Pandas series
object while the [[]]
returns a data frame.
For the fit()
function, it expects the X to be a data frame with 1 or more features. hence, [[]]
are used.