Search Header Logo

Practice Worksheet- Informatics Practices

Authored by JEEN JO

Computers

12th Grade

Practice Worksheet- Informatics Practices
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Assuming the given series, named stud, which command will be used to print 5 as output? Amit 90 Ramesh 100 Mahesh 50 john NaN Abdul 89 Name: Student, dtype: int64

stud.index

stud. length

stud. values

stud.size

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be produced by the following python code? (Assuming that all necessary libraries and modules are imported) series1 = pd.Series(np.array([31,28,31,30]), index = ["Jan", "Feb", "Mar"]) print(series1)

Error: Length of passed values is 4, index implies 3

No output

Jan 31 Feb 28 Mar 31

Jan 31 Feb 28 Mar 31 Apr NaN

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to return both the first column and the second column in a pandas DataFrame df? (considering default labels for rows and columns)

df.loc [ : ,0,1]

df[[0,1]]

df.loc[[0-1]]

df.loc[[0,1]]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To rename the row indices 'Emp1' to 'Manisha', 'Emp2' to 'Shreya', 'Emp3' to 'Roshan' and 'Emp4' to 'Rakesh' in a data frame EmpD, Which of the following statement (a) to (d) will be used?

EmpDF=EmpDF.rename({'Emp1':'Manisha', 'Emp2': 'Shreya', 'Emp3': 'Roshan', 'Emp4': 'Rakesh'}, axis = 'index')

EmpDF=EmpDF.rename({'Emp1':'Manisha', 'Emp2': 'Shreya', 'Emp3': 'Roshan', 4': 'Emp 'Emp4': 'Rakesh'}, axis = 'rows')

EmpDF=EmpDF.rename(['Emp1':'Manisha', 'Emp2': 'Shreya', 'Emp3': 'Roshan', 'Emp': 'Rakesh'], axis = 'index')

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The correct statement to read from a CSV file in a DataFrame is:

.read_csv()

. read_csv( )()

=pandas.read()

= pandas.read_csv()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following command is used to display values of all the records having price>3?

print(df[df['price']>3])

print(df['price']>3)

print(df.price>3])

print(df('price')>3)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following can be used to specify the data while creating a DataFrame?

Series

List of Dictionaries

Structured ndarray

All of these

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?