Python inserting dynamic list in excel file -
my program compares values in 2 files loaded dynamically every month. value in between may vary every time. first file has same second one. if script finds doesn't match, save these values in list. if finds more 1 missmatch appends list of values this:
['001210', '13/06/2016', '000590030', '0', '16', '16105971', '26- - ', '001210', '13/06/2016', '000590030', '0', '16', '16105971', '26- - ', 'vw0012', '13/06/2016', '000590030', '0', '16', '16105971', '26- - ', 'vw0012', '13/06/2016', '000590030', '0', '16', '16105971', '26- - ']
i'm trying figure out how write output this:
columns divided code formatted above , number of rows changes it's range... can do? it's better pandas or what?
any advice precious...
thank in advance
the output should this:
------------------------------------------------------------------- | code | date | id | qty in | qty out | ddt | wk | ------------------------------------------------------------------- |001210|13/06/2016|000590030| 0 | 16 |16105971|26- - | ------------------------------------------------------------------- |001210|13/06/2016|000590030| 0 | 16 |16105971|26- - | ------------------------------------------------------------------- |vw0012|13/06/2016|000590030| 0 | 16 |16105971|26- - |
and on... every new match, new row in excel output file...
ok, found way pandas. i've divided every list in single list , passed pandas this:
excelresult = pd.dataframe({'imballo': imballocolumn, 'data': datecolumn, 'abs/empfae': abscolumn, 'quantità in entrata': incolumn, 'quantità in uscita': outcolumn, 'numero bolla': ddtcolumn, 'wk-lg-lr': wkcolumn}) writer = pd.excelwriter('theresult.xlsx', engine='xlsxwriter') excelresult.to_excel(writer, sheet_name='mismatching') writer.save()
Comments
Post a Comment