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))
There is no NumPy function named arrange .
NumPy arange() is one of the array creation routines based on numerical ranges. It creates an instance of ndarray with evenly spaced values and returns the reference to it. You can define the interval of the values contained in an array, space between them, and their type with four parameters of arange() : numpy.
You should try numpy.arange()
instead, if that is what you meant?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With