I have a complex function that returns a 2D array, to make it simple, let's consider the following:
import numpy as np
def get_array():
a = np.array([[0, 9, 5]])
return a
Is there a numpy command that allows me to retrieve the single row automatically instead of doing the following?
def get_array():
a = np.array([[0, 9, 5]])
if a.shape[0] == 1:
return a[0]
else:
return a
return a
Thanks a lot!

a.ravel()ora.flatten()...