Use pandas to read data and count paper data (2) 2021-01-17

datawhale data analysis task1 (2) use pandas to read the data and count the paper data

github

1. Python datetime processing time

CSDN blog detailed introduction

1.1 Get the specified time and date.

datetime(%Y,%m,%d,%H,%M,%S)

There are 6 parameters in datetime, which represent year, month, day, hour, minute, and second. The year, month, and day are the parameters that must be passed in, the hour, minute, and second may not be passed in, and the default is all zero.
datatime(2017,9,24)
Out:datatime.datatime(2017,9,24,0,0)

1.2 Convert Str and Unicode to datetime.

datetime(str,format)

In many cases, the time and date in the original data are not of the time type, such as Unicode in excel, and Str in csv. Therefore, before time slicing, we first need to convert non-time type time data to time type.

2. HTML foundation required by crawlers

html detailed description of the
most basic label description


标签基本格式:<标签名 属性名1="属性值" 属性名2="属性值" ...>文档内容</标签名>
<! DOCTYPE html>: 用于代码开头指定html版本等信息;
<html></html>: 告知浏览器这是一个HTML文档,是HTML文档中最外层的元素;
<head></head>: 所有头部元素的容器,必须包含文档的标题(title),可以包含脚本、样式、meta信息以及其他;
<title></title>: 定义文档的标题,定义浏览器工具栏中的标题,显示在搜索引擎结果中的页面标题;
<body></body>: 定义文档的主体,包含文档的所有内容(比如文本、超链接、图像、表格和列表等);

<h1></h1>: 定义HTML标题,从<h1><h6>标题的重要程度逐渐降低;

<p></p>: 定义段落,浏览器会自动在其前后创建一些空白;
<br>: 一个简单的换行符,是一个空标签,意味着它没有结束标签;
<div></div>:定义HTML文档中的一个分隔区块或者一个区域部分,经常与CSS一起使用,用来布局网页。

**链接中一些常用的标签**
<a>标签实现基本的超链接
<a href="http://www.pkbigdata.com">访问DC官网</a>
其中<a></a>为标签,href=http://www.pkbigdata表示链接指向的地址,访问DC官网表示超链接的文本

指向同一服务器同一目录下的form.html
<a href="form.html">Fill Our Form</a>

指向同一服务器父目录下的parent.html
<a href="../parent.html">Parent</a>

指向同一服务器子目录下的stuff下的cat.html
<a href="stuff/cat.html">Catalog</a>

指向外部网站 (会在新的标签页打开)
<a href="http://pkbigdata.com" target="_blank">BASD</a>

Some commonly used tags in links

<a>标签实现基本的超链接
<a href="http://www.pkbigdata.com">访问DC官网</a>
其中<a></a>为标签,href=http://www.pkbigdata表示链接指向的地址,访问DC官网表示超链接的文本

指向同一服务器同一目录下的form.html
<a href="form.html">Fill Our Form</a>

指向同一服务器父目录下的parent.html
<a href="../parent.html">Parent</a>

指向同一服务器子目录下的stuff下的cat.html
<a href="stuff/cat.html">Catalog</a>

指向外部网站 (会在新的标签页打开)
<a href="http://pkbigdata.com" target="_blank">BASD</a>

3. Regular expressions

python3 regular expression
regular expression online test platform

Guess you like

Origin blog.csdn.net/qq_43720646/article/details/112714503