記述統計のためのクラスや可視化のあれこれ。ダミーデータも作れるよ。
Project description
arekore
記述統計のためのクラスや可視化のあれこれ。ダミーデータも作れるよ。
Quickstart
1次元データ
import matplotlib.pyplot as plt
import numpy as np
from arekore import dummy, viz
from arekore.data1d import Data1d, plot_hist
def main():
# ダミーデータ生成
rawdata = dummy.dist_normal_1d(mean=50, std=10, n=100)
# 1次元データオブジェクトの作成
d = Data1d(rawdata, bins=np.arange(0, 100 + 1, 5))
# ヒストグラムの描画
fig, ax = viz.fig_ax(figsize=(8, 6))
plot_hist(ax, d)
plt.show()
# 度数分布表もつくれる
freq_table_md = d.freq_table_as_md()
print(freq_table_md)
"""| 階級 | 階級値 | 度数 | 累積度数 | 相対度数 | 累積相対度数 |
|:---------------|---------:|-------:|-----------:|-----------:|---------------:|
| (-0.001, 10.0] | 5 | 0 | 0 | 0 | 0 |
| (10.0, 20.0] | 15 | 0 | 0 | 0 | 0 |
| (20.0, 30.0] | 25 | 1 | 1 | 0.01 | 0.01 |
| (30.0, 40.0] | 35 | 14 | 15 | 0.14 | 0.15 |
| (40.0, 50.0] | 45 | 30 | 45 | 0.3 | 0.45 |
| (50.0, 60.0] | 55 | 37 | 82 | 0.37 | 0.82 |
| (60.0, 70.0] | 65 | 16 | 98 | 0.16 | 0.98 |
| (70.0, 80.0] | 75 | 2 | 100 | 0.02 | 1 |
| (80.0, 90.0] | 85 | 0 | 100 | 0 | 1 |
| (90.0, 100.0] | 95 | 0 | 100 | 0 | 1 |
"""
if __name__ == '__main__':
main()
2次元データ
import matplotlib.pyplot as plt
from arekore import dummy, viz
from arekore.data2d import Data2d, plot_regression_line, plot_scatter
def main():
# ダミーデータ生成
x, y = dummy.xy_specified_cor(r=0.8, n=50)
# 2次元データオブジェクトの作成
d = Data2d(x=x, y=y)
# 散布図と回帰直線を描画
fig, ax = viz.fig_ax(figsize=(8, 6))
plot_scatter(ax, d)
plot_regression_line(ax, d)
plt.show()
if __name__ == '__main__':
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
arekore-0.1.0.tar.gz
(6.4 kB
view details)
Built Distribution
File details
Details for the file arekore-0.1.0.tar.gz
.
File metadata
- Download URL: arekore-0.1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.13 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5b437edaf1e8e20507e4a0dfebea1f26c12da81095375a4ad74b53f06864bb7 |
|
MD5 | 079abdd38e6fe09a63b39af1140f86c2 |
|
BLAKE2b-256 | 932fbdf63d67e38a25d1c6ed2581a95fe5108e7a1a49560b1bd5647d3ef94c36 |
File details
Details for the file arekore-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: arekore-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.13 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d7e97ebead3c3882a0ede4405f6b2e0fa7abd322ec54df002929551336c2e10 |
|
MD5 | 021d29353b725ee3dd069ad1e3a89aec |
|
BLAKE2b-256 | 3274cdc5ec61e9fc32a591cd789938852e6936d4149a9ead5f7b98d5a04bde2d |