I'm using Twint to create a .csv file with ten results. But whenever I try to load it into a pandas dataframe, I get an error. Can someone help me to understand what is going on?
Traceback (most recent call last):
File "k:\Documents\Visual Studio Code\Twitter Project\exploratory stage.py", line 4, in <module>
scrapedData = pd.read_csv('demo.csv')
File "K:\Programs\Python\lib\site-packages\pandas\util\_decorators.py", line 311, in wrapper
return func(*args, **kwargs)
File "K:\Programs\Python\lib\site-packages\pandas\io\parsers\readers.py", line 586, in
read_csv
return _read(filepath_or_buffer, kwds)
File "K:\Programs\Python\lib\site-packages\pandas\io\parsers\readers.py", line 488, in
_read
return parser.read(nrows)
File "K:\Programs\Python\lib\site-packages\pandas\io\parsers\readers.py", line 1047, in read
index, columns, col_dict = self._engine.read(nrows)
File "K:\Programs\Python\lib\site-packages\pandas\io\parsers\c_parser_wrapper.py", line 223, in read
chunks = self._reader.read_low_memory(nrows)
File "pandas\_libs\parsers.pyx", line 801, in pandas._libs.parsers.TextReader.read_low_memory
File "pandas\_libs\parsers.pyx", line 857, in pandas._libs.parsers.TextReader._read_rows
File "pandas\_libs\parsers.pyx", line 843, in pandas._libs.parsers.TextReader._tokenize_rows
File "pandas\_libs\parsers.pyx", line 1925, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 3, saw 3
-Edit-
I looked at my csv file and realized that the data was formatted strangely. One whole line of information including the username, date time and tweet would all be cramped into a cell.
And for a few other rows, the tweets would break off and continue in the cell next to it. It looks something like this.