fixed row/col orientation for 2D arrays #1834

Merged
merged 2 commits into from Sep 9, 2012

Conversation

Projects
None yet
2 participants
Contributor

John-Colvin commented Sep 3, 2012

Pytables uses the opposite convention to pandas for row/col. Using the numpy transpose .T corrects for this without copying the data and keeping the orientation of 1D arrays intact.

fixed row/col orientation for 2D arrays
Pytables createArray function uses the opposite convention to pandas
for row/col. Using the numpy transpose .T corrects for this without
copying the data and keeping the orientation of 1D arrays intact.
Contributor

John-Colvin commented Sep 3, 2012

Is solution for pydata#1824

Contributor

John-Colvin commented Sep 3, 2012

my apologies, it appears I was a little premature with this pull request as the files it writes can't be read again. Should I close this request or edit it in-place as/when the problem is resolved?

added tranposed attribute, used in _read_array
the transposed attribute keeps track of whether the data has been 
transposed, allowing it to be correctly read by _read_array.
Some minor rearrangement of _read_array was necessary to reduce
duplicate code.
Contributor

John-Colvin commented Sep 3, 2012

earlier problems are fixed by adding a new _v_attr signalling the transpose has been applied. It's not that pretty, but it's logical and appears to work.

Owner

wesm commented Sep 7, 2012

Thanks. I think the _v_attr hack also will make it so legacy files can be read

Contributor

John-Colvin commented Sep 8, 2012

Yes it should do, because it defaults to false if it's not found.

wesm added a commit that referenced this pull request Sep 9, 2012

@wesm wesm merged commit 4ff42db into pandas-dev:master Sep 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment