Python series

Python series

12th Grade

15 Qs

quiz-placeholder

Similar activities

Pandas-Series

Pandas-Series

12th Grade

15 Qs

Series1

Series1

12th Grade

10 Qs

Quiz-Pandas-I-13-May

Quiz-Pandas-I-13-May

12th Grade

15 Qs

Series Object-Quiz-I

Series Object-Quiz-I

12th Grade

10 Qs

XII Series

XII Series

12th Grade

15 Qs

python-series

python-series

12th Grade

20 Qs

Python Pandas-Series

Python Pandas-Series

12th Grade

18 Qs

Pandas Series

Pandas Series

12th Grade

20 Qs

Python series

Python series

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Lalita Joshi

Used 4+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write the output for the following:

import pandas as pd1

s = pd1.Series(5, index=[0, 1, 2, 3])

print(s)

0 5

0 5

1 5

2 5

3 5

dtype: int64

1 5

2 5

2 5

4 5

dtype: int64

0 5

1 5

2 5

3 5

dtype: object

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

write the output:

import pandas as pd1

s = pd1.Series([1,2,3])

t = pd1.Series([1,2,4])

u=s-t

print (u)

0 1

1 0

2 1

dtype: int64

0 0

1 0

2 1

dtype: int64

0 0

1 0

2 -1

dtype: float64

0 0

1 0

2 -1

dtype: int64

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

write the output:

import pandas as pd

s=pd.Series([1,2,3,4],index=['a','b','c','d'])

print(s.iloc[2:4])

b 2

c 3

d 4

dtype: int64

b 3

c 4

dtype: int64

c 3

d 4

dtype: int64

none of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

write the output:

import pandas as pd

s=pd.Series([1,2,3,4],index=['a','b','c','d'])

print(s.loc['b':'d'])

b 2

c 3

d 4

dtype: float64

b 2

c 3

d 4

dtype: object

c 3

d 4

dtype: int64

b 2

c 3

d 4

dtype: int64

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Create an empty series S1

S1 = pandas.Series(empty)

S1 = pandas.series(numpy.Nan)

S1 = pandas.Series()

S1 = pandas.Series(null)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To specify data type int 16 for a series object s1 we can write

s1 = pd.Series(data = numpy.array([2,3,4]), dtype = int16)

s1 = pd.Series(data = numpy.array([2,3,4]), dtype = numpy. int16)

s1 = pd.Series(data = numpy.array([2,3,4]), dtype =pandas. int16)

all of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the correct Pandas syntax to read in a csv file and assign it to a DataFrame df?

df = read_csv('file.csv')

df = read('file.csv', type = 'csv')

df = pd.read_csv('file.csv')

df = with open('file.csv') as pd.DataFrame

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?