1

I am trying to import a dataset from UCI to a pandas dataframe but all I get is an html output. Can someone help me? Here is my code:

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)')
Ann Kilzer
  • 1,266
  • 3
  • 16
  • 39
Terry.pyn
  • 21
  • 1
  • 4
  • Similar question here: https://stackoverflow.com/questions/32400867/pandas-read-csv-from-url – Tim Dec 28 '19 at 01:33

1 Answers1

3

This will load it, i tested it:

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]


oppressionslayer
  • 6,942
  • 2
  • 7
  • 24