fix: mutating input df in viz.py (#11795)

This commit is contained in:
Ville Brofeldt 2020-11-25 12:55:00 +02:00 committed by GitHub
parent f27ebc4be5
commit 38f67a44ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1671,6 +1671,7 @@ class DistributionBarViz(BaseViz):
# pandas will throw away nulls when grouping/pivoting,
# so we substitute NULL_STRING for any nulls in the necessary columns
filled_cols = self.groupby + columns
df = df.copy()
df[filled_cols] = df[filled_cols].fillna(value=NULL_STRING)
row = df.groupby(self.groupby).sum()[metrics[0]].copy()