|
|
|
import simplestart as ss |
|
import pandas as pd |
|
|
|
ss.md(''' |
|
## Iris数据集 |
|
数据集包含150个数据样本,分为3类,即Setosa,Versicolour,Virginica。每类50个数据,每个数据包含4个属性。 |
|
''') |
|
|
|
ss.space() |
|
|
|
title = "表1. Iris数据集" |
|
subtitle = "sepal_length 花萼长度, sepal_width 花萼宽度, petal_lenght 花瓣长度, petal_width 花瓣宽度" |
|
|
|
pd.options.display.float_format = '{:.2f}'.format |
|
df = pd.read_csv("./data/iris.csv") |
|
|
|
ss.table(df, index=True, title = title, subtitle = subtitle, width=400) |
|
|
|
|
|
ss.table(df.describe(), index=True) |
|
|
|
|
|
ss.md("---") |
|
|
|
import numpy as np |
|
|
|
np.random.seed(0) |
|
|
|
num_rows = 10000 |
|
data = { |
|
'Column1': np.random.randint(0, 100, size=num_rows), |
|
'Column2': np.random.random(size=num_rows), |
|
'Column3': np.random.choice(['A', 'B', 'C', 'D'], size=num_rows), |
|
} |