Open numpy-gitbot opened 12 years ago
Title changed from Make .squeeze() an option for genfrontxt()
to Make .squeeze() an option for genfromtxt()
by trac user lmeyn on 2012-06-19
Title changed from Make .squeeze() an option for genfromtxt()
to npyio.py: Make .squeeze() an option for genfromtxt()
by trac user lmeyn on 2012-06-19
Original ticket http://projects.scipy.org/numpy/ticket/2172 on 2012-06-19 by trac user lmeyn, assigned to unknown.
I'm trying to read several data files with column headers using numpy.genfromtxt. The issue is that some of the data files only have one row of data and squeeze operation used in genfromtxt returns an object with no rows (shape = () ). I would suggest adding an argument, squeeze=True, and the replace the last three lines
with:
This would keep the current behavior if the squeeze argument isn't specified, yet allow the squeeze operation to be avoided if desired.