diff --git a/pandas/io/excel.py b/pandas/io/excel.py index 2ece91b5dea11..4355d65718765 100644 --- a/pandas/io/excel.py +++ b/pandas/io/excel.py @@ -401,7 +401,8 @@ def _conv_value(val): val = bool(val) elif isinstance(val, Period): val = "%s" % val - + elif com.is_list_like(val): + val = str(val) return val diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py index 4f97cef3d46d3..4c1d58de8aa8b 100644 --- a/pandas/io/tests/test_excel.py +++ b/pandas/io/tests/test_excel.py @@ -930,6 +930,17 @@ def test_to_excel_float_format(self): index=['A', 'B'], columns=['X', 'Y', 'Z']) tm.assert_frame_equal(rs, xp) + def test_to_excel_list_format(self): + _skip_if_no_xlrd() + + df = DataFrame([0.0, ['0.0',0.0]], + columns=['not_list','list']) + + with ensure_clean(self.ext) as filename: + df.to_excel(filename, sheetname='TestList') + result = read_excel(filename,'TestList') + tm.assert_equal(result,df) + def test_to_excel_output_encoding(self): _skip_if_no_xlrd() ext = self.ext