polars

polarsの使い方

タグ polars


概要

  • 2023年に有名になった
  • rustで書かれたpandasのようなもの
  • polarsは白熊のこと
    • ポーラーズという発音
  • 多くの面でpandasより高速と言われている
  • jupyter notebookでpandasのように表示できる
  • 遅延評価のようなインターフェースがある

インストール

$ python3 -m pip install polars

具体例

csvファイルの読み込

import polars as pl
path = r'https://raw.githubusercontent.com/chendaniely/pandas_for_everyone/master/data/gapminder.tsv'
df = pl.read_csv(path, sep='\t')

display(df.head()) # 表示
display(df.describe())