Numpy - module has no attribute 'arrange' [closed]
Seems like an incredibly basic error, I've tried uninstalling and reinstalling the latest version of Numpy (1.9) and that didn't seem to solve my issue. I am getting the following error when trying to use the arrange function:
Traceback (most recent call last):
File "names.py", line 37, in <module>
top1000.index = np.arrange(len(top1000))
AttributeError: 'module' object has no attribute 'arrange'
Printing the version confirms that it is indeed 1.9. I've not been able to come across anyone else reporting this specific issue. I've also tried this on two separate Macs and still get the same exact error.
import numpy as np
import pandas as pd
print np.__version__
grouped = names.groupby(['year', 'sex'])
top1000 = grouped.apply(get_top1000)
top1000.index = np.arrange(len(top1000))
Solution 1:
You should try numpy.arange()
instead, if that is what you meant?