Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
6.4k views
in Information Technology by (72.8k points)
closed by

Ekam, a Data Analyst with a multinational brand has designed the DataFrame df that contains the four quarter’s sales data of different stores as shown below:

Store Qtr1 Qtr2 Qtr3 Qtr4
0 Store1 300 240 450 230
1 Store2 350 340 403 210
2 Store3 250 180 145 160

Answer the following questions:

i. Predict the output of the following python statement:

a. print(df.size)

b. print(df[1:3])

ii. Delete the last row from the DataFrame.

iii. Write Python statement to add a new column Total_Sales which is the addition of all the 4 quarter sales.

1 Answer

+1 vote
by (62.6k points)
selected by
 
Best answer
i. a. 15
b. Store Qtr1 Qtr2 Qtr3 Qtr4
1 Store2 350 340 403 210
2 Store3 250 180 145 160
ii. df=df.drop(2)
df.drop(2,axis=0)
iii. df["total"]=df["Qtr1"]+df["Qtr2"]+df["Qtr3"]+df["Qtr 4"]

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...