Vscode-jupyter: Bug: The variable explorer doesn't show the shape of np arrays in the "count" column

Created on 27 Mar 2020  路  6Comments  路  Source: microsoft/vscode-jupyter

Bug: The variable explorer doesn't show the shape of np arrays in the "count" column

Steps to cause the bug to occur

  1. Create two numpy arrays:
import numpy as np
x = np.array([1,2,3])
y = np.array([[1,2,3],[1,2,3]])
  1. Look at the variable explorer in the interactive window

Actual behavior

The "count" column shows only the number of rows I assume.

image

Expected behavior

I saw in a YouTube video that the "count" column should actually show the shape (x.shape)

image

I use a lot of linear algebra calculations with multi-dimensional arrays, so for me it is quite important to see the shape of an array at a glance. Workaround for me is using the iPython REPL to get the shape, which is clunky.

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: 2020.3.69010
  • VS Code version: 1.43.1
  • Setting python.jediEnabled: false
  • Python and/or Anaconda version: 3.7.7
  • OS: Windows
  • Virtual environment: N/A

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

Most helpful comment

Validated.

image.png

All 6 comments

Thanks for logging the issue @jay-pee. I was able to verify it on our end too so i think something changed since our december build of the extension.
image

Might be a regression? cc @rchiodo

nevermind, just looked through our previous issues. It's a duplicate of microsoft/vscode-python#10140. The explanation for why we can only show one dimension is below:

"We switched computing the value of the variable to use the jupyter ? command instead of running python code. This output doesn't seem to include the shape for ndarrays.

We did this so we could start supporting other kernels besides python."

Thank you for your fast answer.

If its not a bug then see it as a feature request ;) In my opinion the "count" column is quite meaningless for numpy arrays and maybe also confusing in the current state.

While this is a regression, it's not quite meeting the bar for must fix at this time.

I think this feature is really important for many data scientists.

Validated.

image.png

Was this page helpful?
0 / 5 - 0 ratings