You are on page 1of 3

MCQ (1Mark each) 31-01-2018

1. Which of the following thing can be data in Pandas?
a) a python dict
b) an ndarray
c) a scalar value
d) all of the Mentioned
2. Which of the following input can be accepted by DataFrame?
a) Structured ndarray
b) Series
c) DataFrame
d) All of the Mentioned
3. Which of the following indexing capabilities is used as a concise means of selecting data
from a pandas object?
a) In
b) ix
c) ipy
d) none of the Mentioned
4. All pandas data structures are ___-mutable but not always _______-mutable.
a) size, value
b) semantic, size
c) value, size
d) none of the Mentioned
5. Which of the following function is used for fixing character vectors?
a) tolower
b) toUPPER
c) toLOWER
d) all of the Mentioned
6. Which of the following graph can be used for simple summarization of data?
a) Scatterplot
b) Overlaying
c) Barplot
d) All of the Mentioned
7. Write the list comprehension to pick out only negative integers from a given list ‘l’.
a) [x<0 in l]
b) [x for x<0 in l]
c) [x in l for x<0]
d) [x for x in l if x<0]

What is the output of the code shown below? import math [str(round(math.2.3. ‘3. 4: 4.items(): print(x. ‘3’.) a) Yes.2.14’. y) a) 0 1 2 b) a b c . ‘3’. '12')) a) ab1ef2 b) abcefd c) ab1efd d) ab12ed2 12.3) and b=(1. 2:'B'. 1: 1. 2: 4. What is the output of the following snippet of code? test = {1:'A'. What is the output of the following? d = {0: 'a'. ‘3’.replace('cd'. 6)] a) [‘3’. 3: 9.1416’. 1: 1. y in d.1416’. 3: 9.3. What is the output of the following snippet of code? >>> a={i: i*i for i in range(6)} >>> a a) Dictionary comprehension doesn’t exist b) {0: 0.2. 16: 16. ‘3’] b) [‘3. ‘3.2.1’.142’.14159’] 9. ‘3.1’. 25: 25} d) {0: 0.8. ‘3. ‘3.14159’. ‘3’. ‘3. Is the following piece of code valid? >>> a=(1. 9: 9.142’.update(4.2. a=(1. 2: 'c'} for x. 5: 25. ‘3’. What is the output of the following? print('abcefd'. 6:36} c) {0: 0. 3:'C'} test = {} print(len(test)) a) 0 b) None c) 3 d) An exception is thrown 11. ‘3’] d) [‘3.14’.141582’] c) [‘3’.4) b) Yes. 4: 16. ‘3. ‘3’.3. ‘3. 5: 25} 10.4) c) No because tuples are immutable d) No because wrong syntax for update() method 13. 2: 4. 1: 1.3) >>> b=a. 4: 16. a=(1.pi)) for i in range (1. ‘3. 1: 'b'. ‘3’.4) and b=(1.

only one wrong classification b) three classes. convert a column of data frame into five categories. (create column of 100 rows beforehand) Code (10 Marks each) 1. Create a scatter plot on lists (x. 14 correct numbers classified as class-1 c) Accuracy is about 98% d) All of the above Short Answer questions (2 Mark each) 1.y) of numbers. title and legend. having marker of shape ‘+’. Evaluate the performance of any two classifiers of your choice on provided wine_dataset. 3. (take your own data). Extract raw data from gutenbergs and demonstrate NLP. 4. color be ‘red’. 8. . c) 0 a 1 b 2 c d) none of the mentioned 14. Differentiate between append() and extend() methods. Using cut(). 2. Draw a pie chart with any one portion exploded out. How can you generate random numbers in Python? 6. Pick the write explanation if Confusion Matrix of some classifier is as follows [[14 0 0] [ 1 17 0] [ 0 0 22]] a) three classes. 7. Explain zip() function. Also add labels. How do you handle missing or corrupted data in a dataset? 5. What is a pandas DataFrame and Panel? 2.