JUPYTER NOTEBOOKS
What is Jupyter Notebook?
Jupyter Notebook is an application (a program) that is used to execute programming code. The notebook consist of cells. Thus, your code may easily be sliced into pieces with explanatory text, equations, figures or what you need.
There are two types of cells:
- code cells
- text cells (with markup text, i..e text which is formatted)
The Jupyter notebooks listed below provide an introduction to Python, with a focus on text processing and the analysis of datasets in linguistics and language studies. It is addressed to anyone who is generally familiar with computers and who has an elementary knowledge of linguistics and math. Some of the notebooks use digital language resources from CLARINO and other sources. The notebooks are meant to be studied in order.
The notebooks are currently stored on on Google Colaboratory, where you can run them remotely if you have a web browser and a Google account. Please copy each notebook to your own Google Drive (File > Save a copy in Drive) before running and editing your own copy.
Alternatively, you can download the notebooks and run them locally on your own machine using a suitable application such as Visual Studio Code, or you can upload them to another online service such as Kaggle Links to an external site., Deepnote Links to an external site. or Binder Links to an external site., and run them there.
Get started!
- First steps with Jupyter Notebook: Python as a calculator Links to an external site.
- Strings for representing text Links to an external site.
- Common beginner’s errors
Links to an external site.
Strings and writing systems
- String operations Links to an external site.
- Writing systems
Links to an external site.
Sequences and sets
- Lists Links to an external site.
- Tuples Links to an external site.
- Sets
Links to an external site.
Functions
- Function definitions Links to an external site.
- Parameters in functions Links to an external site.
- Local variables in functions
Links to an external site.
Control structures
- Conditions with if Links to an external site.
- Iteration with for and while Links to an external site.
- Comprehensions Links to an external site.
- Iterators and generator expressions
Links to an external site.
Attribute-value data
- Dict
Links to an external site.
Input and output
- Formatted output Links to an external site.
- Interactive input
Links to an external site.
Ranges and slicing
- Ranges Links to an external site.
- Slicing with step Links to an external site.
- Palindromes and retrograde sorting
Links to an external site.
Regular expressions
- Regex search Links to an external site.
- Regex search continued Links to an external site.
- Regex substitution and split
Links to an external site.
Word tokenization and frequencies
- A simple word tokenizer Links to an external site.
- Tokenization and frequencies with NLTK Links to an external site.
- Counters and plotting
Links to an external site.
Zips and n-grams
- Zips Links to an external site.
- N-grams
Links to an external site.
Accessing text in files and from the web
- Writing and reading files Links to an external site.
- Accessing Google Drive Links to an external site.
- Reading plain text from the web Links to an external site.
- Extracting text from HTML web pages
Links to an external site.
Tabular data types
- Arrays and dataframes
Links to an external site.
Datasets from web sources
- Dataframe from CSV on the web: sorting, matching and counting Links to an external site.
- Groups and visualization with Anscombe's quartet Links to an external site. (optional)
- Summing values in groups Links to an external site.
- Accessing data on the web through APIs Links to an external site.
- Making a CSV data file or dataframe from text lines
Links to an external site. (optional)
Workflows with dataframes
- Addressing rows and columns in a dataframe to make a dict Links to an external site.
- Combining CSV and API to make a dict Links to an external site.
- From dict to dataframe to formatted table Links to an external site.
- Workflow with corpus data normalization, table and plot
Links to an external site.
Recursive functions
- Recursive functions and assert Links to an external site.
- Levenshtein distance as a recursive function Links to an external site.
- Finite state automata Links to an external site. (optional)
If you want to know more details about how something in Python works, you can look it up in the online Python documentation Links to an external site..