pandas-读取数据
pandas-读取数据
import pandas as pd
data = pd.read_csv("./data/Affairs/csv")
data.head()
rownames | affairs | gender | age | yearsmarried | children | religiousness | education | occupation | rating | |
---|---|---|---|---|---|---|---|---|---|---|
0 | 4 | 0 | male | 37.0 | 10.00 | no | 3 | 18 | 7 | 4 |
1 | 5 | 0 | female | 27.0 | 4.00 | no | 4 | 14 | 6 | 4 |
2 | 11 | 0 | female | 32.0 | 15.00 | yes | 1 | 12 | 1 | 4 |
3 | 16 | 0 | male | 57.0 | 15.00 | yes | 5 | 18 | 6 | 5 |
4 | 23 | 0 | male | 22.0 | 0.75 | no | 2 | 17 | 6 | 3 |