lux-org / lux

Automatically visualize your pandas dataframe via a single print! 📊 💡
Apache License 2.0
5.15k stars 365 forks source link

Replace infs with nans to avoid crash when creating a heatmap #442

Closed cgarciae closed 2 years ago

cgarciae commented 2 years ago

Signed-off-by: Cristian Garcia cgarcia.e88@gmail.com

Overview

Fixes #440 by replacing infs with nans.

Changes

Uses

vis._vis_data = vis._vis_data.replace([np.inf, -np.inf], np.nan)

inside PandasExecutor.py on several places to remove infs.

codecov[bot] commented 2 years ago

Codecov Report

Merging #442 (7cab120) into master (91e8e98) will increase coverage by 0.06%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #442      +/-   ##
==========================================
+ Coverage   65.55%   65.62%   +0.06%     
==========================================
  Files          55       55              
  Lines        4419     4422       +3     
==========================================
+ Hits         2897     2902       +5     
+ Misses       1522     1520       -2     
Impacted Files Coverage Δ
lux/executor/PandasExecutor.py 89.84% <100.00%> (+0.09%) :arrow_up:
lux/vislib/altair/ScatterChart.py 96.96% <0.00%> (+3.03%) :arrow_up:
lux/vislib/altair/Heatmap.py 96.55% <0.00%> (+3.44%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 91e8e98...7cab120. Read the comment docs.

dorisjlee commented 2 years ago

Thanks @cgarciae! I left a few minor suggestions, otherwise, this looks good to merge soon!