I've a dat
file in the following format which I'm trying to load using pandas
.
28::Persuasion (1995)::Romance
29::City of Lost Children, The (1995)::Adventure|Sci-Fi
30::Shanghai Triad (Yao a yao yao dao waipo qiao) (1995)::Drama
31::Dangerous Minds (1995)::Drama
32::Twelve Monkeys (1995)::Drama|Sci-Fi
33::Wings of Courage (1995)::Adventure|Romance
34::Babe (1995)::Children's|Comedy|Drama
Code
movies = pd.read_csv('movies.dat')
I'm getting this error
ParserError: Error tokenizing data. C error: Expected 1 fields in line 11, saw 2
Line 11:
11::American President, The (1995)::Comedy|Drama|Romance
I understand that it's because of the comma. One option I found is to skip these lines, which I don't want to. Is it possible to set newline as the delimiter here? Any help will be truly appreciated.
::
should be fine. later i can sort out the genre which are separated by|
$\endgroup$