CARVIEW |
Reading CSV File
This section explores various ways to create dataframes using lists, dictionaries, NumPy arrays, and other data sources, laying the foundation for efficient data manipulation.
Question 1
Which method is used to read a CSV file in pandas?
pd.read_csv()
pd.load_csv()
pd.csv_read()
pd.import_csv()
Question 2
What is the default delimiter in pd.read_csv()?
Tab (\t)
Comma (,)
Pipe (|)
None of the above
Question 3
How can you skip rows while reading a CSV file?
Use skip_rows argument
Use skiprows argument
Use drop_rows argument
It is not possible
Question 4
How do you specify custom column names while reading a CSV file?
Use names argument
Use columns argument
Use headers argument
Use col_names argument
Question 5
What happens if a column name contains spaces in the CSV file?
pandas replaces spaces with underscores
pandas leave spaces intact
pandas throw an error
pandas remove the spaces
Question 6
How do you load only specific columns from a CSV file?
Use cols argument
Use usecols argument
Use columns argument
It is not possible
Question 7
Which parameter is used to handle missing values while reading a CSV?
na_values
fill_values
handle_na
None of the above
Question 8
How can you read a large CSV file in chunks?
Use chunksize argument
Use chunk_rows argument
Use read_chunked argument
None of the above
Question 9
What will happen if index_col=0 is used in pd.read_csv()?
Sets the first column as the index
Skips the first column
Leaves the file unchanged
Throws an error
Question 10
How do you handle encoding issues when reading a CSV file?
Use encoding argument
Use charset argument
Use utf_encoding argument
It is not possible
There are 10 questions to complete.