Skip to main content

py4project

授業向けの分析・可視化ユーティリティです。pandas DataFrame から回帰分析・散布図・折れ線グラフ・横バープロット・ボックスプロット・円グラフを簡単に作成できます。

インストール

pip install py4project

提供している関数

  • regression(x, y, data, ...) — 回帰分析(x にリストを渡すと重回帰)。決定係数・係数・p値・信頼区間を表にして表示し、結果オブジェクトを返します
  • regression_plot(x, y, data, ...) — 散布図+回帰直線(regression の結果を渡すこともできます)
  • scatter_plot(x, y, data, ...) — 散布図+トレンド線(対数軸オプションあり)
  • bar_plot(x, data, ...) — 横バープロット(複数系列・シフトシェア分解の配色に対応。label_col で縦軸の名前、sort_by で並び順、legend で凡例の名前を指定)
  • box_plot(x, data, ...) — ボックスプロット(対数化オプションあり。label_col を指定すると外れ値に名前を表示)
  • line_plot(x, y, data, ...) — 折れ線グラフ(y にリストを渡すと複数系列を重ねて表示)
  • pie_plot(x, data, label_col, ...) — 円グラフ(パーセント表示。top や other で小さい項目をまとめられます)

作図関数はどれも figsize=(幅, 高さ) で図の大きさを指定できます(単位はインチ、1インチ=2.54cm)。

使用例

import pandas as pd
from py4project import regression, bar_plot

df = pd.DataFrame({
    "産業": ["製造業", "卸売業", "小売業", "建設業"],
    "事業所数": [120, 80, 60, 40],
    "従業者数": [1500, 900, 700, 380],
})

# 回帰分析(セルの最後に置くと結果表が表示されます)
regression("事業所数", "従業者数", df)

# 横バープロット
bar_plot("従業者数", df, label_col="産業", title="産業別の従業者数")

より詳しい使い方は examples/example.ipynb を参照してください。

依存パッケージ

numpy, pandas, statsmodels, matplotlib>=3.9, japanize_matplotlib_jlite(日本語フォントを自動設定します)

変更履歴

CHANGES.md を参照してください。

ライセンス

MIT License

Metadata

Release files for py4project 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py4project 0.3.2
File Size Uploaded Provenance Actions
py4project-0.3.2.tar.gz 797.5 kB With provenance Details for py4project-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py4project 0.3.2
File Interpreter ABI Platform Actions
py4project-0.3.2-py3-none-any.whl Python 3 none any Details for py4project-0.3.2-py3-none-any.whl

Total release size: 816.8 kB

Release files / py4project-0.3.2.tar.gz

Download URL py4project-0.3.2.tar.gz
Size 797.5 kB
Tags Source
SHA-256 checksum
How to use checksums
920592ecc72b8375a3cf176dd1828a8397dfed4712a48eaaa0f4ff27d2db9cc0
BLAKE2b-256 checksum
How to use checksums
46783a528e17eacf81ef484822c8d9bfbfb0cd4896f937dd1d6f27e8bef41122
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / py4project-0.3.2-py3-none-any.whl

Download URL py4project-0.3.2-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cdfbb02adeb841c864f885bdb61134859fc0e4b786ee34447a737e8587b85504
BLAKE2b-256 checksum
How to use checksums
d614858205f25385a047b599c50891c88d52fba0db217366e5b4bb3a15ad74bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for py4project 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for py4project-0.3.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page