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

Consider the following DataFrame emp and answer the any four questions from (i) to (v) 5

Empno Name Dept Salary Experience (in years)
1 Ram Singh IT 15000 2.5
2 Shyam Singh HR 18000 3
3 Nidhi Gupta IT 9000 2
4 Pooja Sharma EXE 24000 8
5 Rohan Malik HR 20000 6

(i) Write down the command that will give the following output.

Empno 5

Name Rohan Malik

Dept HR

Salary 20000

Experience 6

dtype: object

a. print(emp.max)

b. print(emp.max())

c. print(emp.max(axis=1))

d. print(emp.max,axis=1)

(ii) CEO needs to know the salary of the employee with empno 4. Help him to identify the correct set of statement/s from the given options:

a. emp1=emp[emp[‘empno’]==4] print(emp1)

b. emp1=emp[emp] print(emp1)

c. emp1=emp[emp.empno=4] print(emp1)

d. emp1=emp[emp.empno==4] print(emp1)

(iii) Which of the following statement/s will give the exact number of values in each column of the dataframe?

i. print(emp.count())

ii. print(emp.count(0))

iii. print(emp.count)

iv. print(emp.count(axis=’index’))

Choose the correct option:

a. both (i) and(ii)

b. only(ii)

c. (i), (ii) and(iii)

d. (i), (ii) and(iv)

(iv) Which of the following command will display the column labels of the DataFrame?

a. print(emp.columns())

b. print(emp.column())

c. print(emp.column)

d. print(emp.columns)

(v) Mr. Satvik Ahuja, the CEO wants to add a new column, the rating of the performance of employees with the values, ‘A’, ‘A’, ‘B’, ‘A’, ‘B’, to the DataFrame. Help him choose the command to do so:

a. emp.column=[’A’,’A’,’B’,’A’,’B’]

b. emp[‘Performance’]=[ ’A’,’A’,’B’,’A’,’B’]

c. emp.loc[‘Performance’]= [’A’,’A’,’B’,’A’,’B’]

d. Both (b) and (c) are correct

1 Answer

+1 vote
by (55.0k points)
selected by
 
Best answer

(i) b. print(emp.max())

(ii) a. emp1=emp[emp[‘empno’]==4]

print(emp1)

d.emp1=emp[emp.empno==4]

print(emp1)

(iii) a. both (i) and (ii)

(iv) d. print(emp.columns)

(v) b. emp[‘Performance’]=[ ’A’,’A’,’B’,’A’,’B’]

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

...