Jupyter Output is different from Output in Classroom

Screen Link:

What I expected to happen:
I have tried to upload the image, however, I can not. I am getting an error message that new users can not upload two images. Anyways, the output is properly formatted as in:

array([[  2016,      1,      1, ...,  11.65,  69.99,      1],
       [  2016,      1,      1, ...,      8,   54.3,      1],
       [  2016,      1,      1, ...,      0,   37.8,      2],

What actually happened:

So, basically I love to work in my Jupyter Notebook as I work in the classroom, this helps to reinforce conceots learned but I am surprised at the different outputs from platforms, what could be wrong?


Actually both outputs are the same, but in the Jupyter notebook, Numpy is returning the array with its elements with base 10.

But note that 2.016e+03 is the same as 2016 and 6.999e+01 is the same as 69.99.

It’s the same number and it won’t affect any type of math you do with them. If you want to see that they are actually the same, you can use the dtype parameter, like this:

taxi = np.array(converted_taxi_list, dtype=object)
1 Like

Thanks, @OctavioPalomeque, I have applied it in my code and it is properly formatted now as:

array([[2016.0, 1.0, 1.0, ..., 11.65, 69.99, 1.0],
       [2016.0, 1.0, 1.0, ..., 8.0, 54.3, 1.0],
       [2016.0, 1.0, 1.0, ..., 0.0, 37.8, 2.0],
1 Like

I’m glad I could help.
Just know that you tagged the wrong guy :joy: :joy: :joy:

Thank you! This helped me too!