
python
文章平均质量分 53
yandao
“我是谁”、“我在哪”、“我要去哪儿”
展开
-
python基础整理复习五(爬虫)
引入库1.request来获取页面内容https://requests.readthedocs.io/zh_CN/latest/pip install -i https://pypi.tuna.tsinghua.edu.cn/simple request2.BeautifulSouphttps://beautifulsoup.readthedocs.io/zh_CN/v4.4.0/pip install -i https://pypi.tuna.tsinghua.edu.cn/simple bs原创 2021-01-31 20:34:29 · 87 阅读 · 0 评论 -
python基础整理复习四(数据库mysql)
安装#python2pip install MySQL-python#python3pip install PyMySQL -i https://pypi.tuna.tsinghua.edu.cn/simple连接数据库#连接数据库DATABASE={ 'host':'localhost', 'database':'python', 'user':'root', 'password':'########', 'charset':'utf8mb4'}原创 2021-01-29 10:03:28 · 130 阅读 · 0 评论 -
python基础整理三(pandas,matplotlib)
通过指定url安装指定包pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandaspip install -i https://pypi.tuna.tsinghua.edu.cn/simple matplotlibpip install -i https://pypi.tuna.tsinghua.edu.cn/simple scipy #引入scipy的目的是plot.kde()需要用pandas[数据处理]1. 准备导入使原创 2021-01-27 00:30:49 · 271 阅读 · 0 评论 -
python基础整理二(numpy)
通过指定url安装指定包pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpynumpy[数据处理]数组可以存储一种类型的数据,列表可以存储任意类型的数据import arrayarray.array('i',range(10)) #i代表整数类型array('i', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])a =array.array('i',range(10))a[0]0a[0]=10a原创 2021-01-24 23:11:43 · 138 阅读 · 0 评论 -
python使用jupyter notebook
安装pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyter启动jupyter notebook[I 21:54:27.997 NotebookApp] Writing notebook server cookie secret to D:\Users\LENOVO\AppData\Roaming\jupyter\runtime\notebook_cookie_secret[I 21:54:28.615 NotebookApp原创 2021-01-24 22:10:08 · 442 阅读 · 3 评论 -
python基础整理一
python的特性1.python语法简单,容易理解,容易学习2.跨平台,可以在windows,linux,mac os3.可以做网站、爬虫、大数据处理4.拥有强大的第三方库numpy,panda...python 之禅输入import this>>>import thisThe Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Sim原创 2021-01-19 12:53:05 · 234 阅读 · 1 评论 -
记录pyspark不能访问
由于配置了JAVA_HOME的路径中有空格所以导致pyspark不能访问解决办法Program Files转换为Progra~1有的建议用双引号把有空格的路径括起来Program Files->"Program Files" 测试没有起作用在pyspark不能使用的时候,提示的信息往往不是很明显:D:\Python\test>python WordCount2.py此时不应有 Files"\Java\jdk1.8.0_231"=="x"。Traceback (most rece原创 2020-12-21 00:31:04 · 421 阅读 · 0 评论