3

I am starting to use VS Code for my notebooks and using the Data Viewer to explore my dataframes is one of the reasons. However, to my disappointment, the index doesn't really seem to show up in the Data Viewer.

Some code to reproduce:

d = {'index_col': ['foo', 'bar'], 'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=d)
df.set_index('index_col', inplace=True)

Gets me with this dataframe:

index_col col1 col2
foo 1 3
bar 2 4

What I see in VS Code's Data Viewer:

enter image description here

My "categorical" index has been replaced by what seems to be a numerical index / row number.

Is there a way (setting?) to have the data viewer showing me the index?

1 Answer 1

3

@danabb. I believe that we have a bug open on this and a fix is in progress.

Issue: https://github.com/microsoft/vscode-jupyter/issues/5253 Fix PR in progress: https://github.com/microsoft/vscode-jupyter/pull/5254#pullrequestreview-619991659

This fix should be in our next major version release (roughly monthly).

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

3 Comments

Thanks: I thought about opening a GitHub issue myself before posting here, but I thought maybe I was missing some config trick to have the index displayed as I wanted.
This is still / again open in the latest VSCode. Any update?
@Lorenz If you are still seeing this could you please open up an issue on our GitHub here: github.com/microsoft/vscode-jupyter/issues that would be the best way for us to make sure this is fixed.

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.