Skip to Content
Python Polars ―高速なデータ処理を実現する次世代ライブラリ
book

Python Polars ―高速なデータ処理を実現する次世代ライブラリ

by Jeroen Janssens, Thijs Nieuwdorp, 中田 秀基
December 2025
Intermediate to advanced
468 pages
7h 58m
Japanese
O'Reilly Japan, Inc.
Content preview from Python Polars ―高速なデータ処理を実現する次世代ライブラリ

こんなにおおごとになるはずではなかった。

2019年12月、私は父親になり、そしてパンデミックに襲われた。私は、新生児との生活を両立させ、「私」という感覚を持ち続けようとして朦朧としていた。新米パパの睡眠不足の中、私は新しいプロジェクトに挑戦しようと考えた。正直なところ、それは趣味以外の何ものでもなかった。

仕事で、Rustプログラミング中に2つのCSVファイルをジョインする必要があった。SQLiteをセットアップするよりも簡単な方法はないだろうかと思った。そこで、ソフトウェア開発ではよくあることだが、自分でジョインアルゴリズムを実装してみることにした。

当時、私はRustを始めたばかりで、性能の最適化についてよく知らなかった。最初のジョインを書いて鼻高々だった私は、自分の実装がpandasよりもはるかに遅いことを知った。この不満足な結果が、後にPolarsとなるものの種をまいた。

この結果を受けて、私はその1年半を、データベースエンジンの研究と、Rustの学習、たくさんの試行錯誤に費やした。データベース、アルゴリズム、性能、メモリ、unsafeコードなどについて学ぶにつれて、私のゴールは変わっていった。最初のゴールは、pandasよりも高速なジョインを作ることだったのだが、Rust用のDataFrameパッケージを作ることになり、最終的にはPythonの最先端技術に匹敵するような高性能なクエリエンジンを作ることになった。

私は、pandasの長所と短所、SQLやPySparkの宣言的アプローチ、関数型プログラミングの原則、Rustの型システムの厳密性から着想を得た。最初は、pandas APIを直接模倣することを考えた。しかしすぐに、そのように自分自身を制約することは、私の創造的な意欲を損ない、効率の悪いツールを作ることにつながると気づいた。この制約を手放し、遅延APIと即時APIを1つのエクスプレッションベースのAPIに統合したとき、プロジェクトは、今ではPolarsとして認識されるものになっていた。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python Distilled ―プログラミング言語Pythonのエッセンス

Python Distilled ―プログラミング言語Pythonのエッセンス

David M. Beazley, 鈴木 駿
入門 Python 3 第2版

入門 Python 3 第2版

Bill Lubanovic, 鈴木 駿, 長尾 高弘

Publisher Resources

ISBN: 9784814401437Publisher Website