Use array.item() instead of np.asscalar()

This commit is contained in:
2019-03-16 13:43:26 +01:00
parent 1bcbc16bab
commit b08c2f4435

View File

@@ -327,8 +327,7 @@ class MPRfile:
maybe_log_module = [m for m in modules if m['shortname'] == b'VMP LOG '] maybe_log_module = [m for m in modules if m['shortname'] == b'VMP LOG ']
n_data_points = np.frombuffer(data_module['data'][:4], dtype='<u4') n_data_points = np.frombuffer(data_module['data'][:4], dtype='<u4')
n_columns = np.frombuffer(data_module['data'][4:5], dtype='u1') n_columns = np.frombuffer(data_module['data'][4:5], dtype='u1').item()
n_columns = np.asscalar(n_columns) # Compatibility with recent numpy
if data_module['version'] == 0: if data_module['version'] == 0:
column_types = np.frombuffer(data_module['data'][5:], dtype='u1', column_types = np.frombuffer(data_module['data'][5:], dtype='u1',