Skip to content

Commit 6819d36

Browse files
committed
Add support for pytables (so pandas can r/w h5 files)
http://b/242704740
1 parent ca77a9b commit 6819d36

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Dockerfile.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ RUN pip install flashtext && \
513513
pip install ipympl==0.7.0 && \
514514
pip install pandarallel && \
515515
pip install onnx && \
516+
pip install tables && \
516517
/tmp/clean-layer.sh
517518

518519
# Download base easyocr models.

test_pytables.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import unittest
2+
3+
import pandas as pd
4+
from pandas.testing import assert_frame_equal
5+
6+
7+
class TestPandasPytables(unittest.TestCase):
8+
9+
def test_rw_hd5(self):
10+
want = pd.DataFrame([[1, 1.0, 'a']], columns=['x', 'y', 'z'])
11+
want.to_hdf('./want.h5', 'data')
12+
got = pd.read_hdf('./want.h5')
13+
assert_frame_equal(want, got)

0 commit comments

Comments
 (0)