6

The fst package in R provides blazing-fast read and write speed, and it requires less hard-drive space. See benchmarking results in R at here.

I wonder if it is possible to read a .fst file in Python. I haven't found an easy way to do that in Python. (Edit: I meant to import an fst file, not the fst package, into python. It's just like importing an csv file written out by R into python).

Thank you!

Miao Cai
  • 902
  • 9
  • 25
  • No, you can't import an R package into Python. There may be a library that allows interfacing R code with Python, but asking about library availability is off-topic. – chepner Nov 15 '19 at 16:19
  • Why would you think it possible? R packages run in R. You can of course call R from Python, but the overhead is likely to lessen or even eliminate the blazing speed you refer to. – John Coleman Nov 15 '19 at 16:20
  • @chepner Sorry this may cause confusion. I meant to import an fst file into Python, not the fst R package into python. Please see an edited version of the question. – Miao Cai Nov 15 '19 at 16:24
  • @JohnColeman Sorry this may cause confusion. I meant to import an fst file into Python, not the fst R package into python. – Miao Cai Nov 15 '19 at 16:25
  • 1
    What *is* a `fst` file, and what would it mean to "import" it into python? Python can open files of any type (though you might need the proper module or write your own code to parse the files) – John Coleman Nov 15 '19 at 16:26
  • @JohnColeman Sorry again for the confusing terminology. I should have said "read" rather than "import". I edited the question again. Unfortunately, I don't think I found a python package that can read a .fst file. – Miao Cai Nov 15 '19 at 16:29
  • Looking at that link, my guess is "no". There is something at the bottom of that page that discusses bindings to other languages which mentions Julia but not Python. If it was anywhere in Python it would be in pandas, but it isn't there -- so probably out of luck – John Coleman Nov 15 '19 at 16:30
  • By the way -- thank you for bringing a promising R package to my attention. – John Coleman Nov 15 '19 at 16:31
  • @JohnColeman Thanks. That's also what I am thinking. In my opinion, fst is almost the perfect solution to data storage for now: really really fast reading and writing speed, as well as requiring considerably less storing space. I believe there will be python packages to work with fst in the future. – Miao Cai Nov 15 '19 at 16:34
  • @JohnColeman You are welcome. It's quite surprising to me that I found something you can do in R but cannot do in Python. – Miao Cai Nov 15 '19 at 16:35
  • R still has a larger ecosystem of data analysis packages than Python, so not too surprising. – John Coleman Nov 15 '19 at 16:37

1 Answers1

1

There is currently no package that can read fst into Python. See the discussion by the developers at here

Miao Cai
  • 902
  • 9
  • 25