WorksheetsTRYING
Total questions: 25
Worksheet time: 10mins
Choose the correct option for SERIES?
Size is mutable,Values is mutable
size is immutable,values is mutable
size is mutable,values is immutable.
none
Series.tail(3) will return how many values.
3 values from front
3 values from last
5 values
none
How many rows are returned by Series.head(5) ?
2
3
4
5
we can analyze the data in pandas with :
Series
Dataframe
Both
none
Series in Pandas is
1 Dimensional Array
2 Dimensional array
3 Dimensional array
none of above
In data science, which of the python library are more popular ?
numpy
pandas
django
none
Series can be created from
Array
Dictionary
Scatter value
All of them
pandas is a:
Data Structure
Series
Dataframe
Library
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
write the output:
import pandas as pd
s=pd.Series([22,44,66],index=['b','e','h'])
print(s)
b 22
e 44
h 66
dtype: int64
b 22
e 44
dtype: int64
none of the above
Find the correct output of the given snippet:
import pandas as pd
d=[30,54,17,24]
s=pd.Series(d,index=['a','b','c','d'])
print(s.loc['b':'d'])
b 54
c 17
d 24
dtype: float64
b 54
c 17
d 24
dtype: object
c 17
d 24
dtype: int64
b 54
c 17
d 54
dtype: int64
Which is true for series.
Size is mutable,Values is mutable
size is immutable,values is mutable
size is mutable,values is immutable.
none
Which is not a feature of series
Homogeneous data
Immutable size
Mutable data
Multiple rows
Series can be created from
Array
Dictionary
Scatter value
All of them
Choose the Best way to import the pandas module in your python program ?
1.import pandas
2.import pandas as pd
3.from pandas import *
4.All of the above
The SQL statement to count distinct rows from a column is,
select COUNT DISTINCT columnname AS total_rows from tablename;
select (COUNT DISTINCT columnname) AS total_rows from tablename;
select DISTINCT columnname AS total_rows from tablename;
select COUNT (DISTINCT) AS total_rows from tablename;
The COUNT() function also counts the NULL values.
True
False
The SUM() function returns - - -
some random values from the given column
the total number of columns in the database
the total number of tables in the given databases
the total sum of a given numeric column
In a column named "age", containing values 4, 5, 0, NULL, 6 the SQL statement "SELECT SUM(age) FROM students;" will return,
3
15
0
1
The average value of the given numeric column is calculated by using - - - function.
GETAVG()
FINDAVG()
AVG()
AVGVALUE()
Which one of the following is an Multiple row Functions?
COUNT()
LEN()
AVERAGE()
NOW()
A table T_COUNT has 12 number values as 1, 2, 3, 32, 1, 1, null, 24, 12, null, 32, null. Predict the output of the below query.
SELECT COUNT (*) FROM t_count;
12
6
9
Throws exception because COUNT function doesn't works with NULL values
A table stud has a column age with 7 records as 10, 12, 13, 32, null, 24, null. Predict the output of the below query.
SELECT COUNT (age) FROM stud;
5
6
Error
7
A table Books has a column DateOfPurchase with 4 records as NULL, 22-1-2008, 18-3-2008, 24-1-2011. Predict the output of the below query.
SELECT MAX (dateofPurchase) FROM Books;
24-1-2011
22-1-2008
NULL
18-3-2008
A table Books has a column DateOfPurchase with 4 records as NULL, 22-1-2008, 18-3-2008, 24-1-2011. Predict the output of the below query.
SELECT MIN (dateofPurchase) FROM Books;
24-1-2011
22-1-2008
NULL
18-3-2008
