flatten
flatten copied to clipboard
Regression 0.1.6 -> 0.1.7 for numpy arrays
Such a useful module - thank you.
I've noticed that when a numpy array is present as a dictionary value, flatten()
throws the following:
File "myfile.py", line 452, in myfunc
flattened = flatten(x)
File "/anaconda2/lib/python2.7/site-packages/flatten_json.py", line 82, in flatten
_flatten(nested_dict, None)
File "/anaconda2/lib/python2.7/site-packages/flatten_json.py", line 74, in _flatten
object_key))
File "/anaconda2/lib/python2.7/site-packages/flatten_json.py", line 66, in _flatten
if not object_:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
This worked in 0.1.6. Any ideas what happened? Has some default changed? Is there a workaround? Thanks
Any update on this?
@jtlz2 do you mind sharing an example? I haven't looked at it myself yet, maybe someone else has?!
We don't have any tests with numpy arrays and a recent change must've broken things.