Fixes #2220 by replacing Nan with 0 to allow rounding (#2243)

Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
This commit is contained in:
soggyomelette
2022-08-03 22:01:03 +01:00
committed by GitHub
parent 7007e5857c
commit e26a694fc4
2 changed files with 4 additions and 1 deletions

View File

@@ -185,7 +185,7 @@ class OverviewController(BaseController):
prog="hm",
add_help=False,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description="""Display cryptocurrencies heatmap [Source: https://coingecko.com]
description="""Display cryptocurrencies heatmap with daily percentage change [Source: https://coingecko.com]
Accepts --category or -c to display only coins of a certain category
(default no category to display all coins ranked by market cap).
You can look on only top N number of records with --limit.

View File

@@ -57,6 +57,9 @@ def display_crypto_heatmap(
if df.empty:
console.print("\nNo cryptocurrencies found\n")
else:
df = df.fillna(
0
) # to prevent errors with rounding when values aren't available
max_abs = max(
-df.price_change_percentage_24h_in_currency.min(),
df.price_change_percentage_24h_in_currency.max(),