From 4174aecb3fc7b32a6d8dfb71afbb682fa15a5412 Mon Sep 17 00:00:00 2001 From: Arian Jamasb Date: Sat, 28 Oct 2023 19:50:38 +0200 Subject: [PATCH] fix type error in charge writing --- graphein/protein/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphein/protein/utils.py b/graphein/protein/utils.py index 85b2462f..ba4373db 100644 --- a/graphein/protein/utils.py +++ b/graphein/protein/utils.py @@ -15,8 +15,8 @@ from urllib.request import urlopen import networkx as nx -import numpy as np import pandas as pd +import numpy as np import requests import wget from biopandas.pdb import PandasPdb @@ -404,7 +404,7 @@ def save_graph_to_pdb( df = g.graph["pdb_df"] # format charge correctly df.charge = df.charge.replace("", np.nan) - df["charge"] = df.charge.apply(lambda x: float(x) if x != "" else "") + df.charge = df.charge.astype(float) # Add blank columns blank_cols = [