Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
better display of nan in table
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromedockes committed Jul 1, 2024
1 parent d68394f commit 57e2a83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/skrubview/_data/templates/table-part.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
data-value-repr="{{ row[idx].__repr__() }}"
data-col-name-str="{{ summary.head.header[idx] }}"
data-col-name-repr="{{ summary.head.header[idx].__repr__() }}"
{%- if row[idx] is none -%}
{%- if row[idx] | is_null -%}
data-value-is-none=""
{%- endif -%}
data-dataframe-module="{{ summary.dataframe_module }}"
onclick="displayValue(event)">
{%- if row[idx] is not none -%}
{%- if not (row[idx] | is_null) -%}
{{ row[idx] }}
{%- endif -%}
</td>
Expand Down
2 changes: 2 additions & 0 deletions src/skrubview/_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import secrets

import jinja2
import pandas as pd

try:
from skrub import _selectors as s
Expand Down Expand Up @@ -46,6 +47,7 @@ def _get_jinja_env():
"filter_isin_snippet",
]:
env.filters[function_name] = getattr(_utils, function_name)
env.filters["is_null"] = pd.isna
return env


Expand Down

0 comments on commit 57e2a83

Please sign in to comment.