Write Excel: string and number within the same column

@nealwzz what you can do is use a Python script to try to convert each cell to a numeric value and then export to Excel from within the Python node. That way you can have mixed cells in one column.

# Iterate over the dataframe and apply numeric conversion where applicable
df_numeric = df.applymap(lambda x: pd.to_numeric(x, errors='ignore'))

# Save to Excel
file_name = 'output_mixed_format.xlsx'
df_numeric.to_excel(file_name, index=False)

You can expand this by also formatting date cells:

4 Likes