We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2274d7b commit 4430621Copy full SHA for 4430621
src/jupyter_contrib_nbextensions/nbextensions/varInspector/var_list.py
@@ -3,7 +3,7 @@
3
4
from IPython import get_ipython
5
from IPython.core.magics.namespace import NamespaceMagics
6
-
+import numpy as np
7
_nms = NamespaceMagics()
8
_Jupyter = get_ipython()
9
_nms.shell = _Jupyter.kernel.shell
@@ -12,7 +12,9 @@
12
def _getsizeof(x):
13
# return the size of variable x. Amended version of sys.getsizeof
14
# which also supports ndarray, Series and DataFrame
15
- if type(x).__name__ in ['ndarray', 'Series']:
+ if type(x) is np.ndarray:
16
+ return x.shape
17
+ elif type(x).__name__ in ['ndarray', 'Series']:
18
return x.nbytes
19
elif type(x).__name__ == 'DataFrame':
20
return x.memory_usage().sum()
0 commit comments