5

I'm opening a csv file in VS Code with Python. Your basic csv import. I know the complete csv data is reading properly because it's printing to macOS Terminal via Anaconda iPython as expected.

However, when I print the csv data to VS Code Interactive Window or VS Code iPython Window VS Code is truncating the data. It's not printing the csv header row and it's also truncating the length of the rest of the csv data and/or it starts the data output at some deep row like around row 1000.

The issue is not in code because it's printing fine in Terminal/iPython.

Naturally, I'm using the standard Microsoft Python extension and the iPython extension. The problem persists even when disabling one of them.

Is this a VS Code default preference issue?

VS Code Interactive Window
No header and following data is truncated both at beginning and end.
enter image description here
VS Code iPython Truncation
Again, no header, plus truncation.
enter image description here
Terminal/Conda iPython all good. Header and following data.
enter image description here

Edison
  • 11,881
  • 5
  • 42
  • 50

3 Answers3

13

You need to go to the Settings of the Python extension in VSCode and locate this setting:

Python › Data Science: Text Output Limit
Limit the amount of text in Python Interactive cell text output to this value. 0 to allow any amount of characters.

By default (for whatever reason) that is set to 2000. Change it to 0 to allow any number of characters showing in the output.

universality
  • 168
  • 6
  • 1
    Was having the same issue with Jupyter notebooks in vscode and this solved it. Thanks! – ucb Dec 19 '19 at 16:49
  • So sorry. Been so busy I never even noticed I didn't mark this correct after all this time. I also upvoted it. Great answer thank you. – Edison May 20 '20 at 00:24
0

Try the data viewer in our Jupyter support.

Brett Cannon
  • 14,438
  • 3
  • 45
  • 40
0

Recently I had been running into this same issue, but VSCode and the Python extension has moved the Data Science functionality to the Jupyter extension by now. To solve this, I refer to my answer to the same issue elsewhere.

TimeTerror
  • 546
  • 5
  • 5
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 03 '22 at 04:20