Skip to content

Commit

Permalink
add test for PR217
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Hemenway committed Apr 2, 2024
1 parent 7d0037a commit 7e48e5e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pint_pandas/testsuite/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,16 @@ def test_dequantify(self):
)
result = df.pint.dequantify()
tm.assert_frame_equal(expected, result)

class TestIssue217(BaseExtensionTests):

def test_roundtrip(self):
df = pd.DataFrame(
{
'power': pd.Series([1.0,2.0,3.0], dtype='pint[W]'),
'torque': pd.Series([4.0,5.0,6.0], dtype='pint[N*m]'),
'fruits': pd.Series(['apple', 'pear', 'kiwi'])
}
)
df1 = df.pint.dequantify().pint.quantify(level=-1)
tm.assert_equal(df1.power.pint.m, df.power.pint.m)

0 comments on commit 7e48e5e

Please sign in to comment.