摘要: 一.创建测试数据 1. np.random.randint(0,100,size=(6,3))是使用numpy中的随机模块random中,生成随机整数方法randint,里面的参数size是指定生成6行3列的数据,并且每个数字的范围在0到100之间。 import pandas as pd impo 阅读全文
posted @ 2020-05-15 16:46 番薯大大 阅读(1688) 评论(0) 推荐(0) 编辑
摘要: 一. 数据的合并 1.数据合并主要包括下面两种操作: 轴向连接(concatenation):pd.concat()可以沿一个轴将多个DataFrame对象连接在一起,形成一个新的DataFrame对象。 融合(merging):pd.merge()方法可以根据一个或多个键将不同DataFrame中 阅读全文
posted @ 2020-04-29 18:40 番薯大大 阅读(1022) 评论(0) 推荐(0) 编辑
摘要: 一. pandas csv 1. pandas将数据写入csv文件中 df.to_csv(path_or_buf='./xxx.csv', encoding='utf_8_sig') 2.如果不想把索引写道csv中, 增加index= False df.to_csv(path_or_buf='./h 阅读全文
posted @ 2020-04-23 18:05 番薯大大 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 1.Series from pandas import Seriesemp=['001','002','003','004','005','006']name=['亚瑟', '后裔','小乔','哪吒' ,'虞姬','王昭君']series = Series(data=name,index=emp) 阅读全文
posted @ 2020-02-19 17:32 番薯大大 阅读(472) 评论(0) 推荐(0) 编辑
摘要: 1.生成requirements.txt文件 pip freeze > requirements.txt 安装requirements.txt依赖 pip install -r requirements.txt 阅读全文
posted @ 2020-02-14 11:02 番薯大大 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 一. 安装djiango 二.创建项目并启动 1. django-admin startproject project_name 创建项目 2. python3 manage.py startapp son_project_name 创建子项目 3. python3 manage.py runser 阅读全文
posted @ 2019-12-16 20:30 番薯大大 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 学习地址: https://www.runoob.com/vue2/vue-directory-structure.html 一. 安装 1.使用淘宝定制的 cnpm (gzip 压缩支持) 命令行工具代替默认的 npm: $ npm install -g cnpm --registry=https 阅读全文
posted @ 2019-12-10 17:22 番薯大大 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 正则表达式,字母和汉字的验证 1. 常用正则表达式大全!(例如:匹配中文、匹配html) 3. 匹配中文字符的正则表达式: [u4e00-u9fa5] 9. 匹配双字节字符(包括汉字在内):[^x00-xff] 15.匹配空白行的正则表达式:ns*r 21.匹配HTML标记的正则表达式:<(S*?) 阅读全文
posted @ 2019-11-12 16:41 番薯大大 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 网上拉取Docker模板,使用singlarities/hadoop镜像 [root@localhost /]# docker pull singularities/hadoop 查看: [root@localhost /]# docker image ls REPOSITORY TAG IMAGE 阅读全文
posted @ 2019-11-02 12:20 番薯大大 阅读(5344) 评论(0) 推荐(0) 编辑
摘要: 一.python爬虫使用的模块 1.import requests 2.from bs4 import BeautifulSoup 3.pandas 数据分析高级接口模块 二. 爬取数据在第一个请求中时, 使用BeautifulSoup import requests# 引用requests库fro 阅读全文
posted @ 2019-10-19 19:02 番薯大大 阅读(5688) 评论(0) 推荐(1) 编辑