Python
我在北国不背锅
致力于AI大模型、Java、大数据、运维及各类计算机技术为一体的知识架构
展开
-
Python学习记录——爬取天气数据
将学习的Python爬虫知识简单做个案例实战,并使用matplotlib将温度做了个图: import requests from bs4 import BeautifulSoup import matplotlib.pyplot as plt All_Data = [] def send_parse_urls(): url = "http://www.weather.com.cn/weather15d/101090101.shtml" header = { "user-原创 2021-08-09 16:33:57 · 1152 阅读 · 0 评论 -
Python学习记录——requests和beautifulsoup
简单爬取了CSDN网站主页的文章标题: # -*- coding: utf-8 -*- """ Created on Mon Aug 9 13:53:16 2021 @author: yanni """ import requests from bs4 import BeautifulSoup # In[] url = "https://www.csdn.net/" header = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64原创 2021-08-09 14:56:00 · 994 阅读 · 0 评论 -
Python学习记录——matplotlib
# -*- coding: utf-8 -*- """ Created on Mon Aug 9 11:09:17 2021 @author: yanni """ import matplotlib.pyplot as plt import numpy as np # In[] a = np.linspace(1,10,100) b = np.sin(a) c = np.exp(a) # In[] plt.xlabel("x") plt.ylabel("y") plt.grid(True) pl原创 2021-08-09 14:53:53 · 662 阅读 · 0 评论 -
Python学习记录——pandas
# -*- coding: utf-8 -*- """ Created on Mon Aug 9 10:01:39 2021 @author: yanni """ import pandas as pd # In[] data=pd.DataFrame([1,2,"hello",4.5],columns=["number"],index=["a","b","c","d"]) # In[] data1=pd.read_csv("D:\\python_project\\python_course\原创 2021-08-09 14:52:44 · 1411 阅读 · 0 评论 -
Python学习记录——numpy
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import numpy as np a=np.array([1,2,3]) b=np.array([[1,2,3],[3,2,1]]) c=np.array([[1.2,2.3],[3.4,4.5]]) d=np.array([[1,2,3]]) print(a.size) print(a.shape) print(a.ndim) pr原创 2021-08-09 14:51:31 · 1114 阅读 · 0 评论