diff options
author | Nilesh Patra <nilesh@debian.org> | 2024-02-23 15:39:01 +0100 |
---|---|---|
committer | Étienne Mollier <emollier@debian.org> | 2024-02-23 15:39:01 +0100 |
commit | 7873d25efedac7e5cc75cbd9ff77a9520a781463 (patch) | |
tree | f1162814b1d75011994aefed4ac381ff2e67e43b | |
parent | 1858740b064242e9ed8335b9b656b790b91a728e (diff) |
Explicitly case variable to category dtype
Last-Update: 2021-11-03
Gbp-Pq: Name fix_dtype.patch
-rw-r--r-- | pyranges/methods/concat.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pyranges/methods/concat.py b/pyranges/methods/concat.py index 3b1b463..69b71a2 100644 --- a/pyranges/methods/concat.py +++ b/pyranges/methods/concat.py @@ -43,7 +43,8 @@ def concat(pyranges, strand=None): if any(strand_info) and not all(strand_info): new_res = {} for k, v in res.items(): - v.loc[:, "Strand"] = v.Strand.cat.add_categories(["."]) + type_v = v.Strand.astype('category') + v.loc[:, "Strand"] = type_v.cat.add_categories(["."]) new_res[k] = v.assign(Strand=v.Strand.fillna(".")) res = pr.PyRanges(new_res) res.Strand = res.Strand |