Python Jupyter Notebook
1. 線上編輯:
https://colab.research.google.com/drive/1f1YLwAoFjdhq9IOtkuZr7Iq35bucJz2k
https://yanwei-liu.medium.com/%E5%A6%82%E4%BD%95%E7%B7%9A%E4%B8%8A%E4%BD%BF%E7%94%A8google%E7%89%88%E7%9A%84jupyter-notebook-colaborator-e9fe3475e2da
2. Python 大數據 爬取資料
https://medium.com/seaniap/python%E7%88%AC%E8%9F%B2-%E7%B6%B2%E8%B7%AF%E6%95%B8%E6%93%9A%E8%B3%87%E6%96%99%E7%9A%84%E7%88%AC%E5%8F%96%E6%8A%80%E5%B7%A7-1-69c267b33273
2.1 撈資料
test script:
url ='https://www.google.com.tw'
html = requests.get(url)
html.text
html.content
html.status_code
if html.status_code == 200 :
print("OK")
print(html.text)
else:
print("connection Fail")
2.2 使用requests模組下載網頁資料
https://nkust.gitbook.io/python/qu-ji-qiao
import requests
url="https://tw.stock.yahoo.com/news_list/url/d/e/N4.html"
html =requests.get(url).text
print(html)
2.3 抓google Map 資料
https://medium.com/datainpoint/%E5%A6%82%E4%BD%95%E7%8D%B2%E5%8F%96%E8%B3%87%E6%96%99-%E6%93%B7%E5%8F%96%E7%B6%B2%E9%A0%81%E5%85%A7%E5%AE%B9-8d8d4cefe82e
2.4 畫圖
import matplotlib.pyplot as plt
listx =[1,5,7,9]
listy =[15,50,80,40]
plt.plot(listx, listy)
plt.show()
ModuleNotFoundError: No module named 'requests'
是因為缺少 requests 函示庫
使用pip安裝 requests 函示庫
pip3 install requests
https://www.weiyuan.com.tw/article/88
2.6 5大Python可视化库到底选哪个好?
https://zhuanlan.zhihu.com/p/148748125
留言
張貼留言