- #1
member 428835
Hi PF!
I have a large dataset called data_dict I'm parsing that's stored as a numpy array. I'm subcategorizing it via a dictionary titled data_dict. Currently there is a dictionary key called key_curr that stores an np array data_col_prev. I'd like to append to this key data_col_curr. When I execute the following:
I receive the error
>> AttributeError: 'numpy.ndarray' object has no attribute 'np'
When I execute
I receive the error
>> AttributeError: 'numpy.ndarray' object has no attribute 'append'
Any help would be awesome!
I have a large dataset called data_dict I'm parsing that's stored as a numpy array. I'm subcategorizing it via a dictionary titled data_dict. Currently there is a dictionary key called key_curr that stores an np array data_col_prev. I'd like to append to this key data_col_curr. When I execute the following:
Python:
data_dict.setdefault(key_curr, []).np.append(data_col_curr)
I receive the error
>> AttributeError: 'numpy.ndarray' object has no attribute 'np'
When I execute
Python:
data_dict.setdefault(key_curr, []).append(data_col_curr)
I receive the error
>> AttributeError: 'numpy.ndarray' object has no attribute 'append'
Any help would be awesome!
Last edited by a moderator: