31. What is the result of the following lines of code?
a=np.array([0,1,0,1,0]) b=np.array([1,0,1,0,1]) a/b
- array([0.1, 1.0, 0.1, 1.0, 0.1])
- array([1, 1, 1, 1, 1])
- Division by zero error
32. What is the result of the following lines of code?
a=np.array([1,1,1,1,1]) a+10
- array([10,10,10,10,10])
- array([1,1,1,1,1])
- array([11, 11, 11, 11, 11])
33. What does the following line of code select along with the headers ‘Artist’, ‘Length’ and ‘Genre’ from the dataframe df?
y=df[['Artist','Length','Genre']]
- The entire dataframe
- Rows
- Columns
34. Consider the file object: File1. How would you print the first two lines of text?
- file1.readline(4)
- for n in range(0,2): print(file1.readline())
35. Consider the following line of code:
with open("Example.txt","a") as file1:
What mode is the file object in?
- append
- read
- write