Skip to content

Commit 90a4e38

Browse files
authored
Fix regression, df.map only available with pd>=2.1
1 parent 7267d81 commit 90a4e38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mkdocs_table_reader_plugin/markdown.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def convert_to_md_table(df: pd.DataFrame, markdown_kwargs: Dict) -> str:
2828

2929
# Avoid deprecated applymap warning on pandas>=2.0
3030
# See https://github.com/timvink/mkdocs-table-reader-plugin/issues/55
31-
if pd.__version__.startswith("2"):
31+
if pd.__version__ >= "2.1.0":
3232
df = df.map(lambda s: replace_unescaped_pipes(s) if isinstance(s, str) else s)
3333
else:
3434
df = df.applymap(lambda s: replace_unescaped_pipes(s) if isinstance(s, str) else s)

0 commit comments

Comments
 (0)