-
-
Save r-brink/b0e491df376b78795dc4eac3d38023f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hvplot | |
import pandas as pd | |
import polars as pl | |
def read_excel_plot(): | |
df = pl.read_csv("output/read_excel_results.csv") | |
df = df.with_columns( | |
df["Engine"] | |
.map_elements( | |
lambda engine: { | |
f"Pandas {pd.__version__}": "#F9CFF2", | |
"xlsx2csv": "#73bfb8", | |
"openpyxl": "#26413c", | |
"calamine (new)": "#0075FF", | |
}.get(engine) | |
) | |
.alias("color") | |
) | |
plot = df.plot.bar( | |
x="Engine", | |
y="Time", | |
color="color", | |
ylabel="Time (seconds)", | |
title="Reading Excel performance comparison w/ different engines", | |
) | |
plot = plot.redim.values( | |
Engine=["calamine (new)", "openpyxl", "xlsx2csv", f"Pandas {pd.__version__}"] | |
) | |
return hvplot.save(plot, "output/read_excel_plot.html") | |
read_excel_plot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment