data[0] should be data.iloc[0] in the case where we've read a pandas dataframe and filtered it down to a single value, the index in the pandas.Series is not guaranteed to be 0.
Minimal CSV file that should reproduce this, e.g. when expecting to read the single zero-dim value for 2015:
https://github.com/nismod/smif/blob/49a5db3569992b2baf4b409299707ab7ed5f6ae8/src/smif/data_layer/file/file_data_store.py#L393
data[0]
should bedata.iloc[0]
in the case where we've read a pandas dataframe and filtered it down to a single value, the index in thepandas.Series
is not guaranteed to be 0.Minimal CSV file that should reproduce this, e.g. when expecting to read the single zero-dim value for 2015: