Python for Cybersecurity and Data Analytics

Python 開發環境

Anaconda Python: https://www.anaconda.com/products/individualarrow-up-right

  1. jupyter- 互動式寫程式用的Web介面,非常常用來教學與練習,介於Python iteractive command以及IDE工具之間。

  2. SciPy

  3. Spyder- Python IDE

  4. Numpy

  5. DASK?

  6. Matplotlib

  7. scikit-learn: machine learning and data mining library

  8. Pandas- python套件,試算表計算

  9. TensorFlow- Deep learning library

  10. CONDA- anaconda 套件管理工具 pip

Google CloudDatalab (Jupyter Notebook的原生)

Python jupyter notebook: https://zhuanlan.zhihu.com/p/33105153arrow-up-right

[演練] 今天在Seaborn看到一張專業的圖,有Python Source code,想要在Anaconda Python使用。

(1) 哪一張Seaborn的圖?

(2) Source貼到Jupyter Notebook,可以嗎? 不行!!!出錯了!!!什麼錯?

AttributeError: module 'seaborn' has .....-> seaborn這個套件版本不一致,這個版本的seaborn並沒有set_theme的function?怎麼辦?先槓掉...(不推薦)

用Pandas分析Excel資料

參考教材:https://drive.google.com/drive/folders/10I6TUMirjl4SKAKUC3PY1Yuw_YtKoAog?usp=sharingarrow-up-right

Read Excel with Python Pandas
18 Pandas Functions to Replace Excel with Python (and be happy forever)
Reading and Writing Excel (XLSX) Files in Python with the Pandas Library
Practical Business Python
Read Excel with Python Pandas
使用 Python + Pandas 從包含多個工作表的 Excel 中擷取數據

Word Cloud

在Pandas的DataFrame,通常會用df做變數名稱,就會用df去操作資料表,最後將運算好的結果寫回檔案。要統計銷售表中,州的銷售筆數?最好用圓餅圖呈現。

  1. 參考sample code,找出資料的放置點 (x 變數,x變數是一個dict資料結構,<key,value>)

  2. 要從df中抓出 state欄位的資料,然後計算state的出現次數(occurence)

    1. google keywords: python list count element dict

    2. https://stackoverflow.com/questions/3496518/using-a-dictionary-to-count-the-items-in-a-listarrow-up-right (Collection的python套件,非常重要,有很多不錯的寫法)

python list count element dict

5/4 的範例程式 ipynb的格式存(iPython Notebook, jupyter notebook)

針對MacOS Log進行分析

Web access log (i.e., IIS, apache, tomcat..)

https://mmas.github.io/read-apache-access-log-pandasarrow-up-right

Part1~Part4

EvtxToElk: A Python Module to Load Windows Event Logs into ElasticSearch

想當高手的,追蹤一下高手

https://github.com/tjnelarrow-up-right

Last updated