随笔分类 -  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 阅读全文
posted @ 2021-07-04 17:44 东宫得臣 阅读(139) 评论(0) 推荐(0) 编辑
摘要:#!/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__()) 阅读全文
posted @ 2020-05-13 14:33 东宫得臣 阅读(336) 评论(0) 推荐(0) 编辑
摘要:在操作系统为Redhat 7.4的服务器上的一次Python 3.8.2的安装 1)首先搞明白操作系统自带的python的安装路径:whereis python,可以看到初始的路径在/usr/bin/python。 cd /usr/bin; ll | grep python,python作为符号链接 阅读全文
posted @ 2020-04-22 13:57 东宫得臣 阅读(1591) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-04-20 14:48 东宫得臣 阅读(2138) 评论(0) 推荐(0) 编辑
摘要:转发自pyformat.info 详细讲述了Python format的新旧用法 阅读全文
posted @ 2020-04-20 13:11 东宫得臣 阅读(162) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-04-16 10:07 东宫得臣 阅读(4445) 评论(0) 推荐(0) 编辑
摘要:转发自processing-incoming-request-data-in-flask,文章讲得特别详细 from flask import Flask, request app = Flask(__name__) @app.route('/form-example', methods=['GET 阅读全文
posted @ 2020-04-14 20:18 东宫得臣 阅读(711) 评论(0) 推荐(0) 编辑
摘要:import pandas as pd import os if __name__ == '__main__': Folder_Path = 'c:\checklog' os.chdir(Folder_Path) file_list = os.listdir() writer = pd.ExcelW 阅读全文
posted @ 2019-12-10 14:44 东宫得臣 阅读(1492) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-08-08 21:40 东宫得臣 阅读(587) 评论(0) 推荐(0) 编辑
摘要: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( 阅读全文
posted @ 2019-07-31 18:56 东宫得臣 阅读(237) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/python import os import pandas as pd from sklearn.datasets import fetch_openml import matplotlib import matplotlib.pyplot as plt HOUSING_UR 阅读全文
posted @ 2019-06-18 16:36 东宫得臣 阅读(211) 评论(0) 推荐(0) 编辑
摘要:#!/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 阅读全文
posted @ 2019-06-04 12:34 东宫得臣 阅读(319) 评论(0) 推荐(0) 编辑
摘要:#!/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[' 阅读全文
posted @ 2019-05-14 13:20 东宫得臣 阅读(393) 评论(2) 推荐(0) 编辑
摘要:#!/usr/bin/python # -*- coding: UTF-8 -*- import pandas as pd import os if __name__ == '__main__': Folder_Path = 'c:\data1' os.chdir(Folder_Path) file 阅读全文
posted @ 2019-03-21 11:36 东宫得臣 阅读(1076) 评论(0) 推荐(0) 编辑
摘要:#!/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=[ 阅读全文
posted @ 2019-03-08 09:19 东宫得臣 阅读(961) 评论(0) 推荐(0) 编辑
摘要:原始数据 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 阅读全文
posted @ 2019-02-26 09:25 东宫得臣 阅读(281) 评论(0) 推荐(0) 编辑
摘要:判断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 阅读全文
posted @ 2018-10-17 17:07 东宫得臣 阅读(423) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-08-08 17:33 东宫得臣 阅读(1113) 评论(0) 推荐(0) 编辑
摘要: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 = ' 阅读全文
posted @ 2018-06-13 13:16 东宫得臣 阅读(2287) 评论(0) 推荐(0) 编辑
摘要:工作中遇到的需求,****代表标签数据别的信息: D01 ******** 1 ******** D01 ******** 2 ******** D01 ******** 3 ******** D01 ******** 4 ******** D02 ******** 1 ******** D02 * 阅读全文
posted @ 2018-04-01 11:21 东宫得臣 阅读(207) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示