Skip to Content
データサイエンスのための数学入門 ―Pythonで学ぶ線形代数、確率、統計の基礎
book

データサイエンスのための数学入門 ―Pythonで学ぶ線形代数、確率、統計の基礎

by Thomas Nield, 江川 崇
September 2025
Intermediate to advanced
424 pages
5h 17m
Japanese
O'Reilly Japan, Inc.
Content preview from データサイエンスのための数学入門 ―Pythonで学ぶ線形代数、確率、統計の基礎

付録A補足

A.1 SymPyを使ったLaTeX形式の表示

数学の記法に慣れてくると、SymPyの式を数学的な表記で表示するほうが理解しやすいと感じることがあります。

これを行うもっとも手軽な方法は、SymPyのlatex()という関数を使って数式をLaTeX形式に変換し、その結果をLaTeX数式ビューアーにコピーすることです。

簡単な数式をLaTeX形式の文字列に変換するコードを例A-1に示します。もちろん、微分や積分を組み合わせた複雑な計算をSymPyで行って、その結果をLaTeXの文字列に変換することもできますが、ここでは、理解を容易にするために、あえてシンプルな数式の例を挙げています。

例A-1 SymPyを使って数式をLaTeX形式に変換する例

from sympy import *

x,y = symbols('x y')

z = x**2 / sqrt(2*y**3 - 1)

print(latex(z))
\frac{x^{2}}{\sqrt{2 y^{3} - 1}}

この\frac{x^{2}}{\sqrt{2 y^{3} - 1}}という文字列は、LaTeXの数式モードで記述された数式です。さまざまなツールやドキュメント形式がこの表記をサポートしていますが、ただ表示するだけならLaTeX数式エディタを使えばよいでしょう。オンラインで使用できるものを以下に2つ示します。

LagridaのLaTeX数式エディタを使って数式を表示した例を図A-1に示します。 ...

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

データサイエンスのための統計学入門 第2版 ―予測、分類、統計モデリング、統計的機械学習とR/Pythonプログラミング

データサイエンスのための統計学入門 第2版 ―予測、分類、統計モデリング、統計的機械学習とR/Pythonプログラミング

Peter Bruce, Andrew Bruce, Peter Gedeck, 黒川 利明, 大橋 真也
ソフトウェア工学の基礎

ソフトウェア工学の基礎

Nathaniel Schutta, Dan Vega
MLOps実装ガイド ―本番運用を見据えた開発戦略

MLOps実装ガイド ―本番運用を見据えた開発戦略

Yaron Haviv, Noah Gift, 井伊 篤彦, 入江 美穂, 張 凡, 樋口 千洋

Publisher Resources

ISBN: 9784814401260Publisher Website