why does Sklearn train test split returns pandas dataframe and not numpy array?

563 views python

From IBM Cognitive classes

The above fig is from ibm cognitive classes and the train test split is returning a numpy array.

picture from local

The above picture is from local and train test split is returning a pandas dataframe.

Wanted to know if there is specific reason for the same ?

sklearn version 0.19.1 on both devices.

local python 3.6.4 ibm python 3.6.5

answered question

1 Answer


The input variable y is a pandas data frame in my local and an numpy array in the ibm console.

Tiny error. Hope this helps to a beginner.

posted this

Have an answer?


Please login first before posting an answer.