Python小技巧
2021-03-20 15:25
标签:lang memory virtual result rtu panda 中文 ict and Python小技巧 标签:lang memory virtual result rtu panda 中文 ict and 原文地址:https://www.cnblogs.com/malcolmwallace/p/13922118.html
pandas.to_csv
中文乱码问题df.to_csv("predict_result.csv",encoding="utf_8_sig")
打印所在机器的内存大小
import psutil
def print_memory_size():
‘‘‘输出系统内存‘‘‘
mem = psutil.virtual_memory()
total = str(round(mem.total / 1024 / 1024 / 1024))
print(‘系统内存为{}GB‘.format(total))
print_memory_size()