![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 83
Henry_Lv
这个作者很懒,什么都没留下…
展开
-
PyMysql以及事务
pymsql是Python中操作MySQL的模块,其使用方法和py2的MySQLdb几乎相同。# coding=utf-8import pymysqlconn=pymysql.connect(host='localhost',port=3306,user='root',passwd='123',db='s4') #连接mysql,必须存在数据库cursor=conn.cursor(c...原创 2018-05-20 18:11:04 · 10176 阅读 · 1 评论 -
爬虫之BeautifulSoup基础
# coding=utf-8from bs4 import BeautifulSoupimport rehtml_doc = """<html><head><title>The Dormouse's story</title></head><body><p id="my p&q原创 2018-06-16 21:27:21 · 280 阅读 · 0 评论 -
数据分析之Numpy
基础import numpy as np# 一. 创建array# array中的元素除了数字还可以是字符串和布尔值date1 = [6.5, 2, 5, 4]a = np.array(date1)b = np.arange(10).reshape((2,5))c = np.array([True, False])print(a.ndim, a.shape, a.siz...原创 2019-02-22 17:08:14 · 282 阅读 · 0 评论 -
数据分析之Pandas
基础from pandas import Series, DataFrameimport pandas as pdimport numpy as npstates = ['California', 'Ohio', 'Oregon', 'Texas']year = [2000, 2001, 2002, 2003]value = [35000, 71000, 16000, 5000]...原创 2019-02-22 17:13:32 · 208 阅读 · 0 评论 -
数据分析之pandas排位rank()的理解
pandas里的rank()可以进行排位from pandas import Seriesobj = Series([7, -5, 7, 4, 2, 0, 4])print(obj.rank())输出为0 6.51 1.02 6.53 4.54 3.05 2.06 4.5dtype: float64其排位的原理是:先...原创 2019-02-22 17:37:37 · 3343 阅读 · 1 评论