instance_deploy.py 1023 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. @Auther :liuyuqi.gov@msn.cn
  5. @Time :2018/7/7 3:58
  6. @File :instance_deploy.py
  7. '''
  8. # 数据预览
  9. from configparser import ConfigParser
  10. import pandas as pd
  11. # step1: 数据参数初始化
  12. cf = ConfigParser()
  13. config_path = "../conf/config.ini"
  14. section_name = "data_file_name"
  15. cf.read(config_path)
  16. app_interference = cf.get(section_name, "app_interference")
  17. app_resources = cf.get(section_name, "app_resources")
  18. instance_deploy = cf.get(section_name, "instance_deploy")
  19. machine_resources = cf.get(section_name, "machine_resources")
  20. df3 = pd.read_csv(instance_deploy, header=None,
  21. names=list(["instanceid", "appid", "machineid"]), encoding="utf-8")
  22. # print(df3[df3["machineid"] == "NaN"])
  23. # print(df3.head())
  24. print(pd.isna(df3["machineid"]).value_counts())
  25. print(pd.isna(df3.machineid[1]))
  26. print(pd.isna(df3["machineid"][2]))
  27. print(df3.machineid[1]=="nan")#错误
  28. print(df3.machineid[1]=="NaN")
  29. # True 38223
  30. # False 29996 还有一半没有部署