Pandas/Excel: Any way to encode the ALT-ENTER / CHAR(10) line break into data when calling DataFrame.to_excel()?
<p>I have a pandas <code>DataFrame</code> that I would like to write to Excel. For one column, I have data values that are comma-delimited strings, like <code>"val1,val2"</code> or <code>"val1,val2,val3"</code>.  When I write that column, I would like to replace the commas with the equivalent of pressing <code>ALT-ENTER</code> in Excel, so that there are line breaks between the values.  So, my first example would display as <code>val1</code>, then a break within the cell, then <code>val2</code>, and so forth. You can also do this in Excel by making the cell a formula and putting <code>&amp;"char(10)"&amp;</code> between each value.</p>

<p>I see how I could do this by <a href="http://xlsxwriter.readthedocs.io/working_with_formulas.html" rel="noreferrer">coding up formulas via XLSXWriter</a> and writing cells individually. However I'm hopefully (or lazily) wondering whether there's a way to encode the breaks right into the data so that they would all come out via a simple call to <code>to_excel()</code> on the <code>DataFrame</code>.</p>