From 81ac67bda639bd36d70aaf25a85349d0999f47d9 Mon Sep 17 00:00:00 2001 From: Michal Klein <46717574+michalk8@users.noreply.github.com> Date: Thu, 2 Nov 2023 22:39:29 +0100 Subject: [PATCH] Correct serie's dtype --- src/cellrank/_utils/_utils.py | 2 +- tests/test_cflare.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cellrank/_utils/_utils.py b/src/cellrank/_utils/_utils.py index e4a0dbf64..4f0831ccf 100644 --- a/src/cellrank/_utils/_utils.py +++ b/src/cellrank/_utils/_utils.py @@ -886,7 +886,7 @@ def _convert_to_categorical_series( "that there are no conflicting keys, such as `0` and `'0'`." ) - term_states = pd.Series([np.nan] * len(cell_names), index=cell_names) + term_states = pd.Series([None] * len(cell_names), index=cell_names, dtype=str) for ts, cells in mapper.items(): term_states[cells] = ts diff --git a/tests/test_cflare.py b/tests/test_cflare.py index 7c2fba0d3..b43c0ca48 100644 --- a/tests/test_cflare.py +++ b/tests/test_cflare.py @@ -415,7 +415,7 @@ def test_compare_fate_probabilities_with_reference(self): c = cr.estimators.CFLARE(cr.kernels.PrecomputedKernel(transition_matrix)) - state_annotation = pd.Series(index=range(len(c))) + state_annotation = pd.Series(index=range(len(c)), dtype=str) state_annotation[7] = "terminal_1" state_annotation[10] = "terminal_2" state_annotation = state_annotation.astype("category")