about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2025-09-06 14:23:28 +0100
committerArun Isaac2025-09-06 14:23:28 +0100
commit9905a9ff160ae4688815640cc4e669c5fdfe3273 (patch)
tree5db64c635b51e0666735d93f65082c81840ed702
parent3ac9f93122a1987da82b1d1a730715768eaf386e (diff)
downloadpyhegp-9905a9ff160ae4688815640cc4e669c5fdfe3273.tar.gz
pyhegp-9905a9ff160ae4688815640cc4e669c5fdfe3273.tar.lz
pyhegp-9905a9ff160ae4688815640cc4e669c5fdfe3273.zip
Construct empty genotype frame using series.
-rw-r--r--pyhegp/pyhegp.py7
1 files 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)