diff options
author | Arun Isaac | 2025-09-04 20:00:31 +0100 |
---|---|---|
committer | Arun Isaac | 2025-09-04 20:00:31 +0100 |
commit | 5894ac377c04b4af187309b132c132ff216bb571 (patch) | |
tree | ab04d63be319ddce67fed54dfedf57773444ddd6 | |
parent | d94e8b06e2e11374a074cca02a71c4ba358be172 (diff) | |
download | pyhegp-5894ac377c04b4af187309b132c132ff216bb571.tar.gz pyhegp-5894ac377c04b4af187309b132c132ff216bb571.tar.lz pyhegp-5894ac377c04b4af187309b132c132ff216bb571.zip |
Raise exception if data frame to be written has NA values.
This should never occur, but can occur due to bugs in the code; we wish to protect against that.
-rw-r--r-- | pyhegp/serialization.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pyhegp/serialization.py b/pyhegp/serialization.py index c197bf2..db1360a 100644 --- a/pyhegp/serialization.py +++ b/pyhegp/serialization.py @@ -108,6 +108,8 @@ def read_phenotype(file): return df def write_tsv(file, df): + if df.isna().any(axis=None): + raise ValueError("Data frame has NA values") df.to_csv(file, quoting=csv.QUOTE_NONE, sep="\t", |