diff --git a/cimsparql/model.py b/cimsparql/model.py index 8e0a3ef1..5a0ac376 100644 --- a/cimsparql/model.py +++ b/cimsparql/model.py @@ -578,7 +578,7 @@ def dc_active_flow_query(self, region: str | None = None) -> str: @time_it def dc_active_flow(self, region: str | None = None) -> DcActiveFlowDataFrame: query = self.dc_active_flow_query(region) - df = self.get_table_and_convert(query) + df = self.get_table_and_convert(query).astype({"p": float}) # Unable to group on max within the sparql query so we do it here. df = df.iloc[df.groupby("mrid")["p"].idxmax()].set_index("mrid") df["p"] *= df["direction"]