Q:

Write a NumPy program to check whether the numpy array is empty or not

0

Write a NumPy program to check whether the numpy array is empty or not.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
x = np.array([2, 3])
y = np.array([])
# size 2, array is not empty
print(x.size)
# size 0, array is empty
print(y.size)

Sample Output:

2                                                                      
0

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now