I am very new to Python, and I have to make some changes to existing project at work. I am importing data from Matlab binary data file into my Python script.
lets say original *.m file contains something like this:
> Temperature=61.3
>
> VibrationSamples=[76,75,76,77, ... a lot of samples, 78]
>
> save(filename.mat, 'Temperature', 'VibrationSamples', '-mat7-binary')
(This is the minimal example I can provide)
I import resulting *.mat into the python script using
> mat = scipy.io.loadmat(filename.mat)
After that I am able to access elements from my matlab structure by using
> variableA = mat('temperature')
> variableB = mat('vibrationSamples')
However I am confused with the result. If I try to print varialbeA, for given example it will come up with two-dimensional array. The output of print variableA is [[61.3]]. In *.m file it is clearly float.
Why is this happening. What is clean way to resolve it? I know I can just use
> variableA = mat('temperature')[0][0]
But this does not look appropriate.
Am I doing something wrong?