从uci导入数据集到熊猫

时间:2019-12-28 01:15:17

标签: python pandas

我正在尝试从UCI导入数据集到pandas数据框,但是我得到的只是一个html输出。有人能帮我吗?这是我的代码:

pd.read_csv('names = ['Frequency','Angle of attack','Chord length','Free-stream velocity','Suction/side','Scaled/sound']
af = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/00291/',sep=',',names=names)')

1 个答案:

答案 0 :(得分:0)

这将加载它,我对其进行了测试:

pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/00291/airfoil_self_noise.dat', sep="\t", names = ['Frequency','Angle of attack','Chord length','Free-stream velocity','Suction/side','Scaled/sound']) 


      Frequency  Angle of attack  Chord length  Free-stream velocity  Suction/side  Scaled/sound
0           800              0.0        0.3048                  71.3      0.002663       126.201
1          1000              0.0        0.3048                  71.3      0.002663       125.201
2          1250              0.0        0.3048                  71.3      0.002663       125.951
3          1600              0.0        0.3048                  71.3      0.002663       127.591
4          2000              0.0        0.3048                  71.3      0.002663       127.461
...         ...              ...           ...                   ...           ...           ...
1498       2500             15.6        0.1016                  39.6      0.052849       110.264
1499       3150             15.6        0.1016                  39.6      0.052849       109.254
1500       4000             15.6        0.1016                  39.6      0.052849       106.604
1501       5000             15.6        0.1016                  39.6      0.052849       106.224
1502       6300             15.6        0.1016                  39.6      0.052849       104.204

[1503 rows x 6 columns]