Introduction to Python Programming

Hi! This is Ka Hei. This space is created at the end of 2021 for introducing users in the humanities to pick up some basic programming skills📍 for research using digital text resources. You do not need to have any programming knowledge when you start with the tutorials. It covers tasks from data acquisition, analysis to visualization, working with both text📜 and geospatial data🗺️. All tutorials use (historical) Chinese text to demonstrate workflows of relevant tasks (sometimes mixed with examples from other languages, eg. Japanese, Korean, and English).


Instructions

WHY this space?

🔎 Instead of introducing users to diverse tools (Javascript, HTML, CSS, Jekyll, R etc.), it only focus on ONE: PYTHON, which can be used to approach a wide range of tasks (without knowledge of other tools)

🔎 All tutorials can be run in the Colab cloud environment so NO ENVIRONMENT SET UP AND INSTALLATION in the local device needed. It also MINIMIZE UNINSTRUCTED STEPS (eg. downloading and preprocessing files on your own) so that everyone can follow along.

🔎 Instead of being application-oriented (Network analysis, Geocode data, supervised classification, etc.), it starts from the basics and slowly introduce users different analysis concepts in a SYSTEMATIC manner

🔎 It focuses on applications in CHINESE language and history to give users in this discipline more concrete instructions


This is the RIGHT space for you if:

⭐ You are NEW TO PROGRAMMING and do not know WHERE TO START

⭐ You want to pick up ONE TOOL FIRST for digital humanity which can handle MOST of the task

⭐ You find it difficult to follow existing tutorials and want to DO IT BIT BY BIT FROM THE SCRATCH

⭐ You are STUCK with downloading and installing digital tools

⭐ You want to learn a tool that DO NOT NEED A LICENSE and is ALWAYS FREELY AVAILABLE

⭐ You want to have a BIG PICTURE what can you ACHIEVE with the digital tools


This is NOT the RIGHT space for you if:

🤔 You MASTER PROGRAMMING already and wish to harness the potential of multiple programming languages

🤔 You do NOT appreciate FREE OPEN SOURCE TOOLS

🤔 You prefer a VERY STEEP LEARNING CURVE

🤔 You are NOT PREPARED for consistent learning for the NEXT MONTHS


Tutorial Summary:

🕹️ Introduction to Python Programming

🕹️ Plotting and Interactive Data Visualization

🕹️ Data Manipulation using Pandas

🕹️ Web Scrapping and Text Analysis

🕹️ Working with Geospatial Data


Python Libraries covered:

beautifulsoup4, Bokeh, geopandas, folium, matplotlib, networkx, numpy, pandas, seaborn, urllib2, requests, re, SnowNLP, SpaCy, jieba, dash, plotly


You will be ABLE to:

👍 Write simple PYTHON CODE that fit your purposes (Oh what is your purposes? 😃)

👍 Create some INTERACTIVE contents/ graphics to present results

👍 Have your first WEBMAP!

👍 Know how to dive into DIGITAL DATABASE yourself without browsing around


You will NOT be ABLE to:

🙅‍♀️ Know how to make a dynamic and highly interactive website yourself just by following the tutorials

🙅‍♀️ Know how to start with a project yourself if you only read the code, but not practice

🙅‍♀️ Debug all the potential problems just by following the tutorials, use GOOGLE and stackoverflow!

🙅‍♀️ FLY!! 🐤


How to use this Space 🚀:

  • All code displayed on this webpage is available as Jupyter Notebook and it is highly recommanded that you download them and try it out by yourself.

  • If you are new to Colab, pleaese first click on Colab and begin your journey. There are two options to open the notebooks in Colab:

    1) Recommanded Option: Go to the page for the lesson here. Right under the tags, there are four icons. Click on option “Open in Colab”. You will be then able to view the notebook in Colab.

    2) Alternative: Download the notebook you need from this page. Search for the right title, right click and select “save link as”. You will be able to download the Jupyter Notebook with the file extension “.ipynb” (You do not need an account in GitHub but it is recommanded that you sign up). Go back to Colab and click File -> Upload notebook, select the notebook you just downloaded. Now you can run the notebook by yourself and start your coding journey.

  • ALL the tutorials provided here is ordered by LEVELS (lv1: the easiest, lv4: the most difficult) and it is recommanded to FOLLOW THE ORDER when you go through them

  • There are PREREQUISITES for almost all of the tutorials so please FOLLOW the links before you start with the content

  • There are REFERENCES in all the introduced concepts so feel free to read external resources before you continue

  • The tutorials do NOT COVER all possibilities or functionalities of the Python libraries so please do not solely depends on them

  • PRACTICE is the only way to go! So TYPE THE CODE by yourselves and TRY to change some options and run them again.

  • Inputs and potential outputs from the tutorials are available in the data folder.

  • Additional notebooks for references only are available in the additional folder.


Please pay attention 💡:

  • Some chapters are currently still under construction.

  • This space is set up volunarily with limited time so please be understanding of the typo and writing mistakes not yet corrected.