Class 2 notes
Contents
Class 2 notes¶
Geo-Python concepts to review¶
forloopsfunctions
When to use which brackets in Python
(), [], {}
Ideas for Part 2¶
Mining data from tables in PDF documents
Mining graphs from literature, reconstructing them and plotting our data.
Classes in Python
Introduce the basic ideas and provide a simple example
# Calculating temperature in C from F
temp_f = 68.0
temp_c = (temp_f - 32) * (5/9)
print(temp_c)
20.0
# Calculating temperature in C from F in a function
def fahr_to_celsius(tempF):
tempC = (tempF - 32) * (5/9)
return tempC
# Passing in a variable with a different name than used in the function
temp_celsius = fahr_to_celsius(temp_f)
print(temp_celsius)
20.0