Skip to content

Commit 80b5082

Browse files
committed
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.
1 parent b17d4bb commit 80b5082

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/io/pytables.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,10 @@ def _read_index_node(self, node):
686686
def _write_array(self, group, key, value):
687687
if key in group:
688688
self.handle.removeNode(group, key)
689-
689+
690+
#Transform needed to interface with pytables row/col notation
691+
value = value.T
692+
690693
if self.filters is not None:
691694
atom = None
692695
try:

0 commit comments

Comments
 (0)