Distribution Plot
num = 3
if num > 0:
print(num, "is a positive number.")
elif: #else if
print(num, "is a negative number.")
else:
print("This is always printed.") #return line has no indentation
# iterate over the list
numbers = [6, 5, 3, 8, 4, 2]
sum = 0
for #i in numbers:
sum = sum + i
print("The sum is", sum) #output: The sum is 28
for #i in range(#start, #end):
sum = sum + i
print("The sum is", sum) #output: The sum is 28
for #i , #list in enumerate(#list):
sum = sum + i
while i <= n:
sum = sum + i
i = i+1 # update counter
print("The sum is", sum)
pass
statement is used for empty function or loop #return Nonedef print_lines():
print("#line1")
print("#line2")
return #x
#function call
print_lines()
numbers = (1, 2, 3, 4)
result = map(lambda #function e.g. x: x*x, #variables e.g numbers) #map is like sapply in R (apply function to each element); lambda is a temporary unnamed function
print(result)
# converting map object to set
numbersSquare = set(result)
print(numbersSquare)
#Obtain geojson
#Create point and label
#Add clusters
#Create choropleth map