From e30f1f5009936afcfbc281abf9ebc375fc7b8b8e Mon Sep 17 00:00:00 2001 From: andrewgsavage Date: Fri, 30 Aug 2024 09:35:00 +0100 Subject: [PATCH 1/2] kind --- pint_pandas/pint_array.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pint_pandas/pint_array.py b/pint_pandas/pint_array.py index 93c787eb..165af8f4 100644 --- a/pint_pandas/pint_array.py +++ b/pint_pandas/pint_array.py @@ -42,7 +42,7 @@ class PintType(ExtensionDtype): """ type = _Quantity - # kind = 'O' + kind = 'O' # str = '|O08' # base = np.dtype('O') # num = 102 From a414c31c350abdeaa9c9b6ba23a90110942a7f3e Mon Sep 17 00:00:00 2001 From: andrewgsavage Date: Fri, 30 Aug 2024 09:38:31 +0100 Subject: [PATCH 2/2] kind --- pint_pandas/pint_array.py | 2 +- pint_pandas/testsuite/test_issues.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pint_pandas/pint_array.py b/pint_pandas/pint_array.py index 165af8f4..aa40b2fb 100644 --- a/pint_pandas/pint_array.py +++ b/pint_pandas/pint_array.py @@ -42,7 +42,7 @@ class PintType(ExtensionDtype): """ type = _Quantity - kind = 'O' + kind = "O" # str = '|O08' # base = np.dtype('O') # num = 102 diff --git a/pint_pandas/testsuite/test_issues.py b/pint_pandas/testsuite/test_issues.py index 74f26eb6..a4d2457e 100644 --- a/pint_pandas/testsuite/test_issues.py +++ b/pint_pandas/testsuite/test_issues.py @@ -311,3 +311,14 @@ def test_issue246(self): # now an operation where each cell is independent from each other df.apply(lambda x: x * 2, axis=1) + + +def TestIssue245(BaseExtensionTests): + def test_issue245(self): + km = pd.Series([1.0, 2.0, np.nan], dtype="pint[km]") + kg = pd.Series([1.0, 2.0, np.nan], dtype="pint[kg]") + + xx = pd.DataFrame({"a": km, "b": km}) + yy = pd.DataFrame({"a": kg, "b": kg}) + + pd.concat([xx, yy], axis=0)