CBSE Class 12 Informatics Practices Question 58 of 70

Importing/Exporting Data between CSV Files/MySQL and Pandas — Question 2

Back to all questions
2
Question

Question 2

Are the following two statements same ? Why/Why not ?

(i) pd.read_csv('zoo.csv', sep = ',')

(ii) pd.read_csv('zoo.csv')

Answer

Yes, the two statements are same. The reason is that when we don't explicitly specify the sep parameter in pd.read_csv(), pandas assumes the default separator to be a comma (,). So, both statements are telling pandas to read the CSV file "zoo.csv" with comma-separated values.