2d এরে স্লাইসিং
২d এরে স্লাইসিং করার জন্য প্রথমে [১d এরে ] এর পরে [স্লাইসিং ইনডেক্স নাম্বার ] দিয়ে ২d এরে স্লাইসিং করবো।
import numpy as np
myArray = np.array([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])
print(f"print second 1-D array until before the 4th element:{myArray[1, 1:4]}")
Output:
print second 1-D array until before the 4th element:[7 8 9]
Last updated