I am trying to write some data that I extracted from an excel file to a '.mat' file. So far, I have converted the extracted data into an array and converted this array to a dictionary before writing to a .mat file. While the conversions to the array and dictionary seem fine, when I create and write to a .mat file, the data seems corrupted. Here is my code:
import pandas as pd
file_location = '/Users/manmohidake/GoogleDrive/Post_doc/Trial_analysis/1_IndoorOutdoor.xlsx'
mydata = pd.read_excel(file_location,na_values = "Missing", sheet_name='Sheet1', skiprows = 1, usecols="F,K,Q")
import numpy
#Convert data to array
array = mydata.to_numpy()
import scipy.io
import os
destination_folder_path = '/Users/manmohidake/Google Drive/Post_doc/Trial_analysis/'
scipy.io.savemat(os.path.join(destination_folder_path,'trial1.mat'), {'array':array})
I don't really know what's gone wrong. When I open the .mat file, it. looks like this