save_result.py 546 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. @Auther :liuyuqi.gov@msn.cn
  5. @Time :2018/7/8 2:57
  6. @File :save_result.py
  7. '''
  8. import datetime
  9. import pandas as pd
  10. def save_result(df):
  11. '''
  12. 导出数据结果
  13. :param data:
  14. :return:
  15. '''
  16. # head = ["instance", "machine"]
  17. # data = [["ss", "aa"], ["ss", "aa"], ["ss", "aa"], ["ss", "aa"]]
  18. # df = pd.DataFrame(data, columns=head)
  19. df.to_csv(("../submit/submit_" + datetime.datetime.now().strftime('%Y%m%d_%H%M%S') + ".csv"), header=None,
  20. index=False)