Pandas1 Rev
Pandas1 Rev
To create any kind of Series object, which method you may use:
a) Pandas
b) Series
d) none of these
a) len()
b) count()
d) none of these
a) S.tail()
b) S.head(6)
c) S.head(0:4)
d) none of these
a) Null
b) None
c) Missing
d) NaN
5. The data label associated with a particular value of Series is called its…………
a) Data Value
b) Index
c) Value
d)None of the above
a.
import pandas as pd
S1 = pd.Series(data = [31,28,31], index=["Jan","Feb","Mar"])
print(S1)
b.
import pandas as pd
S1 = pd.Series([31,28,31], index=["Jan","Feb","Mar"])
print(S1)
import pandas as pd
c. Error
d. None of the above
10. Write the statement to get NewDelhi as output using positional index.
import pandas as pd
S1 = pd.Series(['NewDelhi', 'WashingtonDC', 'London', 'Paris'],
index=['India', 'USA', 'UK', 'France'])
a. print(S1[0])
b. print(S1[‘India’])
c. Both of the above
d. print(S1.India)
5. Create a series with 5 elements, then find square of each even elements an
find cube of each odd elements.