forked from Kaggle/docker-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for pytables (so pandas can r/w h5 files)
https://b/242704740
- Loading branch information
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |