Jupyter导入数据

1.打开anaconda,点击进入jupyter,desktop,new

Jupyter导入数据_第1张图片

 2.导入pandas数据

import pandas as pd
data=pd.read_csv('D:/Anaconda/Affairs.csv')
print(data.head(10))

Unnamed: 0  affairs  gender   age  yearsmarried children  religiousness  \
0           4        0    male  37.0         10.00       no              3   
1           5        0  female  27.0          4.00       no              4   
2          11        0  female  32.0         15.00      yes              1   
3          16        0    male  57.0         15.00      yes              5   
4          23        0    male  22.0          0.75       no              2   
5          29        0  female  32.0          1.50       no              2   
6          44        0  female  22.0          0.75       no              2   
7          45        0    male  57.0         15.00      yes              2   
8          47        0  female  32.0         15.00      yes              4   
9          49        0    male  22.0          1.50       no              4   

   education  occupation  rating  
0         18           7       4  
1         14           6       4  
2         12           1       4  
3         18           6       5  
4         17           6       3  
5         17           5       5  
6         12           1       3  
7         14           4       4  
8         16           1       2  
9         14           4       5  

Jupyter导入数据_第2张图片

 学号:202113430110

姓名:罗媛

你可能感兴趣的:(jupyter,python,ide)