Skip to content

Commit

Permalink
Add support for pytables (so pandas can r/w h5 files)
Browse files Browse the repository at this point in the history
https://b/242704740
  • Loading branch information
djherbis committed Aug 22, 2022
1 parent ca77a9b commit 6819d36
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ RUN pip install flashtext && \
pip install ipympl==0.7.0 && \
pip install pandarallel && \
pip install onnx && \
pip install tables && \
/tmp/clean-layer.sh

# Download base easyocr models.
Expand Down
13 changes: 13 additions & 0 deletions test_pytables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import unittest

import pandas as pd
from pandas.testing import assert_frame_equal


class TestPandasPytables(unittest.TestCase):

def test_rw_hd5(self):
want = pd.DataFrame([[1, 1.0, 'a']], columns=['x', 'y', 'z'])
want.to_hdf('./want.h5', 'data')
got = pd.read_hdf('./want.h5')
assert_frame_equal(want, got)

0 comments on commit 6819d36

Please sign in to comment.