-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
EnhancementIO DataIO issues that don't fit into a more specific labelIO issues that don't fit into a more specific label
Milestone
Description
As with R's write.table col.names which can take a list of column headers to output instead of the
headers.
here's a start, though I'm unsure about hwo it interacts with the index label stuff.
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 248a4e9..8c93488 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -13,7 +13,7 @@ labeling information
# pylint: disable=E1101,E1103
# pylint: disable=W0212,W0231,W0703,W0622
-
+import collections
from itertools import izip
from StringIO import StringIO
import csv
@@ -889,7 +889,9 @@ class DataFrame(NDFrame):
cols = self.columns
series = self._series
- if header:
+ if isinstance(header, collections.Iterable):
+ writer.writerow([h or '' for h in header])
+ elif header:
if index:
# should write something for index label
if index_label is None:
Metadata
Metadata
Assignees
Labels
EnhancementIO DataIO issues that don't fit into a more specific labelIO issues that don't fit into a more specific label