0% found this document useful (0 votes)
9 views18 pages

Informatics Practices: Part - 1 Data Handling Using Pandas

The document outlines a series of questions and answers related to data handling using the Pandas library in Python. It includes tasks such as creating series, dataframes, and performing operations like shifting values and calculating scores. Additionally, it touches on data visualization tasks involving plotting specific datasets.

Uploaded by

sammamehra07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views18 pages

Informatics Practices: Part - 1 Data Handling Using Pandas

The document outlines a series of questions and answers related to data handling using the Pandas library in Python. It includes tasks such as creating series, dataframes, and performing operations like shifting values and calculating scores. Additionally, it touches on data visualization tasks involving plotting specific datasets.

Uploaded by

sammamehra07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

INFORMATICS PRACTICES

PART – 1
DATA HANDLING USING PANDAS

QUES 1 CREATE A SERIES OF THESE NUMBERS :33,55,65,29,19,23.


ANS 1 INPUT -

OUTPUT-

QUES 2 CREATE A SERIES OF 10 NUMBERS STARTING WITH 41 AND ENDING WITH 71 WITH AN
INCREMENT OF 3
ANS 2 INPUT –
OUTPUT-

QUES 3 CREATE A SERIES AND PRINT THE TOP 3 ELEMENTS USING HEAD FUNCTION
ANS 3 INPUT-

-
OUTPUT-

QUES 4 CREATE A SERIES AND PRINT THE BOTTOM 3 ELEMENTS USING THE TAIL FUNCTION
ANS 4 INPUT
OUTPUT-

QUES 5 CREATE A SERIES WITH THESE NUMBERS : 21,51,71,31,12.EXCHANGE ALL THESE VALUES OF SERIES
BY SHIFTING EACH OF THEM BY ONE TO ONE POSITION BEFORE AND BY SHIFTING THE FIRST VALUE TO THE
LAST POSITION
ANS 5 INPUT-

OUTPUT-
QUES 6 CREATE A DATAFRAME NAMED AS STUDENT USING A LIST OF NAMES OF 5 STUDENTS .
ANS 6 INPUT

OUTPUT-

QUES 7 CREATE A DATAFRAME PLAYERS USING A LIST OF NAMES AND SCORES OF THE PREVIOUS
THREE MATCHES (USING NESTED LISTS ).
Data=[["VIRAT",55,6,31],["ROHIT",88,66,43],["DHONI",99,85,68]]
ANS 7 INPUT-

OUTPUT-
QUES 8 CREATE A DATAFRAME COUNTRIES USING A DICTIONARY WHICH STORED COUNTRY NAME ,
CAPITALS, AND POPULATIONS OF THE COUNTRY
ANS 8 INPUT –
OUTPUT-

-
QUES 9 MAKE A TOTAL OF SCORE FROM THE DATAFRAME PLAYERS AND DISPLAY THEIR RANK
ACCORDING TO THEIR SCORES
ANS 9 INPUT

OUTPUT-

QUES 10 PRINT THE BATSMAN NAME ALONG WITH RUNS SCORED IN TEST AND T20 USING
COLUMN NAMES AND DO T NOTATION. PLAYER_DATA={“NAME”:[“virat”, “rohit”,
“ajay”,”hardik”,”shikhar”], “test”:[3543,2578,2280,2158,1879], “odi”:[2245,2165,2080,1957,1856],
“t20”:[1925,1853,1522,1020,980]}
ANS 10 INPUT
OUTPUT-
QUES 11 DISPLAY THE BATSMAN NAME ALONG THE WITH THR RUNS SCORED IN TEST AND T
ANS 11 INPUT-

OUTPUT-

QUES 12 DISPLAY THE BATSMAN WHO SCORED


MORE THAN 2000 IN ODI
LESS THAN 2500 IN TEST
MORE THAN 1500 IN T20
ANS 12 INPUT

OUTPUT –

PART 2 : DATA
VISUALIZATIONS
INPUT –
OUTPUT-
INPUT-
OUTPUT
QUES 15 USE THE ABOVE DATA AND PLOT THE SANITIZER DATA AND HANDWASH DATA
ANS 15 INPUT

OUTPUT
ANS 16 INPUT

OUTPUT -

You might also like