I want to read from a .npy file to do some signal processing tasks but during this task I received this error:
IndexError: only integers, slices (
:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices
this is my code:
import numpy as np
import matplotlib.pyplot as plt
file = '/signal/data.npy'
d = np.load(file,allow_pickle=True,encoding = 'latin1')
d['soma'][0]
There are same questions but I could not use them to solve this one.So can anyone help me to fix It? Thanks
This is part of my data( d is equal to res):


data.npyso it is reproducible. Thank you.["results"]["lfp"]for example, or a specific element with that key?resis a object dtype array containing dictionaries.res[0]is one of those dictionaries.res[0]['soma']should work. The indexing order matters.