Python Forum

Full Version: xlswriter(pandas) and conditional format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm trying to figure out how to apply the conditional formating on complete specifc colums (J to M here) in an Excel file using Pandas; the only way I've found so fat is to explicitley indicate the range as bellow: what's the right syntax (all my trials failed)?

Thanks

Paul

        worksheet.conditional_format('J1:M1357', {'type':     'cell',
                                                  'criteria': '>',
                                                  'value':     MyVal,
                                                  'format':    MyFormat})  
Finally I found a workaround ofter diggin on internet using the number "1048576" which seems to be the maximum possible number of lines; not necessarilly elegant but it works as expected

        worksheet.conditional_format('J1:M1048576', {'type':     'cell',
                                                  'criteria': '>',
                                                  'value':     MyVal,
                                                  'format':    MyFormat})