Python Forum

Full Version: [split] np.arrange error - no attribute
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
python3
Output:
Python 3.7.0 (default, Aug 18 2018, 20:37:25) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import scipy as sp >>> t = sp.arange(1,10,.5) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'scipy' has no attribute 'arange' >>> import numpy as np >>> np.arange(3) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'numpy' has no attribute 'arange' >>>
I made sure to use single 'r' in arange for scipy and numpy. I am getting same error as no attribute 'arange' in numpy or scipy.

Just in continuation to my earlier post, it works fine for Python2. Pl see below.
python
Output:
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import scipy as sp >>> t = sp.arange(0,10,0.5) >>> import numpy as np >>> r = np.arange(3) >>>
Split from https://python-forum.io/Thread-np-arrang...-attribute

Please don't post to old threads, that one had no activity for a year.
You didn't happen to name your file numpy.py, did you? If so, it can "shadow" things.