MCPcopy Create free account
hub / github.com/alibaba/DataX / _prepend_row_index

Function _prepend_row_index

otsstreamreader/tools/tabulate.py:626–635  ·  view source on GitHub ↗

Add a left-most index column.

(rows, index)

Source from the content-addressed store, hash-verified

624
625
626def _prepend_row_index(rows, index):
627 """Add a left-most index column."""
628 if index is None or index is False:
629 return rows
630 if len(index) != len(rows):
631 print('index=', index)
632 print('rows=', rows)
633 raise ValueError('index must be as long as the number of data rows')
634 rows = [[v]+list(row) for v,row in zip(index, rows)]
635 return rows
636
637
638def _bool(val):

Callers 1

_normalize_tabular_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected