NEW
Font size
WorksheetsData Analysis Quiz-1
Total questions: 49
Worksheet time: 49mins
What will be the output of the following code?
import numpy as np
a = np.array([1, 2, 3])
b = a
b[0] = 99
print(a[0])
1
99
Error
None
Which of the following creates a 3×3 array with all values as True?
np.ones((3,3))
np.ones((3,3), dtype=bool)
np.bool((3,3))
np.full((3,3), 1)
What is the output of:
np.arange(2, 10, 2).sum()
20
30
40
24
Which NumPy function returns evenly spaced numbers over a specified interval (including both start and stop)?
np.arange()
np.linspace()
np.logspace()
np.repeat()
What will be the shape of the array created by:
np.zeros((2,3,4))
(2,3)
(2,3,4)
(3,4,2)
(4,3,2
Output of:
a = np.array([10, 20, 30])
b = np.array([1, 2, 3])
print(a / b)
[10, 10, 10]
[10., 10., 10.]
[10., 10., 10.]
[10., 10., 10.]
Which function gives the number of dimensions of an array?
ndim()
np.ndim()
array.ndim
np.array_dim()
What is the data type of np.arange(5) by default?
int
float
complex
object
Output of:
np.array([1,2,3]) + np.array([[1],[2],[3]])
Error
[[2,3,4],[3,4,5],[4,5,6]]
[[2,4,6]]
[2,3,4,5,6]
Which one gives a flattened copy of an array?
ravel()
flatten
Both
None
What does np.eye(3) create?
3×3 array of zeros
3×3 identity matrix
3×3 diagonal of ones
B and C both
What is the output type of np.mean([1,2,3])?
int
float
complex
None
Which command gives element-wise square root?
np.sqrt()
np.square()
np.exp()
np.power()
What will np.arange(3,7) produce?
[3,4,5,6,7]
[3,4,5,6]
[3,5,7]
[3,4,5]
Which NumPy function gives random integers between 1 and 10 (exclusive of 10)?
np.random.randint(1,10)
np.random.randint(1,10,exclusive=True)
np.randint(1,10)
np.random.random(1,10)
What is the default data type of np.zeros(3)?
int
float
complex
bool
What happens if you multiply two 1D arrays of different lengths?
Multiplies element-wise
Gives ValueError
Adds padding zeros
Converts to object array
Which statement is True about NumPy arrays?
All elements must be of the same type
They can hold multiple data types
They are slower than Python lists
They cannot perform slicing
What will be the output?
np.array([1, 2, 3]) * 2
[1,2,3,1,2,3]
[2,4,6]
[1,4,9]
[2,3,4]
np.random.rand(2,3) generates:
2×3 matrix with random integers
2×3 matrix with random floats [0,1)
Error
2×3 identity matrix
What does np.all(a) return?
True if all elements are non-zero
True if any element is zero
Sum of all elements
Count of True elements
Output of:
np.array_equal(np.array([1,2]), np.array([1,2,3]))
True
False
Error
None
Which command converts an array into 1D?
reshape(-1)
flatten()
Both
None
Output:
a = np.arange(4).reshape(2,2)
a[1,1]
1
2
3
4
Which attribute returns total bytes consumed by an array?
array.nbytes
array.bytes
np.bytes(array)
array.memory
output:
a = np.array([1,2,3,4])
a[[True, False, True, False]]
[1,2]
[1,3]
[2,4]
[3,4]
np.argmax(a) returns:
Index of largest element
Largest element itself
ndex of smallest element
None
What is the result of:
np.array([[1,2],[3,4]]) + 10
Error
Adds 10 to every element
Appends 10 as last row
Adds 10 only to diagonal
What is the main goal of Data Analysis?
To store data securely
To interpret data and make decisions
To delete unnecessary data
To collect social media data
Which tool is most commonly used for data cleaning and preprocessing?
MS Paint
Python (with Pandas, NumPy)
VLC Media Player
Google Chrome
Which of the following roles is responsible for designing and maintaining databases?
Data Analyst
Data Scientist
Data Engineer
Machine Learning Engineer
In Data Science, which step comes immediately after data collection?
Data Cleaning
Data Visualization
Data Modeling
Data Storage
7.
Which of the following is TRUE about Data Analytics?
It is only used in scientific research
It helps businesses make better decisions using data
It doesn’t involve statistics
It ignores past data
Which of these is an example of a Data Visualization tool?
Matplotlib
Notepad
MS Word
File Explorer
Which of the following languages is most popular for Data Science?
Java
Python
C++
HTML
What does a Data Scientist mainly do?
Build websites
Develop AI and Machine Learning models using data
Manage company accounts
Repair computers
Who is known as the “father” of Python — the language loved by data analysts?
Elon Musk
Guido van Rossum
Bill Gates
Iron Man
If “Data” is raw information, then what is “Data Analysis”?
Asking data how its day was
Turning raw data into meaningful insights
Counting numbers randomly
Mixing Excel and coffee
What is an array in Python (NumPy)?
A storage box for multiple values of the same type
A fancy list that went to gym and became faster
A music playlist
Both A and B
What is the main difference between a list and a NumPy array?
List is smarter
Array is faster and supports mathematical operations
List can fly
Array can only store strings
Which of the following is NOT a data analysis tool?
Pandas
NumPy
Matplotlib
In data analysis, “cleaning data” means:
A) Using a broom to remove extra commas
B) Removing or correcting missing or wrong data values
C) Deleting all data
D) Formatting your laptop
Why do data analysts love Python so much?
Because it’s simple, powerful, and open-source
Because snakes are cute
Because it was free in a sale
Because Excel got jealous
What does “NumPy” stand for?
Number + Python
Numb People Yawning
Numeric Python
Numbers Please Yay!
Why do programmers love NumPy arrays more than Python lists?
Because arrays run faster than your morning coffee ☕
Because lists are lazy
Because arrays can talk
Because lists can’t store numbers
What will this code do?
import numpy as np
a = np.array([1, 2, 3])
print(a * 2)
[1, 2, 3, 1, 2, 3]
[2, 4, 6]
Explode your laptop
Show error because arrays can’t multiply
What happens if you try to mix numbers and strings in a NumPy array?
Python yells at you
NumPy politely converts everything to strings
The array runs away
Error!
If np.ones((3,3)) gives a matrix of 1’s, what will np.eye(3) give?
A staring contest 👀
A 3×3 identity matrix
A mirror
All zeros
Predict the output:
import numpy as np
x = np.array([[10, 20, 30],
[40, 50, 60]])
print(x[0][1] + x[1][0])
60
70
90
It prints a heart ❤️
