0

Initially I wrote the following code in Google Cloab -

import numpy
dir(numpy)

And ran the notebook it displayed a long list of strings like

['ALLOW_THREADS', 'AxisError', 'BUFSIZE', 'CLIP', 'ComplexWarning', 'DataSource', 'ERR_CALL', . .

Then I modified the code to

import numpy

dir(numpy)
speed = [99, 86, 87, 88, 111, 86, 103, 87, 77, 85, 86]

x = numpy.mean(speed)
print(x)

Now it just displayed the mean - `90.45454545454545`
I am not sure why it didnt display the output for dir(numpy) now?
ravan
  • 37
  • 3
  • Does this answer your question? [How to display full output in Jupyter, not only last result?](https://stackoverflow.com/questions/36786722/how-to-display-full-output-in-jupyter-not-only-last-result) – paradocslover Jul 09 '21 at 12:12

1 Answers1

0

Because only prints are shown, or at maximum the last variables you are showing.

To fix it, add print() to dir(numpy):

import numpy

print(dir(numpy))
speed = [99, 86, 87, 88, 111, 86, 103, 87, 77, 85, 86]

x = numpy.mean(speed)
print(x)
SilentCloud
  • 1,677
  • 3
  • 9
  • 28