4

I've created some JLD files from Julia's dataframe module and now I'd like to import them into a Pandas dataframe. It's very easy to read and write these files in Julia, but I've not found the easy way in Python3. I've inspected the contents of the jld file and it is very complicated so there must be a package that will read into a dataframe, preserving column types, and names, etc. There is a JLD package for Python, but it appears to be for Python2 and has not been updated in 8 years, so I'm wonder what the current state of the art is in Python for reading JLD files.

Here is what I found:

https://pypi.python.org/pypi/jld/0.0.39

Chuck Carlson
  • 977
  • 8
  • 26

2 Answers2

3

How about writing the data frame out using Feather.jl:

import Feather

Feather.write("my_data_frame.feather", my_df)

and reading it into pandas with

import pandas

my_df = pandas.read_feather("my_data_frame.feather")
kmsquire
  • 1,302
  • 12
  • 12
2

julia's .jld is a "dialect" of hdf5 that is really designed for being read and written by julia itself -as it allows you to store type-related information. Just use plain HDF5 (there's a julia package for that) if you want to use anything across languages. -https://github.com/JuliaIO/HDF5.jl

NB: There will probably still be some work required to save your julia dataframe into a format that can be loaded easily into pandas. See here Pandas can't read hdf5 file created with h5py for some issues.

Alexander Morley
  • 4,111
  • 12
  • 26