0

I am currently following a udemy course on working with an API to collect historical data for a specified crypto currency.

So far everything seems to work, when I run the code it even shows in the terminal that the data has been collected for the specified currency.

The h5 file is created as binance.h5 in the data folder. But when I open this file with HDFviewer it seems like the data set is completely empty.

I have attached a couple of snippets. If you want to see the code I will include it as well, however there is a lot of stuff going on so I'd like to spare you the details.

To sum up this is what happens:

i) run the code

ii) see that the data has been collected

iii) kill the terminal

iv) open the newly created binance.h5 file with hdfViewer

v) realize the binance.h5 file is empty.

My setup

Running the code

Empty dataset

  • Did you properly close the file before simply killing the terminal? For any better support, you need to provide some code. This isn't your first question so I assume you know what a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) is – Homer512 Aug 26 '23 at 16:17
  • @Homer512, thank you for your response. What do you mean by properly close the file before killing the terminal? – user21369645 Aug 26 '23 at 19:11
  • Does this answer your question? [Do I need to manually close a HDF5-file?](https://stackoverflow.com/questions/56149237/do-i-need-to-manually-close-a-hdf5-file) – Homer512 Aug 26 '23 at 19:19
  • I have tried to run the code with file.close(). However, it doesn't seem to make a difference. – user21369645 Aug 26 '23 at 19:39
  • If I do this: create the h5 file from the code, and then I don't close it in hdfviewer and run again I get this error message: BlockingIOError: [Errno 11] Unable to open file (unable to lock file, errno = 11, error message = 'Resource temporarily unavailable'). That's the only way I can trick it into throwing me an error message. – user21369645 Aug 26 '23 at 20:07
  • By default, Windows locks files when they are opened. On Linux/Mac, the HDF5 library uses file locks to achieve the same but the error message should look a bit different. So this is an entirely different issue – Homer512 Aug 26 '23 at 20:20
  • I'm on Linux, Ubuntu 22.04 – user21369645 Aug 27 '23 at 05:59

0 Answers0