随笔分类 - Python程序设计
日常工作中遇到的一些问题解决方法记录
摘要:#include <iostream> int main() { int v[] = {1, 2, 3, 4, 5}; for(auto& x:v) std::cout<<x<<" "; std::cout<<std::endl; return 0;} We use auto where we do
阅读全文
摘要:#!/usr/bin/python3 import pandas as pd def main(): df_iport = pd.read_excel('./ip-port.xlsx', sheet_name=0) for i in range(df_iport['目标地址'].__len__())
阅读全文
摘要:在操作系统为Redhat 7.4的服务器上的一次Python 3.8.2的安装 1)首先搞明白操作系统自带的python的安装路径:whereis python,可以看到初始的路径在/usr/bin/python。 cd /usr/bin; ll | grep python,python作为符号链接
阅读全文
摘要:import pandas as pd df_policy = pd.read_excel('e:\policy.xlsx') df_sh01 = pd.read_csv('e:\sh01.csv', encoding='gbk') list_not = [] set_found = set() f
阅读全文
摘要:转发自pyformat.info 详细讲述了Python format的新旧用法
阅读全文
摘要:There are two more repeating qualifiers. The question mark character, ?, matches either once or zero times;you can think of it as marking something as
阅读全文
摘要:转发自processing-incoming-request-data-in-flask,文章讲得特别详细 from flask import Flask, request app = Flask(__name__) @app.route('/form-example', methods=['GET
阅读全文
摘要:import pandas as pd import os if __name__ == '__main__': Folder_Path = 'c:\checklog' os.chdir(Folder_Path) file_list = os.listdir() writer = pd.ExcelW
阅读全文
摘要:import pandas as pd import os if __name__ == '__main__': Path = 'c:\checklog' dfs = [] for dir_path, dir_names, file_names in os.walk(Path): for f in
阅读全文
摘要:import pandas as pd import numpy as np import math data = pd.read_csv('c:\\housing.csv') room_nums = data['total_rooms'].tolist() room_mean = np.mean(
阅读全文
摘要:#!/usr/bin/python import os import pandas as pd from sklearn.datasets import fetch_openml import matplotlib import matplotlib.pyplot as plt HOUSING_UR
阅读全文
摘要:#!/usr/bin/env python3 # -*- coding: utf-8 -*- import paramiko import os, stat import sys import operator as op from string import Template def ssh_co
阅读全文
摘要:#!/usr/bin/python import pandas as pd df = pd.read_excel('c:\data\zichan.xlsx') df_sn = pd.read_excel('c:\data\SN.xlsx') sn_series = pd.Series(df_sn['
阅读全文
摘要:#!/usr/bin/python # -*- coding: UTF-8 -*- import pandas as pd import os if __name__ == '__main__': Folder_Path = 'c:\data1' os.chdir(Folder_Path) file
阅读全文
摘要:#!/usr/bin/python import pandas as pd import collections df_dict = pd.read_excel('c:\data\machines.xlsx', sheet_name=None, index_col=None, na_values=[
阅读全文
摘要:原始数据 Say you are given a data set where each observed example has a set of features, but has nolabels. Labels are an essential ingredient to a supervi
阅读全文
摘要:判断port_state是否为Online状态,是的话,读取出port_name,即为wwn。 1 #!/usr/bin/env python3 2 3 # -*- coding: UTF-8 -*- 4 5 import glob 6 import operator 7 import os 8 9
阅读全文
摘要:1 #!/usr/bin/env python3 2 3 # -*- coding: UTF-8 -*- 4 5 from bs4 import BeautifulSoup 6 import operator 7 import os,shutil 8 import re 9 10 def proce
阅读全文
摘要:1 #!/usr/bin/env python3 2 3 # -*- coding: UTF-8 -*- 4 5 import pandas as pd 6 import os 7 import re 8 9 if __name__ == '__main__': 10 Folder_Path = '
阅读全文
摘要:工作中遇到的需求,****代表标签数据别的信息: D01 ******** 1 ******** D01 ******** 2 ******** D01 ******** 3 ******** D01 ******** 4 ******** D02 ******** 1 ******** D02 *
阅读全文