6

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

3 Answers 3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Was having the same issue with Jupyter notebooks in vscode and this solved it. Thanks!
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.
0

Try the data viewer in our Jupyter support.

Comments

-1

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.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.