Whilst trying to import the popular
How can I import the dataset (link) correctly from the URL using pandas read_csv
?
CodePudding user response:
You don't need to set the headers. It already comes with the headers in the CSV. The reason yours looks weird, is because you are missing 3 values in your headers list, which is why it's offset by 3.
CodePudding user response:
The following syntax shows a consistent result:
raw_dataset = pd.read_csv(url, sep=";")