मराठी

NCERT solutions for इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ chapter 2 - Data Handling using Pandas - I [Latest edition]

Advertisements

Chapters

NCERT solutions for इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ chapter 2 - Data Handling using Pandas - I - Shaalaa.com
Advertisements

Solutions for Chapter 2: Data Handling using Pandas - I

Below listed, you can find solutions for Chapter 2 of CBSE NCERT for इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२.


Intext QuestionsExercise
Intext Questions [Pages 30 - 57]

NCERT solutions for इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ 2 Data Handling using Pandas - I Intext Questions [Pages 30 - 57]

Activity 2.1

1.Page 30

Create a series having names of any five famous monuments of India and assign their States as index values.

Think and Reflect

2.Page 30

While importing Pandas, is it mandatory to always use pd as an alias name? What would happen if we give any other name?

Activity 2.2

3.Page 32

Write the statement to get NewDelhi as output using positional index.

Activity 2.3

4.Page 35

Consider the following code:

>>>import pandas as pd >>>import numpy as np >>>s2=pd.
Series([12,np.nan,10]) >>>print(s2) 

Find the output of the above code and write a Python statement to count and display only non-null values in the above series.

Activity 2.4

5.Page 38

Draw two tables for subtraction similar to tables showing the changes in the series elements and corresponding output without replacing the missing values, and after replacing the missing values with 1000.

index value from
seriesA
value from
seriesB
seriesA + seriesB
a 1 −10 −9.0
b 2   NaN
c 3 −50 −47.0
d 4   NaN
e 5 100 105.00
y   20 NaN
z   10 NaN

 

index value from
seriesA
value from
seriesB
seriesA + seriesB
a 1 −10 −9.0
b 2  0 2.0
c 3 −50 −47.0
d 4  000 4.0
e 5 100 105.00
y 0 20 20.0
z 0 10 10.0

Activity 2.5

6.Page 38

Draw two tables for multiplication similar to the tables showing the changes in the series elements and corresponding output without replacing the missing values, and after replacing the missing values with 0.

index value from
seriesA
value from
seriesB
seriesA + seriesB
a 1 −10 −9.0
b 2   NaN
c 3 −50 −47.0
d 4   NaN
e 5 100 105.00
y   20 NaN
z   10 NaN

 

index value from
seriesA
value from
seriesB
seriesA + seriesB
a 1 −10 −9.0
b 2  0 2.0
c 3 −50 −47.0
d 4  000 4.0
e 5 100 105.00
y 0 20 20.0
z 0 10 10.0

Activity 2.6

7.Page 39

Draw two tables for division similar to tables showing the changes in the series elements and corresponding output without replacing the missing values, and after replacing the missing values with 0.

index value from
seriesA
value from
seriesB
seriesA + seriesB
a 1 −10 −9.0
b 2   NaN
c 3 −50 −47.0
d 4   NaN
e 5 100 105.00
y   20 NaN
z   10 NaN

 

index value from
seriesA
value from
seriesB
seriesA + seriesB
a 1 −10 −9.0
b 2  0 2.0
c 3 −50 −47.0
d 4  000 4.0
e 5 100 105.00
y 0 20 20.0
z 0 10 10.0

Think and Reflect

8.Page 41
>>> import pandas as pd
>>> dFrameEmt = pd.DataFrame()
>>> dFrameEmt
Empty DataFrame
Columns: []
Index: []

What would happen if we pass 3 columns or 5 columns instead of 4 in the above code? What is the reason?

Activity 2.7

9.Page 41

Use the type function to check the datatypes of ResultSheet and ResultDF. Are they the same?

Think and Reflect

10Page 46

Can you write a program to count the number of rows and columns in a DataFram?

Think and Reflect

11.Page 48

What if in the rename function we pass a value for a row label that does not exist?

Think and Reflect

12.Page 49

What would happen if the label or row index passed is not present in the DataFrame?

Activity 2.8

a)Page 51

Using the DataFrame ResultDF, write the statement to access Marks of Arnab in Maths.

b)Page 51

Create a DataFrame having 5 rows and write the statement to get the first 4 rows of it.

Think and Reflect

1.Page 53

How can you check whether a given DataFrame has any missing value or not?

Think and Reflect

2.Page 57

What are the other parameters that can be used with read_csv() function? You may explore from https:// pandas.pydata.org.

3.Page 57

Besides comma, what are the other allowed characters that can be used as a separator while creating a CSV file frmo a DataFrame?

Exercise [Pages 60 - 62]

NCERT solutions for इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ 2 Data Handling using Pandas - I Exercise [Pages 60 - 62]

1. aPage 60

What is a series?

1. bPage 60

How Series is Different from 1-D Array, List, and Dictionary

2. aPage 60

What is a DataFrame?

2.Page 60

How is the difference between a DataFrame and 2-D array.

2.Page 60

How are DataFrames related to Series?

4. (i)Page 60

What do you understand by the size of a Serie?

4. (ii)Page 60

What do you understand by the size of a DataFrame?

5. a)Page 60

Create the following series and do the specified operation:

EngAlph, having 26 elements with the alphabets as values and default index values.

5. b)Page 60

Create the following series and do the specified operation:

Vowels, having 5 elements with index labels ‘a’, ‘e’, ‘i’, ‘o’ and ‘u’ and all the five values set to zero. Check if it is an empty series.

5. c)Page 60

Create the following series and do the specified operation:

Friends, from a dictionary having roll numbers of five of your friends as data and their first name as keys.

