Привет, я создаю массив numpy
x = np.array([2,3,1,0])
print (x)
, и когда я хочу распечатать его, я получаю эту ошибку:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-106-9558c6db9250> in <module>
1 x = np.array([2,3,1,0])
----> 2 print(x)
/opt/conda/lib/python3.7/site-packages/numpy/core/arrayprint.py in _array_str_implementation(a, max_line_width, precision, suppress_small, array2string)
1504 return _guarded_repr_or_str(np.ndarray.__getitem__(a, ()))
1505
-> 1506 return array2string(a, max_line_width, precision, suppress_small, ' ', "")
1507
1508
/opt/conda/lib/python3.7/site-packages/numpy/core/arrayprint.py in array2string(a, max_line_width, precision, suppress_small, separator, prefix, style, formatter, threshold, edgeitems, sign, floatmode, suffix, **kwarg)
710 return "[]"
711
--> 712 return _array2string(a, options, separator, prefix)
713
714
/opt/conda/lib/python3.7/site-packages/numpy/core/arrayprint.py in wrapper(self, *args, **kwargs)
482 repr_running.add(key)
483 try:
--> 484 return f(self, *args, **kwargs)
485 finally:
486 repr_running.discard(key)
/opt/conda/lib/python3.7/site-packages/numpy/core/arrayprint.py in _array2string(a, options, separator, prefix)
508
509 # find the right formatting function for the array
--> 510 format_function = _get_format_function(data, **options)
511
512 # skip over "["
/opt/conda/lib/python3.7/site-packages/numpy/core/arrayprint.py in _get_format_function(data, **options)
436 return formatdict['timedelta']()
437 else:
--> 438 return formatdict['int']()
439 elif issubclass(dtypeobj, _nt.floating):
440 if issubclass(dtypeobj, _nt.longfloat):
/opt/conda/lib/python3.7/site-packages/numpy/core/arrayprint.py in <lambda>()
378 formatdict = {
379 'bool': lambda: BoolFormat(data),
--> 380 'int': lambda: IntegerFormat(data),
381 'float': lambda:
382 FloatingFormat(data, prec, fmode, supp, sign, legacy=legacy),
/opt/conda/lib/python3.7/site-packages/numpy/core/arrayprint.py in __init__(self, data)
1144 def __init__(self, data):
1145 if data.size > 0:
-> 1146 max_str_len = max(len(str(np.max(data))),
1147 len(str(np.min(data))))
1148 else:
/opt/conda/lib/python3.7/site-packages/numpy/core/fromnumeric.py in amax(*args, **kwargs)
NameError: name 'dispatcher' is not defined
Может кто-нибудь помочь с этим? Спасибо!