From 9905a9ff160ae4688815640cc4e669c5fdfe3273 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 6 Sep 2025 14:23:28 +0100 Subject: Construct empty genotype frame using series. --- pyhegp/pyhegp.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pyhegp/pyhegp.py b/pyhegp/pyhegp.py index 3598931..4e0bd84 100644 --- a/pyhegp/pyhegp.py +++ b/pyhegp/pyhegp.py @@ -134,11 +134,8 @@ def cat_genotype(genotypes): # If there are no input data frames, return an empty data # frame with the chromosome and position columns. case []: - genotype = pd.DataFrame(data={"chromosome": [], - "position": []}) - genotype.chromosome = genotype.chromosome.astype("str") - genotype.position = genotype.position.astype("int") - return genotype + return pd.DataFrame({"chromosome": pd.Series(dtype="str"), + "position": pd.Series(dtype="int")}) case _: return reduce(cat2, genotypes) -- cgit 1.4.1