Skip to content
Question 45 of 53

Q.Which of the following is NOT true with respect to CSV files ? (A) Values are separated by commas. (B) to_csv() can be used to save a dataframe to a CSV file. (C) CSV file is created using a word processor. (D) CSV file is a type of text file.

West Bengal WbchseCBSE Class XII Board 2024MCQ· 1mImportance★★★★★
85% · 45/53 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

CSV files store tabular data as plain text, with values separated by commas. They are not typically created using word processors, which are designed for rich text formatting, but rather by spreadsheet software, databases, or programming scripts. The incorrect statement is that a CSV file is created using a word processor.

CSV (Comma Separated Values) files are a fundamental format for storing tabular data. Understanding their nature is crucial for data handling, especially in programming and data analysis contexts. The core idea behind a CSV file is simplicity: it's a plain text file where each line represents a row of data, and the values within that row are separated by a specific delimiter, most commonly a comma.

Let's examine each option to determine which statement is not true.

  1. Analyze Option (A): Values are separated by commas.

    This statement directly reflects the name "Comma Separated Values." The primary characteristic of a CSV file is that it uses commas to delineate individual data points (fields) within each record (row). For example, a CSV file might look like this:

    Name,Age,City

    Alice,30,New York

    Bob,24,London

    This statement is true.

  2. Analyze Option (B): to_csv() can be used to save a dataframe to a CSV file.

    In data science and programming, particularly with libraries like Pandas in Python, DataFrame.to_csv() is a standard and widely used method. It allows you to take a structured data object (a DataFrame) and export its contents into a CSV file format. This is an essential function for persisting data or sharing it in a common format.

    For example, in Python with Pandas:

    import pandas as pd
    data = {'col1': [1, 2], 'col2': [3, 4]}
    df = pd.DataFrame(data)
    df.to_csv('my_data.csv', index=False) # Saves the DataFrame to a CSV file
    

    This statement is true.

  3. Analyze Option (C): CSV file is created using a word processor. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.