When trying to use a numpy.array (a structured numpy array) I know I can pull up a column by doing something like array["col"]. From my understanding, this is because of numpy.dtype.names and the nature of structured arrays. However, when passing said array into a function, I don't get the column name when using numpy.dtype.name, I get something like "strxxx". If it helps to know, this particular array was created using numpy.genfromtxt() and a csv file. For example, the below code
def empty_check(param):
for ind in param:
# Ignore future warning for comparison just for this instance
with warnings.catch_warnings():
warnings.simplefilter(action='ignore', category=FutureWarning)
if ind == '':
print("Please fill out required data in", param.dtype.name, "column")
results in:
Please fill out required data in str544 column
Would anyone have an idea as to why str544 comes up instead of the name of the column?
Setup Python 3.7.0 numpy 1.15.4 IDE: PyCharm 2018.3