I am trying to dump numpy array into an excel file using savetxt method, but I am getting this weird error on the console:
.18e,%.18e,%.18e,%.18e,%.18e,%.18e
you could use pandas, its really easy friendly to use.
import pandas as pd
## convert your array into a dataframe
df = pd.DataFrame (array)
## save to xlsx file
filepath = 'my_excel_file.xlsx'
df.to_excel(filepath, index=False)
hope it helps!
Bit late, but might help others facing such an issue.
This error is because you appear to have set
dtype = np.ndarray
when creating / defining your Numpy matrix first_layer_output.
One solution to this problem is modifying your command storing the
np.savetxt('test.csv', first_layer_output, delimiter=',', fmt='%s')
This command now outputs the contents of the array as a string, irrespective the actual data types being used. Hope this helps.