5. d)Page 60

Create the following series and do the specified operation:

MTseries, an empty series. Check if it is an empty series.

5. e)Page 60

Create the following series and do the specified operation:

MonthDays, from a numpy array having the number of days in the 12 months of a year. The labels should be the month numbers from 1 to 12.

6.Page 60

Using the Series created in Question 5, write commands for the following:

  1. Set all the values of Vowels to 10 and display the Series
  2. Divide all values of Vowels by 2 and display the Series.
  3. Create another series Vowels1 having 5 elements with index labels ‘a’, ‘e’, ‘i’, ‘o’ and ‘u’ having values [2,5,6,3,8] respectively.
  4. Add Vowels and Vowels1 and assign the result to Vowels3
  5. Subtract, Multiply and Divide Vowels by Vowels1.
  6. Alter the labels of Vowels1 to [‘A’, ‘E’, ‘I’, ‘O’, ‘U’].
7.Page 60

Using the series created in Question 5, write commands for the following:

  1. Find the dimensions, size and values of the Series EngAlph, Vowels, Friends, MTseries, MonthDays.
  2. Rename the Series MTseries as SeriesEmpty.
  3. Name the index of the Series MonthDays as monthno and that of Series Friends as Fname.
  4. Display the 3rd and 2nd value of the Series Friends, in that order.
  5. Display the alphabets ‘e’ to ‘p’ from the Series EngAlph.
  6. Display the first 10 values in the Series EngAlph.
  7. Display the last 10 values in the Series EngAlph.
  8. Display the MTseries.
8.Page 61

Using the series created in Question 5, write commands for the following:

  1. Display the names of the months 3 through 7 from the Series MonthDays.
  2. Display the Series MonthDays in reverse order.
9.Page 61

Create the following DataFrame Sales containing year wise sales figures for five sales persons in INR. Use the years as column labels, and sales person names as row labels.

  2014 2015 2016 2017
Madhu 100.5 12000 20000 50000
Kusum 150.8 18000 50000 60000
Kinshuk 200.9 22000 70000 70000
Ankit 30000 30000 100000 80000
Shruti 40000 45000 125000 90000
10.Page 61

Use the DataFrame created in Question 9 above to do the following:

  1. Display the row labels of Sales.
  2. Display the column labels of Sales.
  3. Display the data types of each column of Sales.
  4. Display the dimensions, shape, size and values of Sales.
  5. Display the last two rows of Sales.
  6. Display the first two columns of Sales.
  7. Create a dictionary using the following data. Use this dictionary to create a DataFrame Sales2.
      2018
    Madhu 160000
    Kusum 110000
    Kinshuk 500000
    Ankit 340000
    Shruti 900000
  8. Check if Sales2 is empty or it contains data.
11.Page 62

Use the DataFrame created in Question 9 above to do the following:

  1. Append the DataFrame Sales2 to the DataFrame Sales.
  2. Change the DataFrame Sales such that it becomes its transpose.
  3. Display the sales made by all sales persons in the year 2017.
  4. Display the sales made by Madhu and Ankit in the year 2017 and 2018.
  5. Display the sales made by Shruti 2016.
  6. Add data to Sales for salesman Sumeet where the sales made are [196.2, 37800, 52000, 78438, 38852] in the years [2014, 2015, 2016, 2017, 2018] respectively.
  7. Delete the data for the year 2014 from the DataFrame Sales.
  8. Delete the data for sales man Kinshuk from the DataFrame Sales.
  9. Change the name of the salesperson Ankit to Vivaan and Madhu to Shailesh.
  10. Update the sale made by Shailesh in 2018 to 100000.
  11. Write the values of DataFrame Sales to a comma separated file SalesFigures.csv on the disk. Do not write the row labels and column labels.
  12. Read the data in the file SalesFigures.csv into a DataFrame SalesRetrieved and Display it. Now update the row labels and column labels of SalesRetrieved to be the same as that of Sales.

Solutions for 2: Data Handling using Pandas - I

Intext QuestionsExercise
NCERT solutions for इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ chapter 2 - Data Handling using Pandas - I - Shaalaa.com

NCERT solutions for इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ chapter 2 - Data Handling using Pandas - I

Shaalaa.com has the CBSE Mathematics इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ CBSE solutions in a manner that help students grasp basic concepts better and faster. The detailed, step-by-step solutions will help you understand the concepts better and clarify any confusion. NCERT solutions for Mathematics इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ CBSE 2 (Data Handling using Pandas - I) include all questions with answers and detailed explanations. This will clear students' doubts about questions and improve their application skills while preparing for board exams.

Further, we at Shaalaa.com provide such solutions so students can prepare for written exams. NCERT textbook solutions can be a core help for self-study and provide excellent self-help guidance for students.

Concepts covered in इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ chapter 2 Data Handling using Pandas - I are .

Using NCERT इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ solutions Data Handling using Pandas - I exercise by students is an easy way to prepare for the exams, as they involve solutions arranged chapter-wise and also page-wise. The questions involved in NCERT Solutions are essential questions that can be asked in the final exam. Maximum CBSE इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ students prefer NCERT Textbook Solutions to score more in exams.

Get the free view of Chapter 2, Data Handling using Pandas - I इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ additional questions for Mathematics इन्फोर्मेटिक्स प्रैक्टिसिज़ [इंग्रजी] इयत्ता १२ CBSE, and you can use Shaalaa.com to keep it handy for your exam preparation.

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×