'CSV-file parsed incorrect

I downloaded this file from kaggle: https://www.kaggle.com/code/shainy/twitter-emotion-analysis/data

And then I ran this code in python:

import pandas as pd
twitter_data = "/Users/arskad/Desktop/data.csv" 
dataset = pd.read_csv(twitter_data, sep='\t') 
dataset.loc['Search key']

And I got an error although that's the name of one of the columns in the dataset. I tried also with SI no, Feeling, Tweets. And I got the same errors for each case.

I also tried dataset['x'] for x Search key, Feeling, SI no - I got errors.

I then tried: dataset.iloc[:, 1:2] and dataset.iloc[:, 1:3] and dataset.iloc[:, 2:3] and they all return a column with indices although the columns in dataset are different.

Can someone help me out here? What has gone wrong? Should I do something with the data in Excel in order it can work as a proper cdv-file in python? I am using a Mac btw.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source