diff options
| author | Kenneth Reitz <me@kennethreitz.org> | 2016-02-07 07:29:08 -0500 |
|---|---|---|
| committer | Kenneth Reitz <me@kennethreitz.org> | 2016-02-07 07:29:08 -0500 |
| commit | fcc9700d11e337947e0a99a9c10831615ef2005f (patch) | |
| tree | 79bfb3c6961a768151908bf989c4e7d29f6dd969 /tablib | |
| parent | 1ec9c18a66548b5fa9f751af550fce52defc1f3b (diff) | |
| download | tablib-fcc9700d11e337947e0a99a9c10831615ef2005f.tar.gz | |
Fix for transpose().transpose() with duplicate keys
#199
Diffstat (limited to 'tablib')
| -rw-r--r-- | tablib/core.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tablib/core.py b/tablib/core.py index 7d09789..808c005 100644 --- a/tablib/core.py +++ b/tablib/core.py @@ -895,17 +895,17 @@ class Dataset(object): new_headers = [self.headers[0]] + self[self.headers[0]] _dset.headers = new_headers - for column in self.headers: + for index, column in enumerate(self.headers): if column == self.headers[0]: # It's in the headers, so skip it continue # Adding the column name as now they're a regular column - row_data = [column] + self[column] + # Use `get_col(index)` in case there are repeated values + row_data = [column] + self.get_col(index) row_data = Row(row_data) _dset.append(row=row_data) - return _dset |
