0

The file is Imported with no problem in Wolfran Matematica

using Import['filename'] I get:

{"Amplitude", "trace #", "time (sec)"}

using Import['filename', {"Datasets", "time (sec)"}] I get the time data

When I try to uploaded using pandas or h5py it does'n work

In pandas I used: r = pd.read_hdf('filename')

In h5py I used: r = h5py.File('filename', 'r')

Both approaches give similar error messages, mainly:

Unable to open file (file signature not found)
# can't auto open/close if we are using an iterator so delegate to the iterator
DrBwts
  • 3,470
  • 6
  • 38
  • 62
heracho
  • 590
  • 1
  • 9
  • 28
  • What is the Python code that you actually tried? – jjramsey Sep 20 '21 at 20:09
  • I update the question to give more details of what I have been trying. – heracho Sep 20 '21 at 20:19
  • As far as I can tell, Pandas `read_hdf()` function isn't meant to read arbitrary HDF files, just those created by Pandas: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_hdf.html – jjramsey Sep 20 '21 at 20:26
  • Also, you haven't shown the code you used with h5py, only the Pandas code. – jjramsey Sep 20 '21 at 20:27
  • I add the line to try upload the data using h5py, both approaches send similar error messages. – heracho Sep 20 '21 at 20:36
  • Are your HDF file and your Python file in the same folder? – jjramsey Sep 21 '21 at 12:11
  • Also, are you sure that your HDF file is an HDF*5* file, not an HDF4 or other kind of file called HDF? See [here](https://stackoverflow.com/a/43607837/1643973) and [here](https://stackoverflow.com/a/60046574/1643973). – jjramsey Sep 21 '21 at 12:17
  • I found out that it's a HDF4 file. Using pyhdf I was able to upload the file. Should I erase the question? – heracho Sep 22 '21 at 17:52

0 Answers0