<jupyter_start><jupyter_text>Quickstart to PythonThis notebook contains a short introduction of basic principles of coding in Python. It is aimed for people who have no prior knowledge in programming but also for people who wish to brush up their memory in programmng with Python or are already familiar with programming in another programming language and want to become acquainted with Python. The notebook is organized in a series of chapters where the main principles of programming are introduced. There is an emphasis on providing brief descriptions of the coding principles in conjuction with simple and self-explanatory coding examples. People who are new to programming are advised to follow this manual step by step. For people that are already familiar with Python or programming in general, it is possible to use the links to navigate to specific chapters. Observe that this tutorial was developed using **Python 3.6.7**.   Table of Contents- [Introduction](intro)- [1. Import Python modules](importera_py_moduler)- [2. Variables and data types in Python](py_variables_and_dataTypes)    -  [2.1. Variables](py_variables)    -  [2.2. Data types](py_dataTypes)    -  [2.3. Python conventions](py_conventions)    -  [2.4. Comments](py_comments)- [3. Python operators](py_operators)    -  [3.1. Arithmetic operators](arithmetic_operators_py)    -  [3.2. Assignment operators](assignement_operators_py)    -  [3.3. Comparison operators](comparison_operators_py)    -  [3.4. Logical operators](logical_operators_py)    -  [3.5. Identity operators](identity_operators_py)    -  [3.6. Membership operators](membership_operators_py)    -  [3.7. Bitwise operators](bitwise_operators_py)- [4. Data structures in Python](data_structures_py)    -  [4.1. Lists](list_py)    -  [4.2. Sets](set_py)    -  [4.3. Tuples](tuple_py)    -  [4.4. Dictionaries](dictionary_py)- [5. String manipulation in Python](py_string_manipulation)- [6. Control flow in Python](py_control_flow)    -  [6.1. If-statements](if_statement_py)    -  [6.2. For-loops](for_loop_py)    -  [6.3. While-loops](for_loop_py)- [7. Create functions in Python](python_func)- [8. Local and global variables in Python](local_and_global_var)- [9. List comprehensions](list_comprehensions_py)       Back to top   1. Import Python ModulesLike all programming languages, Python includes an extended number of libraries. Libraries are essentially packages of pre-written code. A package may contain many pre-written modules. A module is a file that contains various Python functions and global variables. [Global variables](local_and_global_var) are described in detail later.To use a pre-written function in your Python code, you need to make sure that the package it belongs to has already been installed and that its corresponding module has been imported. It is common practice to import all modules that will be used in a Python program at the beginning of the program.The next code-cell displays the Python syntax for importing modules. It is possible to import all functions from a module (e.g. import math or  from math import *). It is also possible to only import a specific function of a module (t.ex. from datetime import datetime).When you install Python on your machine, you also install a set of predefined libraries. However, once you start writing code in Python, you might discover that you need to install more libraries. To use a function from your newly installed library, you need to import it (e.g. from bokeh.plotting import figure). For example, the bokeh visualization library contains a package of modules called plotting that, in turn, includes the module figure. It is not considered good practice to use the from module_name import * syntax. Instead try to import strictly defined modules or functions.It is possible to give an alias to a library- or module-name at import, using the keyword as. Usually the alias is a shorter version of the library's or module's name. For instance, import pandas as pd, stands for importing the _pandas_ library and renaming it to _pd_. In this way, whenever a module or a function from the pandas library is called, it is only necessary to write _pd_ instead of the library's full name.<jupyter_code>#Import modules:
import numpy as np
import pandas as pd
import itertools
from datetime import datetime
import math
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, HoverTool, Label, Legend, SingleIntervalTicker, LinearAxis, Range1d
from bokeh.io import show, output_notebook<jupyter_output><empty_output><jupyter_text>Back to top   2. Variables and Data Types in PythonThis chapter is dedicated to describing how variables are handled in Python. Variables consist of values that, in turn, belong to different data types. The most common data types in Python are: integers, floating point numbers, strings and booleans. Once starting to learn a new programming language it is good to become acquainted with what the good practices of writing code in that language are. The chapter [Python Conventions](py_conventions) includes some common rules and suggestions for how to produce high quality Python code.If you have some prior experience in coding, you will know how hard it can be to understand code written by others when there are insufficient or no comments. Therefore, the last part of this chapter is dedicated to different ways of commenting in Python.    2.1. Variables in Python Variables are used in programming to store different types of values. To create a variable, write the name of the variable followed by an equal sign and the value you wish to store. There are strict rules regarding what a variable name can be. Read more about these rules in [Python Conventions](py_conventions).For example write,```pythonx = 10```to store the numerical value _10_ in a variable called _x_.<jupyter_code>#Create a variable and assign a value:
x = 10

#Print the variable's value:
print(x)<jupyter_output><empty_output><jupyter_text>Back to top   2.2. Data Types in Python Variables can store values that belong to different data types. Common data types in Python are:- **Integers** (int) &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;--- > &emsp; e.g. 100- **Floating Point Numbers** (float) &emsp; --- > &emsp; e.g. -0.4- **Strings** (str)&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;--- > &emsp; e.g. 'CO2' or "Ecosystem"- **Booleans** (bool) &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; --- > &emsp; e.g. True or False<jupyter_code>#Create variables:
int_var = 100           #integer
float_var = -0.4        #float
str_var = "Storgatan 7" #string
bool_var = True         #boolean

