From f269ae595d40ea1265ea9cbb13b1c997c671660a Mon Sep 17 00:00:00 2001 From: Sylvain Combettes <48064216+sylvaincom@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:06:06 +0100 Subject: [PATCH] switching to polars, but waiting on polars to be supported by skore --- examples/plot_01_getting_started.py | 8 ++++---- skore/pyproject.toml | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/plot_01_getting_started.py b/examples/plot_01_getting_started.py index 7c76d5055..9061feb9a 100644 --- a/examples/plot_01_getting_started.py +++ b/examples/plot_01_getting_started.py @@ -85,11 +85,11 @@ # plot: # %% -import pandas as pd +import polars as pl -df = pd.DataFrame(gs_cv.cv_results_) -df.insert(len(df.columns), "rmse", -df["mean_test_score"].values) -df[["param_alpha", "rmse"]].head() +df = pl.DataFrame(gs_cv.cv_results_) +df = df.insert_column(df.shape[1], pl.Series("rmse", -df["mean_test_score"])) +df.select(["param_alpha", "rmse"]).head(5) # %% import matplotlib.pyplot as plt diff --git a/skore/pyproject.toml b/skore/pyproject.toml index f1e4e183b..f3be933b7 100644 --- a/skore/pyproject.toml +++ b/skore/pyproject.toml @@ -66,6 +66,7 @@ test = [ "httpx", "matplotlib", "pandas", + "polars", "pillow", "plotly", "pre-commit",