Comprehension

Given Dataframe, df:
StateGeographical_AreaArea_Under_Dense_Forest
1Manipur784382797
2Delhi14836.72
3Kerala388521663
4Tamil Nadu406991904

Based on the above data, solve questions:

Question: 1

Identify the meaning of the given python code with respect to the given dataframe, df df = df.drop(['state'], axis = 1)

Updated On: Oct 18, 2024
  • The given code statement has an error
  • The given code statement is able to delete the State column and shows the rest dataframe
  • The given code statement makes the empty dataframe
  • The given code remove duplicate rows from the dataframe
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

The correct option is (B) : The given code statement is able to delete the State column and shows the rest dataframe
Was this answer helpful?
0
0
Question: 2

Based on the above data, solve questions: Identify the correct code to set the Geographical area of all states to 70000:

Updated On: Oct 18, 2024
  • df.loc[State] = 70000
  • df['State',:] = 70000
  • df['State'] = 70000
  • dfGeographical_Area'] = 70000
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

The correct option is (D) :dfGeographical_Area'] = 70000
Was this answer helpful?
0
0
Question: 3

Identify the error that shows on the screen while executing the given code : df.Ioc[5] = ['Meghalaya', 70000)

Updated On: Oct 18, 2024
  • Value Error : Length of values does not match length of index
  • Value Error : Cannot set a row with mismatched columns
  • Value Error : Too few parameters
  • Value Error : Enough values
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

The correct option is (B) :Value Error : Cannot set a row with mismatched columns
Was this answer helpful?
0
0
Question: 4

Identify the correct code to display Area_under_dense forest column.

Updated On: Oct 18, 2024
  • df.loc[:,'Area_under_dense_forest']
  • df.loc[2]
  • df.loc[Area_under_dense_forest']
  • df[Area_under_dense_forest]
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

The correct option is (A) :df.loc[:,'Area_under_dense_forest']
Was this answer helpful?
0
0
Question: 5

Find the output for : df.loc['Kerala']\(>30000:\)

Updated On: Oct 18, 2024
  • Geographical_Area 38852
  • Geographical Area 38852 Area_under_dense_forest 1663
  • Geographical Area True Area under dense forest False
  • Kerala 38852
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

The correct option is (C) :
Was this answer helpful?
0
0

Top Questions on Reading Comprehension

View More Questions