#Print the value stored in every variable:
print(int_var)
print(float_var)
print(str_var)
print(bool_var)<jupyter_output><empty_output><jupyter_text>Python has a built-in function called type() that can be used to return the data type of a given variable.<jupyter_code>#Return the data type of the "str_var" variable:
type(str_var)<jupyter_output><empty_output><jupyter_text>Back to top   2.3. Python ConventionsHere are some rules and suggestions to improve the readability of your Python code and make it more comprehensible.- Variable names consist strictly of letters, numbers and underscores.- A valid variable name cannot begin with a number.- Python has a number of reserved words that cannot be used as variable or function names. A list of reserved words in Python can be found [here](https://www.w3schools.com/python/python_ref_keywords.asp).- It is considered good practice to avoid using national characters (e.g. ö) in  variable or function names. - Try to give variables, functions and parameters short, describing and representative names. It should be easy to understand what a variable stands for or what kind of process a function is responsible for just by reading their corresponding name.- In cases were it is impossible to avoid giving a variable or a function a long name, try to use underscores _ between the words.    - Other programming languages might use the camel case notation for this purpose. The camel case notation represents a way of writing together words without the use of underscores or hyphens. Instead, each word or abbreviation in the middle of the phrase will begin with an upper case character (e.g. rectangelAreaKm2).        - Function and variable names should begin with a lower case character.- Names of classes should begin with an upper case character.- Use backspace characters and blank lines to improve the readility of your code.    - Use backspace characters before and after operators.    - Add blank lines after imports and between function definitions.          - We live in a world where interacting with people from different countries is a given. If you wish to share your code with other people, try to write it in a language that everyone will understand.- Always include a comment after a function definition. This will make it easier for people to understand what the function does.<jupyter_code>#Example of invalid variable name:
name$v = 1        #contains a character that is not a letter, a number or an underscore
#Example of invalid variable name:
2varName = "hej!" #start with a number
#Example of invalid variable name:
from = 7          #invalid use of reserved word "from"
#Example of valid variable names:
name_v = 1
varName2 = "hej!"
from_0_10 = 7

#Example of valid variable name that should be avoided:
compute_circle_area_with_π = "Includes national character..."

#Example of valid variable name that should be used instead:
compute_circle_area_with_pi = "Includes no national characters..."
#Create variables:
b = 100
h = 60

#Example of long variable names:
rectangleArea = b * h   # camel case notation
rectangle_area = b * h  # underscores
rect_area = b * h       # abbreviations with underscores<jupyter_output><empty_output><jupyter_text>Back to top   2.4. Comments in PythonCommments are essential for making a piece of code easily understandable by others. Imagine a developer that  produced a piece of code for project A a couple of months ago but has since worked on another project. How easy will it be for this developer to update the code produced for project A if the code does not include any comments? Comments also help developers remember what a piece of code they produced a while ago does when they revisit it a long time later.Python includes single-line comments. To write a single-line comment in Python, simply put the hash mark **** before your desired comment. Python will ignore everything between the hash mark and the end of the line.<jupyter_code>#This is a single-line comment.

print("This will run.") #This will not run.<jupyter_output><empty_output><jupyter_text>While Python does not have a native multiline commenting functionality, it is possible to create multiline comments. One way of doing so, is to add a new hash mark before your comment in every line.<jupyter_code># This is an example of how
# you can spread comments
# over multiple lines in Python<jupyter_output><empty_output><jupyter_text>Another way to create a multiline comment is to use multiline strings. Multiline strings can be produced by wrapping text inside a set of triple quotes. While this will provide the multiline functionality it is technically not a comment. It is a string that has not been assigned to any variable and will therefore not be called or referenced by your program at runtime.However, one should be careful when writing multiline comments. Depending on where they are placed in a program, multiline comments could turn into docstrings (i.e. Python documentation strings used to provide information for Python modules, classes and methods.). If a multiline comment is entered right after a function or class definition, then it will become a docstring associated with that object.<jupyter_code>"""
    This is a 
    multi-line comment

"""



'''
    Text within """ """
    or ''' '''
    will not be executed!

'''



print('This line will be executed.')<jupyter_output><empty_output><jupyter_text>Use this [link](https://realpython.com/python-comments-guide/) to get more information about how to use comments.      Back to top   3. Operators in PythonAn operator is a character (e.g. "+") that represents an action. For example ```+``` is an arithmetic operator that represents the addition of two numbers. There are different types of operators. The most commonly used types of Python operators are presented below. Typical examples of the use of every operator are also included.   3.1. Arithmetic OperatorsArithmetic operators are typically used with numerical values or variables to perform mathematical computations such as, for example, addition, subtraction, multiplication, division and modulus.      Back to top   3.2.  Assignment OperatorsAssignment operators are used to assign values to variables.      Back to top   3.3. Comparison OperatorsComparison operators are used to compare one or two sets of values. They return a value that is ```True``` or ```False``` depending on the result of the comparison.      Back to top   3.4. Logical OperatorsLogical operators are typically used to combine statements that include comparison operators. The only exception to that, is the Logical Operator ```not```, which operates over a single statement. Logical operators return a value that is ```True``` or ```False``` depending on the result of the statements including the comparison operators.      Back to top   3.5. Identity OperatorsIdentity operators are used to compare objects. Identity operators do not control if two objects contain the same set of values. Instead, they control if two variables refer to the same object. More in specific, they control if two variables contain references to the same memmory address.      Back to top   3.6. Membership OperatorsMembership Operators are used to control if a value is included in a sequence (strings, lists, or tuples).      Back to top   3.7. Bitwise OperatorsBitwise operators perform a bitwise operation over one or several binary values at the bit-level. In the examples below, the first bit to the right is considered as the least significant bit whilst the first bit to the left is considered the most significant bit.      Back to top   4. Data Structures in PythonData structures are objects that may include a number of other objects. Some typical examples of Python's data structures are:sets, lists, tuples and dictionaries. Python has also other structures such as NumPy arrays, Pandas DataFrames and objects. This part focues on the following data structures:-  [Lists](list_py)-  [Sets](set_py)-  [Tuples](tuple_py)-  [Dictionaries](dictionary_py)   4.1. ListsA list is a collection of items that usually belong to the same data type. Lists are ordered and may include duplicates. In Python lists are written with square brackets [].It is possible to create a list by enclosing a number of comma-separated values within square brackets. Another way of creating a list is by using the constructor list(). In Python, constructors are used to create an object from a class. Classes and objects are described in more detail in the chapter [**Classes and Objects in Python**](py_objects).This part focuses on the following list-related topics:-  [Access list items](access_list_items_py)-  [Change the value of a list item](change_list_items_py)-  [Return the total number of items in a list](list_length_py)-  [Add/remove items from a list](update_list_py)-  [Copy list](copy_list_py)-  [Sort List](order_list_py)      [Data structures]<jupyter_code>#Create a list:
tracers = ["co2", "co", "ch4"]

#Print all list items:
print(tracers)
#Create a list using the list constructor:
gases = list(("o2", "co2", "n2o"))

#Print all the list items:
print(gases)<jupyter_output><empty_output><jupyter_text>4.1.1. Access list itemsLists are ordered and indexed. This means that every list item has a different index number. Indeces in Python start at **0** and continue incrementally. Consequently, the first list item has an index number that is equal to 0.It is possible to access a specific list item using its corresponding index number.<jupyter_code>#Print the 1st list item:
print(tracers[0])
#Print the 3rd list item:
print(tracers[2])<jupyter_output><empty_output><jupyter_text>Use the keyword in to check if a value is included in a list.<jupyter_code>#Check if "co2" is included in "tracers":
print("co2" in tracers)
#Check if "so2" is included in "tracers":
print("so2" in tracers)<jupyter_output><empty_output><jupyter_text>[Lists intro]   4.1.2. Change the value of a list itemTo change the value of an existent list item, use its corresponding index number.  _Syntax:_<jupyter_code>#Change the value of the list's 2nd item from "co" to "n2o2":
tracers[1] = "n2o"

#Print list:
print(tracers)<jupyter_output><empty_output><jupyter_text>[Lists intro]   4.1.3. Return the total number of items in a listThe method len() returns an integer representing the total number of items in a list (_len_ is short for _length_ - refering to the length of a list)._Syntax:_<jupyter_code>#Print the total number of items in a list:
print(len(tracers))<jupyter_output><empty_output><jupyter_text>[Lists intro]   4.1.4.   Add/remove items from a listPython includes a number of keywords and built-in methods to process lists. Here's a description of the most common of them:- append() is used to add an item to the end of an existent list.- insert() adds a new item to a list at a given position (index-number). - remove() deletes an item from a list.- pop() removes an item from a list and returns its value. The method removes an item based on a given index-number. If no index number is specified, the method will by default remove the list's last item.- The keyword del deletes items from a list based on their index-number. It is possible to delete one or more items at the same time. del can also be used to delete an entire list.- clear() deletes all items in a list and returns an empty list.<jupyter_code>#Add an item at the end of a list:
tracers.append('co')

#Print list:
print(tracers)
#Add an item to list at a specific position (index-number = 2):
tracers.insert(2, 'Pb')

#Print list:
print(tracers)
#Remove item from list:
tracers.remove('Pb')

#Print list:
print(tracers)
#Remove item from list based on its index-number:
#(if no index number is specified, the method will remove the list's last item)
last_item = tracers.pop()

#Print removed item:
print(last_item)

#Print list:
print(tracers)
#Remove item from list based on its index-number:
removed_item = tracers.pop(2)

#Print removed item:
print(removed_item)

#Print list:
print(tracers)
#Delete item from list based on its index-number:
del tracers[1]

#Print list:
print(tracers)
#Delete list:
del tracers

#Print list:
print(tracers)

#An error-message will appear, stating that the variable "tracers" no longer exists.
#Create a list:
tracers = ["co2", "co", "ch4", "n2o"]

#Delete items with index nuber 1 and 2:
del tracers[1:3]

#Print list:
print(tracers)
#Create a list:
tracers = ["co2", "co", "ch4", "n2o"]

#Print list:
print(tracers)

#Delete al items:
tracers.clear()

#Print list:
print(tracers)<jupyter_output><empty_output><jupyter_text>[Lists intro]   4.1.5. Copy listIt is not possible to create a copy of a list by typing new_list = old_list. This is because there is a _reference_ between new_list and old_list. A reference is a mechanism that allows two or more different variables to point to the same memory location. As a result, changes in __old_list__ will be visible in __new_list__.Python includes two built-in methods to copy a list:-  copy() creates a copy of a list.-  list() may also be used to create a copy of a list.<jupyter_code>#Create a list:
tracers = ["co2", "co", "ch4", "n2o"]

#Bad example:
tracers2 = tracers

#Remove last item from "tracers2":
tracers2.pop()

#Print list:
print(tracers)

#Print copy:
print(tracers2)
#Create a list:
tracers = ["co2", "co", "ch4", "n2o"]

#Create a copy of the list using copy():
tracers_copy = tracers.copy()

#Print copy:
tracers_copy
#Delete last item from "tracers_copy":
tracers_copy.pop()

#Print list:
print(tracers)

#Print copy:
print(tracers_copy)
#Create a copy of the list using list():
tracers_copy2 = list(tracers)

#Print copy:
tracers_copy2
#Delete last item from "tracers_copy2":
tracers_copy2.pop()

#Print list:
print(tracers)

#Print copy:
print(tracers_copy2)<jupyter_output><empty_output><jupyter_text>[Lists intro]   4.1.6. Sort listPython has two built-in methods for sorting lists:-  reverse() presents the items of a list in reversed order.-  sort() sorts the items of a list in ascending or descending order. It is also possible to call a function for specifying the criteria of the sorting order.<jupyter_code>#Create list:
tracers = ["co2", "co", "ch4", "n2o"]

#Present the list items in a reversed order:
tracers.reverse()

#Print sorted list:
tracers
#Create list:
tracers = ["co2", "co", "ch4", "n2o"]

#Sort the list items in descending order using sort():
tracers.sort(reverse=False)

#Print sorted list:
tracers
#Create list:
tracers = ["co2", "co", "ch4", "n2o"]

#Sort the list items in ascending order using sort():
tracers.sort(reverse=True)

#Print sorted list:
tracers
#Sort the items of a list using a function.

#Create list:
tracers = ["co2", "co", "ch4", "n2o"]

#Define sorting-function:
def sortFunc(str):
    
    #Return the number of charcters in a string:
    return len(str)

#Sort list according to the number of characters of every item:
#Items with the largest number of characters are put in the beginning of the list:
tracers.sort(reverse=True, key=sortFunc)

#Print sorted list:
tracers<jupyter_output><empty_output><jupyter_text>[Lists intro]     Back to top   4.2. SetsIn Python, a set is a random collection of unique values. A set does not include duplicates (i.e. repetions of the same item) and its items are not ordered. A set is not indexed. Sets are used when focusing on checking if an item is inlcuded in a collection rather than checking the order items are stored in or how many copies of the same item can be found.Sets are written with curly brackets {}. Sets can also be created with the help of the constructor: set().The chapter focuses on the following set-related topics:-  [Create set](create_set_py)-  [Access item in a set](access_set_items)-  [Add, remove and update items in a set](update_set_items)-  [Return the total number of items in a set](get_set_length)   4.2.1. Create a set in Python<jupyter_code>#Create set:
set_1 = {"co2", "co", "ch4"}

#Print all items stored in the set:
print(set_1)

#Observe that the order the items are printed
#is not necessarily the same as the order they had 
#when the set was created.


#Create a set using the constructor set():
set_2 = set(["n2o", "so2", "Pb"])

#Print all items:
print(set_2)<jupyter_output><empty_output><jupyter_text>4.2.2. Access item in a setSets have no index. Therefore, it is not possible to use an item's index-number to access it. Items can be accessed with the help of a for-loop.The keyword in is used to control if a value is included in a set.<jupyter_code>#Loop through all the items of a set, one by one, and print them:
for set_element in set_1:
    print(set_element)
#Check if a the value "co2" is included in the set:
print("co2" in set_1)
#Check if a the value "Pb" is included in the set:
print("Pb" in set_1)<jupyter_output><empty_output><jupyter_text>4.2.3. Add, remove and update items in a setPython includes a number of built-in methods for sets. The following methods are used to add, delete and update the content of a set.- add() is used to add __one__ item to a set. - update() adds __more than one__ item to a set.- remove() deletes an item from a set. An error-message will be generated if the specified value is not included in the set.- discard() can also be used to delete an item from a set. __No__ erorr-message will be generated if the specified value is not included in the set.- pop() deletes the last item of a set. Observe that as a set is not indexed, there is no way of knowing which item will be deleted. _pop()_ returns the value of the deleted item. - clear() deletes all items from a set.- The keyword del is used to delete an entire set.<jupyter_code>#Add item to set:
set_1.add("so2")

#Print all items in the set:
print(set_1)
#Add multiple items to set:
set_1.update(["Pb", "n2o"])

#Print all items in the set:
print(set_1)
#Remove item from set:
set_1.remove("Pb")

#Print set:
print(set_1)
#Remove item from set:
set_1.remove("h2o")

#The set does not include any items with the value "h20".
#This will generate an error-message.
#Remove item from set:
set_1.discard("co")

#Print set:
print(set_1)
#Remove item from set:
set_1.discard("o3")

#The set does not include any items with the value "o3".
#This will not generate an error-message as we used the discard() built-in method.
#Remove the last item of a set:
removed_item = set_1.pop()

#Print removed item:
print(removed_item)
#Delete all items of a set:
set_1.clear()

#Print set:
print(set_1)
#Delete set:
del set_1

#Print set:
print(set_1)

#An error-message will be generated when print() is called
#because set_1 has been deleted.<jupyter_output><empty_output><jupyter_text>4.2.4. Return the total number of items in a setThe built-in method len() returns the total number of items included in a set.<jupyter_code>#Create set:
set_2 = set(["n2o", "so2", "Pb"])

#Return the total number of values included in "set_2":
len(set_2)<jupyter_output><empty_output><jupyter_text>[Data structures]     Back to top   4.3. Tuples Tuples are collections of ordered items that are immutable (i.e. can not be changed). Tuples are used to group values that are somehow related. The items of a tuple may belong to different data types. In Python, tuples are presented as comma-separated values within round brackets.The chapter focuses on the following tuple-related topics:-  [Create tuple](create_tuple_py)-  [Access item in tuple](access_tuple_items)-  [Extract value(s) from tuple](unpack_tuple)-  [Return the total number of items stored in a tuple](tuple_len)-  [Built-in methods for tuples](tuple_methods)-  [Examples of tuple implementations](tuple_implementations)      [Data structures]   4.3.1. Create TupleIt is possible to create a tuple by:- enclosing comma-separatd values within round brackets. - using the constructor tuple().<jupyter_code>#Create tuple:
gas = ("ch4", "co", "co2", "n2o")

#Print tuple:
print(gas)
#Create tuple using the constructor tuple():
htm_station = tuple(("Hyltemossa", 150, "Sweden")) # station name, sampling height & country

#Skriv ut tupel:
print(htm_station)<jupyter_output><empty_output><jupyter_text>[Tuples intro]   4.3.2. Access item in tupleIt is possible to access an item in a tuple by using its corresponding index-number.The keyword in can be used to control if a value is included in a tuple.<jupyter_code>#Print item with index-number 3:
print(gas[3])
#Check if the value "Pb" is included in "gas":
print("Pb" in gas)<jupyter_output><empty_output><jupyter_text>[Tuples intro]   4.3.3. Extract values from tuple<jupyter_code>#Create tuple with the x- and y-coordinates of a point:
point = (17, 18)

#Unpack tuple:
x_coordinate, y_coordinate = point

#Print tuple unpacked items:
print('x-coordinate: ', x_coordinate)
print('y-coordinate: ', y_coordinate)<jupyter_output><empty_output><jupyter_text>[Tuples intro]   4.3.4. Return the total number of items stored in a tupleThe built-in method len() returns the total amount of items stored in a tuple.<jupyter_code>#Returnera det total antalet element:
print(len(htm_station))<jupyter_output><empty_output><jupyter_text>[Tuples intro]   4.3.5. Built-in methods for tuplesPython has two built-in methods for tuples. -  count() returns the total number of times a value is stored in a tuple.-  index() controls if a value is stored in a tuple and, if this is the case, returns the index-number of the corresponding item.<jupyter_code>#Create tuple:
#station name, station location, sampling height, domain, country that hosts & pays for the station
station_info = ("Hyltemossa", "Sweden", 150, "atmosphere", "Sweden") 

#How many times is the value "Sweden" stored in the tuple:
station_info.count("Sweden")
#Return the index-number of the item whose value is "Hyltemossa":
station_info.index("Hyltemossa")<jupyter_output><empty_output><jupyter_text>[Tuples intro]   4.3.6. Examples of tuple implementationsA typical use case of tuples is when it is desired for a function to return more than one value. [Functions](python_func) are described in detail later on.<jupyter_code>#Function that returns mirrored coordinates on x-axis:
def mirror_x_axis(p):
    
    #Extract values from tuple:
    x, y = p
    
    #Returned mirrored values in x-axis:
    return -x, y


#Create tuple to store point coordinates:
point = (4, 5)

#Call function:
x_mirrored, y_mirrored = mirror_x_axis(point)

#Print results:
print('x-coord: ', x_mirrored)
print('y-coord: ', y_mirrored)<jupyter_output><empty_output><jupyter_text>[Tuples intro]     Back to top   4.4. DictionariesDictionaries are unordered, indexed collections that can be updated. More in particular, a dictionary consists of a collection of key-value pairs. Every key-value pair maps the key to its corresponding value. It is possible to extract a value from a dictionary by usong its key. Keys are unique. The same key cannot occur twice. Dictionaries in Python are enclosed by curly brackets {}. The chapter focuses on the following dictionary-related topics:-  [Create dictionary](create_dictionary_py)-  [Access items in dictionary](accessing_dictionary_items_py)-  [Update existent values in dictionary](changing_dictionary_items_py)-  [Return the total number of items stored in a dictionary](dict_len_py)-  [Add/remove items from dictionary](add_remove_items_dict_py)-  [Copy dictionary](copy_dict_py)-  [Loop through dictionary items](loop_dictionary_items_py)      [Data structures]   4.4.1. Create dictionaryDictionaries can be created:-  by enclosing comma-separated pairs of values with the format "key1":"value1" within curly brackets {}. -  with the help of the dict() constructor.<jupyter_code>#Create dictionary with a selection of icos atmposhere stations (key="station name":value="country"):
icos_stations_atc = {"Hyltemossa":"Sweden",
                     "Svartberget":"Sweden",
                     "Gartow":"Germany",
                     "Ispra":"Italy",
                     "Cabauw":"Netherlands",
                     "Pallas":"Finland",
                     "Trainou":"France"}

#Print dictionary:
print(icos_stations_atc)
#Create dictionary with a selection of icos ecosystem stations using a constructor:
#(key="station name", value="country")
icos_stations_etc = dict(Hyltemossa = "Sweden",
                         Skjern = "Denmark",
                         Siikaneva = "Finland",
                         Lanzhot = "Czech Republic",
                         Hesse = "France",
                         Grignon = "France",
                         Kumpula = "Finland",
                         Varrio = "Finland")

#Skriv ut nyckel-värdetabell:
print(icos_stations_etc)<jupyter_output><empty_output><jupyter_text>[Dictionary intro]   4.4.2. Access items in dictionaryIt is possible to access a value in a dictionary:-  by using its corresponding key. -  with the help of the built-in method get().The keyword in can be used to check if a key or value is included in a dictionary. The keyword is used in combination with other built-in methods.-  keys() returns all the keys of the dictionary.-  values() returns all the values of the dictionary.-  items() returns all the key-value pairs of the dictionary.<jupyter_code>#Return the country where Cabauw is located in:
print(icos_stations_atc["Cabauw"])
#Return the country where Hyltemossa is located in::
icos_stations_atc.get("Hyltemossa")
#Return all keys of a dictionary:
icos_stations_etc.keys()
#Return all values of a dictionary:
icos_stations_etc.values()
#Return all "key-value" pairs of a dictionary:
icos_stations_etc.items()
#Check if the key "Norunda" is included in icos_stations_atc:
print("Norunda" in icos_stations_atc)
#Check if the key "Hyltemossa" is included in icos_stations_atc:
print("Hyltemossa" in icos_stations_atc)
#Check if the value "Finland" is included in icos_stations_atc:
print("Finland" in icos_stations_atc.values())
#Check if the key "Pallas" is included in icos_stations_atc:
print("Pallas" in icos_stations_atc.keys())
#Check if the "key-value" pair ("Pallas", "Finland") is included in icos_stations_atc:
print(("Pallas", "Finland") in icos_stations_atc.items())<jupyter_output><empty_output><jupyter_text>[Dictionary intro]   4.4.3. Update existent values in dictionaryThe value of a key-value pair in a dictionary can be changed by using its key.<jupyter_code>#Create a dictionary with the station name and the type of station:
station_type = dict(Hyltemossa = "ecosystem",
                    Skjern = "ecosystem",
                    Siikaneva = "ecosystem")

#Change the value for the key "Hyltemossa" from "ecosystem" to "atmosphere":
station_type['Hyltemossa']="atmosphere"

#Print dictionary:
print(station_type)<jupyter_output><empty_output><jupyter_text>[Dictionary intro]   4.4.4. Return the total number of items stored in a dictionarylen() stands for dictionary lenght and is a Python built-im method for dictionaries that returns an integer representing the total number of "key-value" pairs in a dictionary.<jupyter_code>#Create a dictionary with the station name and the type of station:
station_type = dict(Hyltemossa = "ecosystem",
                    Skjern = "ecosystem",
                    Siikaneva = "ecosystem")

#Get the total number of "key-value" pairs in station_type:
len(station_type)<jupyter_output><empty_output><jupyter_text>[Dictionary intro]   4.4.5. Add/remove items from dictionaryIt is possible to add new "key-value" pairs to a dictionary.-  The built-in method update() is used to add new "key-value" pairs to an existent dictionary.Python includes a number of built-in methods and keywords to remove "key-value" pairs from a dictionary. -  pop() deletes the "key-value" pair that is related to a specific key. The method returns the value of the deleted "key-value" pair. -  popitem() deletes the last "key-value" pair. The method returns the deleted "key-value" pair.-  clear() deletes all "key-value" pairs from a dictionary (i.e. it returns an empty dictionary).-  The keyword del deletes a "key-value" pair for a given key. It can also be used to delete an entire dictionary.<jupyter_code>#Create dictionary with a selection of icos ecosystem stations using a constructor:
#(key="station name", value="country")
icos_stations_etc = dict(Hyltemossa = "Sweden",
                         Skjern = "Denmark",
                         Siikaneva = "Finland",
                         Lanzhot = "Czech Republic",
                         Hesse = "France",
                         Grignon = "France",
                         Kumpula = "Finland",
                         Varrio = "Finland")

#Add the "key-value" pair "Lonzee":"Belgium" to the icos_station_etc dictionary:
icos_stations_etc["Lonzee"] = "Belgium"

#Print dictionary:
print(icos_stations_etc)
#Use the built-in method update() to add the "key-value" pair "Lusignan:France" to the dictionary:
icos_stations_etc.update({"Lusignan":"France"})

#Print dictionary:
print(icos_stations_etc)
#Delete "key-value" pair with key="Varrio":
icos_stations_etc.pop("Varrio")

#Print dictionary:
print(icos_stations_etc)
#Remove the last "key-value" pair:
icos_stations_etc.popitem()

#Skriv ut nyckel-värdetabell
print(icos_stations_etc)
#Delete all "key-value" pairs from a dictionary:
icos_stations_etc.clear()

#Print dictionary:
print(icos_stations_etc)
#Create dictionary with a selection of icos ecosystem stations using a constructor:
#(key="station name", value="country")
icos_stations_etc = dict(Hyltemossa = "Sweden",
                         Skjern = "Denmark",
                         Siikaneva = "Finland",
                         Lanzhot = "Czech Republic",
                         Hesse = "France",
                         Grignon = "France",
                         Kumpula = "Finland",
                         Varrio = "Finland")

#Delete "key-value" pair with the key "Hesse":
del icos_stations_etc["Hesse"]

#Print dictionary:
print(icos_stations_etc)
#Delete icos_stations_etc dictionary:
del icos_stations_etc

#Print dictionary:
print(icos_stations_etc)

#print() will generate an error-message
#because the dictionary "icos_stations_etc"
#has been deleted and no longer exists..<jupyter_output><empty_output><jupyter_text>[Dictionary intro]   4.4.6. Copy dictionaryIt is not possible to copy a dictionary by typing new_dict = old_dict. This is because there is a _reference_ between new_dict and old_dict. A reference is a mechanism that allows for two different variables to point to the same memory location. As a result, changes made in __old_dict__ will also be visible in  __new_dict__.Python has two built-in methods for copying dictionaries:-  copy() is used to create a copy of a dictionary.-  dict() may also be used to copy a dictionary.<jupyter_code>#Create dictionary with a selection of icos atmposhere stations:
#(key="icos station name":value="country")
icos_stations_atc = {"Hyltemossa":"Sweden",
                     "Svartberget":"Sweden",
                     "Gartow":"Germany",
                     "Ispra":"Italy",
                     "Cabauw":"Netherlands",
                     "Pallas":"Finland",
                     "Trainou":"France"}

#Copy "icos_stations_atc" dictionary:
icos_stations_atc_copy = icos_stations_atc.copy()

#Print copy:
print(icos_stations_atc_copy)
#Create a new copy of the "icos_stations_atc" dictionary using dict():
icos_stations_atc_copy2 = dict(icos_stations_atc)

#Print new copy:
print(icos_stations_atc_copy2)<jupyter_output><empty_output><jupyter_text>[Dictionary intro]   4.4.7. Loop through dictionary itemsUse a for-loop to loop through all items (i.e. "key-value" pairs) in a dictionary. Using a loop enables users to return different kind of information from a dictionary (e.g. keys, values or "key-value" pairs). Here are some examples.<jupyter_code>#Loop through all the "key-value" pairs in a dictionary and print their keys one-by-one:
for m in icos_stations_atc:
    print(m)
#Loop through all the keys of a dictionary and print them one-by-one:
for n in icos_stations_atc.keys():
    print(n)
#Loop through all the "key-value" pairs of a dictionary one-by-one and print their value:
for v in icos_stations_atc:
    print(icos_stations_atc[v])
#Loop through all the values of a dictionary and print them one-by-one:
for w in icos_stations_atc.values():
    print(w)
#Loop through all the "key-value" pairs of a dictionary with the help of items() and
#print every "key-value" pair:
for x, y in icos_stations_atc.items():
    print(x,y)<jupyter_output><empty_output><jupyter_text>[Dictionary intro]     Back to top   5. String manipulation in PythonIn Python, text is represented with the data type _String_. A string object is generally defined as text within double or single quotation marks. Python includes a set of built-in methods for string manipulation. Here are some examples of the most common methods.-  find() finds the first occurrence of a value and returns its corresponding index-number. If the given value is not included in the string, the method returns the value ___-1___.-  upper() returns a string where all characters have been converted to their upper case equivalents.-  lower() returns a string where all characters have been converted to their lower case equivalents.-  capitalize() returns a string where only the first character is upper case and all the rest are lower case.-  count() returns the total number of times a substring is encountered in another string.-  split() divides the original string to substrings and returns a list of the aforementioned substrings. The original string is split every time a given substring is encountered.-  strip() removes backspace characters from the beginning or the end of a string. The method can also be used to remove user-defined substrings from the beginning or the end of a string.-  replace() is used to replace a given substring with another substring in a string.-  join() joins a list of strings to one string with a user-defined string between every string in the list.-  encode() returns a string in utf-8 encoding. An error-message will be generated, if the conversion should fail. It is also possible to return text in other encodings (e.g. ascii, latin1, etc.). This may be required when processing special characters or symbols.<jupyter_code>#Create a string usign single or double quotation marks:
text1 = 'Max temperature last summer-period'
text2 = ": "
text3 = "32 C\xb0"

#Print string:
print(text1)
#Return character with index-number "1" in text1:
print(text1[1])
#Return the index-number of the first occurrence of the character "a" in text1:
print(text1.find("a"))
#Return the index-number of the first occurence of the character "t" in text1:
print(text1.find("t"))
#Convert all characters in text1 to upper case:
print(text1.upper())
#Convert all characters in text1 to lower case:
print(text1.lower())
#Return text1 with only the first character in upper case:
print(text1.capitalize())
#Return the total number of times the character "e" is repeated in text1:
print(text1.count("e"))
#Return the total number of times the substring "er" is occurring in text1:
print(text1.count("er"))
#Split the original string to substrings whenever a backspace character is encountered:
split_text = text1.split(" ")

#Print list:
print(split_text)
#Remove the substring "period" from the original string:
print(text1.strip("period"))
#Replace the substring "Max" with "Min":
replaced_text = text1.replace("Max", "Min")

#Print string:
print(replaced_text)
#Create a string usign single or double quotation marks:
text1 = 'Max temperature last summer'
text2 = ": "
text3 = "32 C\xb0"

#Concatenate strings:
fulltext = text1 + text2 + text3

#Print result:
print(fulltext)
#Concatenate strings using the built-in method join():

#Create a list of strings:
text_list = [text1, text2, text3]

#Create a variable to store the string to be included between the strings in the list:
between_text = " "

#Concatenate the strings in the list including the "between_text"-string
#between every string in the list:
fulltext2 = between_text.join(text_list)

#Print concatenated string:
print(fulltext2)
#Create a new string with the character "ö":
text = 'Degerö'

#Prin string:
print('ICOS station: ', text)
print()

#Change the current encoding to utf-8:
string_utf = text.encode()

#Change the encoding to ascii:
string_ascii = text.encode("ascii", "replace")

#change back the encoding from ascii to utf-8:
string_ascii_ign = text.encode("ascii", "ignore")

#Print results:
print('ICOS station: ', string_utf)
print('ICOS station: ', string_ascii)
print('ICOS station: ', string_ascii_ign)<jupyter_output><empty_output><jupyter_text>Back to top   6. Control flow in PythonControl flow can be described as the order in which statements and functions calls are executed in a program. In Python, the control flow can be steered by if-statements, for-loops, while-loops and function calls. Functions and function calls are described in greater detail in the chapter [Create Python functions](python_func).This chapter focuses upon the following control statements:-  [if-statements](if_statement_py)-  [for-loops](for_loop_py)-  [while-loops](while_loop_py)      Back to top   6.1. If-statementsif-statements are used in cases when a piece of code should only be executed when a condition is met. Conditions often include comparison operators that generate results that are _True_ or _False_. It is possible to combine several conditions using logical operators. Here's the if-statement syntax:<jupyter_code>#Example of simple if-statement with comparison operators

#Create variable to store CO-value:
co = 101

#Check if the CO-value is greater than 100 ppm:
if co > 100:
    
    #Print the following if the CO-value is greater than 100 ppm:
    print("High level of CO !")
#Example of if-else-statement with comparison operators

#Create variable to store CO-value:
co = 35

#Check if the CO-value is greater than 100 ppm:
if co > 100:
    
    #Print the following if the CO-value is greater than 100 ppm:
    print("Dangerous level of CO !")

#If the CO-value is less than 100 ppm:
else:
    print("Low to medium level of CO")
    
#Example of if-elif-else-statements with comparison operators and logigal operators

#Create variable to store CO-value:
co = 60

#Check if the CO-value is greater than 100 ppm:
if co > 100:
    
    #Print the following if the CO-value is greater than 100 ppm:
    print("High level of CO !")

#Check if the CO-value is greater than 100 ppm:
elif ((co >= 50) and (co <= 100)):
    
    #Print the following if the CO-value is greater than 50 ppm but less than 100 ppm:
    print("Medium level of CO")    

#If the CO-value is less than 50 ppm:
else:
    print("Low level of CO")<jupyter_output><empty_output><jupyter_text>If-statements can be **nested**. This means that an if-statement can be placed inside another if-statement. An example of nested if-statetements is presented below:<jupyter_code>#Create variable to store CO-value:
co = 50


#Check if the CO-value is less or equal to 100 ppm:
if co < 100:

    #Check if the CO-value is greater or equal to 50 ppm:
    if (co >= 50):
        
        print("Medium level of CO")    

    #If the CO-value is less than 50 ppm:
    else:
        
        print("Low level of CO")
        
#If the CO-value is greater than 100 ppm:
else:
    print("High level of CO !")<jupyter_output><empty_output><jupyter_text>[Control flow intro]   6.2. For-loopsfor-loops are used for operations that are expected to be repeated a known number of times. For example, it is possible to go through the items of a list using a for-loop.<jupyter_code>#Example of for-loop iterating over the items of a list & printing them:
for gas in ['co2','n2o','ch4']:
    print(gas, " is a greenhouse gas")<jupyter_output><empty_output><jupyter_text>The built-in method range() returns a sequence of numbers, starting from 0 (by default) and ending at specified number. The integer number specifying the incrementation (step) is by default equal to 1. The user has to define the ending value of the sequence. However, the _start_ and _step_ parameters of the method are optional. The method can be used in conjunction with a ```for```-loop to iterate over a set of values.The syntax for range() is presented below:<jupyter_code>#Create a sequence of 4 values that begin with 0:
check_range = range(0, 4, 1)

#Print every value in the sequence:
for num in check_range:
    print(num)<jupyter_output><empty_output><jupyter_text>The syntax for the combined for-loop and range() example is presented below:<jupyter_code>#Create a list of gases:
gases = ["co2", "co", "ch4", "n2o"]

#Print list:
print("List: ", gases)

#Print the total number of items included in the list:
print("Total num of items: ", len(gases))

#Iterate over a sequence of values representing the index-number of every item in the list:
for i in range(len(gases)):
    
    #Print the index-number and the value of every item in the list:
    print()
    print('index-number: \t', i)
    print('item: \t', gases[i])<jupyter_output><empty_output><jupyter_text>For-loops can be nested. A **nested loop** is a loop inside a loop. Observe that an inner loop is executed one time for every iteration of its immediate outer loop.<jupyter_code>#Create a list with level-info & another with greenhouse gases:
levels = ["high", "medium", "low"]
gases = ["co2", "co", "ch4", "n2o"]

#Outer loop:
for x in levels:
    
    #Inner loop:
    for y in gases:
        
        #Print current x-value and y-value:
        print(x, y)<jupyter_output><empty_output><jupyter_text>[Control flow intro]   6.3. While-LoopsWhile-loops are used in cases where an operation is to be repeated an unknown number of times.While-loops should be used with caution so that no endless loops (or infinite loops) are created. An endless loop will cause the program to continue executing indefinitely. The only way to exit an endless loop is by manually stopping the execution of the program. The code in the following example prints the value of the help variable __w__ at every iteration, as long as **w** has a value that is less than 10. The initial value of the help variable is zero. Its value is increased by one at every iteration. If the line ```w = w + 1``` was deleted, then the aforementioned example would become an endless loop (see code example below). This is because, in that case, ```w```would always be equal to zero and the condition ```w < 10``` would always be true. As a consequence, the code would never finnish executing. To avoid that, it is important to never forget including the statement that controls the increase of the value of the loop's help variable at every iteration.```pythonDeclare & initialize help variable:w = 0Loop that will continue executing as long as w < 10:while(w < 10):        Print the value of the help variable:    print(w)    ```<jupyter_code>#Define and initialize help variable:
w = 0

#Loop that will keep executing as long as the condition "w <10" is true:
while w < 10:
    
    #Print the current value of the help variable:
    print(w)
    
    #Increase the value of the help variable by 1:
    w = w + 1<jupyter_output><empty_output><jupyter_text>[Control flow intro]     Back to top   7. Create functions in PythonA functions is a collection of code (i.e. a code block) that is executed only when the function is called. A function may include variables, operators (e.g. +, -, *, / eller %), if-statements, loops, etc. The syntax to create a function in Python is:```pythondef function_name_1():        code```It is possible to pass values (data) to functions. This is acheved with the help of parameters. Parameters are variables that are included in a method definition. Arguments are the data that are passed to a method's parameters. A function may have zero, one or many parameters. ```pythondef function_name_2(parameter1, parameter2):        code    ```A function may return data with the help of the return-statement. return is generally used at the end of a function to return a result.```pythondef function_name_3(parameter1, parameter2, parameter3):        total_sum = parameter1 + parameter2 + parameter3        return total_sum```It is possible for a function to include calls to other functions. ```pythondef function_name(param1, param2, param3, param4):        Call another function:    var = function_name_3(param1, param2, param3)        result = param4 - var        return result```      Back to top<jupyter_code>## Example 1 ##

#Create function that prints a string:
def printText():
    
    print("Hello World!")


#Call function:
printText()
## Example 2 ##

#Create a function that takes one parameter
#of type String as input and prints it: 
def print_input_string(inputString):
    
    print(inputString)
    

#Call function and show result:
print_input_string("We will save the world!")
## Example 3 ##

#Create a function that takes one parameter as input,
#calculates a the area of a circle and returns the result.
#The input parameter is an integer or float
#representing the radius of a circle.
def calc_circle_area(radius):
    
    #Import module:
    import math
    
    #Compute circle area:
    circle_area = math.pi * math.pow(radius, 2)
    
    #Return result:
    return circle_area

#Call function and store result in variable:
result = calc_circle_area(2.0)


#Round up your result to 1 decimal and print it:
print("The circle area is: ", round(result,1))
## Example 4 ##

#Create a function that takes two arguments as input, 
#calls another function to compute the circle area 
#and prints the result.
#1st input parameter: circle radius (data type: int or float) 
#2nd input parameter: area unit (data type: string) 
def calc_circle_area_2(radius, units):
    
    #Import module:
    import math
    
    #Call function to compute circle area:
    circle_area = calc_circle_area(radius)
    
    #Print result:
    print("The circle area is: ", round(circle_area,1), " ", units)

    
#Call function:
calc_circle_area_2(2.0, "m2")<jupyter_output><empty_output><jupyter_text>Python functions   8. Local and global variables in PythonLocal variables are defined and accessible only inside a function. It is _not_ possible to get access to the value of a local variable outside of the function it was defined in.  In Python, a variable declared outside of a function or in global scope is defined as a global variable. Global variables can be accessed inside and outside of functions. Their value is always available.It is considered good practice to avoid using global variables as much as possible. For example, saving a password as a global variable can make this sensitive piece of information easily accesible to a hacker. Another problem with using global variables is when developing code for larger projects. The use of global variables in larger projects may increase the risk of the system crashing due to conflicts. The examples below show how local and global variables can be used in funtions.      Back to top<jupyter_code>##Example 1##

#Define global variable:
glob_var = 5

#Function that prints the value of alocal variable:
def test_func():
    
    #Define local variable:
    local_var = glob_var + 10
    
    #Print local variable:
    print("local variable:", local_var)

    
#Call function:
test_func()

#Print global variable:
print("global variable:", glob_var)
#Print the value of the local variable "local_var":
print(local_var)

#This will generate an error-message as the variable
#"local_var" can only be accessed from code
#written inside the "test_func" function.
##Example 2##

#This is an example of how it is possible for two variables 
#(one global and the other local) to have the same name
#but store different values.

#Define global variable:
test_var = 5

#Function that prints the value of a local variable:
def print_var():
    
    #Define Local variable:
    test_var = 10
    
    #Print local variable:
    print("local variable: ", test_var)

    
#Call function:
print_var()

#Print global variable:
print("global variable: ", test_var)<jupyter_output><empty_output><jupyter_text>Local & Global Variables   9. List ComprehensionsList comprehensions can be used to create lists from existent lists. This is a concise way to write code in Python. List comprehensions execute faster than simple functions with loops. The syntax for building a list comprehension is presented below:Here are some basic examples of list comprehensions.      Back to top<jupyter_code># Example 1 #

#Create a list with 10 items with values from 0 to 9:
list_1 = [i for i in range(10)]

#Print results:
print(type(list_1))
print(list_1)
# Alternative code for Example 1 #

#Create a list to store values:
ls_1 = []


#Loop through every value in a sequence:
for num_1 in range(10):
    
    #Add current sequence value to list:
    ls_1.append(num_1)

    
#Print result:
print(ls_1)
# Example 2 #

#Create a list that consists of even numbers that are squared:
list_2 = [i**2 for i in range(10) if i%2==0]

#Print result:
print(list_2)
# Alternative code for Example 2 #

#Create a list to store values:
ls_2 = []


#Loop through every value in a sequence:
for num_2 in range(10):
    
    #Control if the current value is an even number:
    if(num_2%2==0):
        
        #Store the squared value in the list:
        ls_2.append(num_2**2)

    
#Print result:
print(ls_2)
# Example 3 #

#Create lists:
list_a = [10, 30, 50, 70]
list_b = [20, 40, 60, 80]

#Create a list storing the sum of every item in a list with every separate item in another list:
list_3 = [i1+i2 for i1 in list_a for i2 in list_b]

#Print result:
print(list_3)
# Alternative code for Example 3 #

#Create a list to store values:
ls_3 = []


#Loop through every item in list_a:
for i_1 in list_a:
    
    #Loop through every item in list_b:
    for i_2 in list_b:
        
        #Add the sum of the current values of i_1 and i_2 to the list:
        ls_3.append(i_1+i_2)

    
#Print result:
print(ls_3)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07954485406795483, 'fraction_numerical': 0.010304193894985292, 'mean_word_length': 4.273943334881561, 'pattern_counts': {'":': 36, '<': 184, '<?xml version=': 0, '>': 186, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '44', 'dir': 'jupyter-structured-clean-dedup', 'id': '390097', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 16572, 'n_tokens_neox': 15911, 'n_words': 7470, 'path': 'introduction/QuickstartToPythonENG.ipynb', 'repo_name': 'ZWsourcecode/jupyter_icos_edu', 'size': '56773'}