gpt4 book ai didi

python - 将数据集从 uci 导入到 pandas

转载 作者:太空宇宙 更新时间:2023-11-03 19:56:25 25 4
gpt4 key购买 nike

我正在尝试将数据集从 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)')

最佳答案

这将加载它,我测试了它:

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]


关于python - 将数据集从 uci 导入到 pandas,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59507399/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com