After reading file, how can i get the sampling frequency?
This is how i read the file
datax=mne.io.read_raw_edf(‘file.edf’,preload=True)
I know i can get the sampling frequnecy via datax.info but i want to get it like as we get channels name (datax.ch_names) and store the sampling frequency in a variable.
As you said, the sampling rate is stored in the info attribute.
Channel names are one of the rare elements of info that is directly accessible as an attribute with the raw.ch_names syntax, but its primary location is info in raw.info['ch_names'].
The sampling rate is not exposed as an attribute and is only stored in info. If you want to retrieve it and store it elsewhere, you have to use the full dictionary syntax: fs = raw.info['sfreq'].
              
              
              2 Likes