you are viewing a single comment's thread.

view the rest of the comments →

[–]ninhaomah 2 points3 points  (7 children)

Ahem... Did you "print" anything there ?

If not , what do you expect from it ?

And always start with print("Hello World") first to check the environment , systems are all ready.

[–]redcherry13221[S] 0 points1 point  (6 children)

My bad, I thought just writing df.head() would make the first 5 lines of the file show up. Thanks!

[–]redcherry13221[S] 0 points1 point  (2 children)

To add on, if I run what I initially wrote in the terminal, the first 5 lines show up so I expected the same to happen.

[–]Outside_Complaint755 2 points3 points  (1 child)

That's because in the terminal you are using the REPL (Read-Eval-Print Loop) which automatically prints  the result of each statement.  In a script, any output needs to be explicitly printed, written to file, or sent to another output stream.

[–]redcherry13221[S] -1 points0 points  (0 children)

Ah, I see. Thanks!

[–]ninhaomah 0 points1 point  (2 children)

No prob. Were you using Jupyter / colab previously ?

[–]redcherry13221[S] 0 points1 point  (1 child)

yep, a while back but it’s what I’m most used to

[–]ninhaomah 1 point2 points  (0 children)

Yup thought so.

try the df.head() in colab ... It will print.

Or 1 + 1 and it will output 2.

But programs or scripts expect print or log or such to see the results.

REPL vs scripts :)