Worksheets › Class 12 › Data Handling using Pandas – II

Class 12 · Informatics Practices worksheet

Data Handling using Pandas – II

CBSE Informatics Practices. Descriptive statistics, sorting, groupby, missing values with count, isnull, dropna and fillna, and moving data between pandas and MySQL. Every sheet has 20 questions in three sections and an answer key, and the questions change every time.

Open a printable sample sheet

Sample questions

Real questions from this chapter, as the app sets them. Tap Answer to see the answer and working.

Section A · multiple choice

  1. 1.

    Which function gives the middle value of a sorted column?

    1. mode()
    2. count()
    3. mean()
    4. median()
    Answer

    (d) median()

  2. 2.

    DataFrame df: index | Item | Store | Price | Stock P1 | Folder | West | 24 | 38 P2 | Scissors | Central | 69 | 62 P3 | Crayons | North | 13 | 44 P4 | Sharpener | Central | 74 | 56 P5 | Glue | Central | 52 | 57 What does print(df['Stock'].median()) show?

    1. 62.0
    2. 38.0
    3. 56.0
    4. 51.4
    Answer

    (c) 56.0

    sorted: 38, 44, 56, 57, 62; the middle value

  3. 3.

    DataFrame df: index | Name | Dept | Q1 | Q2 E1 | Tara | Support | 84 | 73 E2 | Gita | Design | 82 | 92 E3 | Vikram | Design | 70 | 81 E4 | Asha | Design | 87 | 85 E5 | Rohan | Accounts | 53 | 86 What does print(df['Q1'].mean()) show?

    1. 82.0
    2. 87.0
    3. 376
    4. 75.2
    Answer

    (d) 75.2

    376 ÷ 5; mean() always gives a float

Section B · short answer

  1. 4.

    What is descriptive statistics? Name four functions pandas provides for it.

    Answer

    Summarising data by numbers that describe it, such as max(), min(), mean(), median(), mode(), count(), sum(), std(), var() and quantile().

  2. 5.

    DataFrame df: index | Item | Store | Price | Stock P1 | Sharpener | Central | 24 | 35 P2 | Folder | Central | 67 | 25 P3 | Scissors | East | 33 | 76 P4 | Ruler | East | 25 | 52 P5 | Notebook | South | 19 | 47 P6 | Stapler | South | 57 | 20 Write the output of: print(df['Stock'].max() - df['Stock'].min())

    Answer

    56

    76 − 20

Section C · long answer

  1. 6.

    Explain any four statistical functions of pandas with examples on a column Marks.

    Answer

    df['Marks'].max() gives the highest mark; min() the lowest; mean() the average (sum ÷ count); median() the middle value of the sorted marks; mode() the most frequent; std() the spread around the mean; count() the number of values present.

    one mark for each function

Fresh sheets for your child

In the app, every Data Handling using Pandas – II sheet is new: the app remembers the questions your child has already had and leaves them out. Print the sheet as a PDF, or use notebook mode and write the answers in a notebook.

Coming soon for Android and iPhone.

More Class 12 Informatics Practices