genfromtxt does not generate multidimensional array when data has only one column.
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 32.8k
- Forks
- 12.8k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 197
Description
Environment
- numpy 1.14.4
- Python 2.7.11
Overview
genfromtxt does not generate multidimensional array when data has only one column.
>>> import numpy as np
>>> from StringIO import StringIO
>>> data = "1, 2, 3\n4, 5, 6"
>>> np.genfromtxt(StringIO(data), delimiter=",")
array([[1., 2., 3.],
[4., 5., 6.]])
>>> data = "1\n2"
>>> np.genfromtxt(StringIO(data), delimiter=",") # I expect array([[1.], [2.,]]) but the result is array([1., 2.])
array([1., 2.])
>>> np.genfromtxt(StringIO(data), delimiter="\n")
array([1., 2.])
Is this expected action?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the two single-column examples using the genfromtxt entry point and compare them with the multi-column case. Determine the intended array shape for one-column input, then add or update regression coverage so the behavior is explicit and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100