This has been asked and answered several times (here and here, for instance). Apparently the function has been moved in numpy 1.6.1. There is no more numpy.lib.recfunctions. While I can implement my own as specified in previous posts, I would really rather not!
Can someone tell me the path to this function? Have recfunctions as a whole been moved or merged into another library?
According to the git history, numpy.lib.recfunctions hasn't gone anywhere.
I'd check your installation of numpy, and perhaps upgrade it to a newer version.
This works for me... but I'm not clear why. Maybe someone can explain:
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.6.1'
>>> numpy.lib
<module 'numpy.lib' from 'C:\Python27\ArcGIS10.1\lib\site-packages\numpy\lib\__init__.pyc'>
>>> numpy.lib.recfunctions #### <- why does this not work?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'recfunctions'
>>> import numpy.lib.recfunctions
>>> dir(numpy.lib.recfunctions)
['MaskedArray', 'MaskedRecords', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_check_fill_value', '_fix_defaults', '_fix_output','_is_string_like', '_izip_fields', '_izip_fields_flat', 'append_fields', 'drop_fields', 'find_duplicates', 'flatten_descr', 'get_fieldstructure', 'get_names', 'get_names_flat', 'itertools', 'izip_records', 'join_by', 'ma', 'merge_arrays', 'ndarray', 'np', 'rec_append_fields', 'rec_drop_fields', 'rec_join', 'recarray', 'recursive_fill_fields', 'rename_fields', 'stack_arrays', 'sys', 'zip_descr']
>>>
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