I have been looking for a long time how to correctly pass data that I have in text format to a .h5 file format. The end goal is to be able to read the .h5 file with PyXRF and get a spectrum.
Expected Behavior
When I run the next code:

I get a .h5 file. When I try to read from PyXRF I would expect to see a spectrum.
Current Behavior
However, when reading the file I get a banner that says the following:

Possible Solution
The first thing I did was read an .h5 file that does run with PyXRF. I managed to see the following:

But when running the same code but with the .h5 file that I created, the following results:

I don't know what to do but I think the problem is in the way I pass the text file to .h5
Thanks!