1What tool is commonly used to manage Python environments for scientific computing?
Miniconda
2What is the purpose of creating a virtual environment in Python?
To isolate dependencies and avoid conflicts between projects
3What command activates a Conda environment named atmopy?
conda activate atmopy
4What does the 'if' statement do in Python?
It runs a block of code only if a specified condition is true
5What type of loop runs while a condition is true?
while loop
6What type of loop runs over items in a list or range?
for loop
7What is a Python function?
A reusable block of code that performs a specific task
8How do you define a function in Python?
Using the def keyword
9What are variables in Python?
Containers that store data values
10What are the three basic Python data types?
int, float, and str
11What is a list in Python?
An ordered collection of items that can be changed
12What is a tuple in Python?
An ordered collection of items that cannot be changed
13What is a dictionary in Python?
A collection of key-value pairs
14What is a Python script?
A file containing Python code that can be run as a program
15What is a docstring?
A string placed at the beginning of a function or module that describes what it does
16Why are docstrings useful?
They help document code and show up in help() and IDE tooltips
17What does PEP8 refer to?
The official style guide for writing Python code
18What is a modular script?
A script designed with separate, reusable components or functions
19How do you write a comment in Python?
With a # symbol at the beginning of the line
20How do you get input from a user in Python?
Using the input() function
21How do you write code that calculates the average 2-meter temperature across all times and locations?
t2m.mean()
22How do you write code that finds the hour with the strongest average wind speed across a grid?
np.argmax(np.sqrt(u10**2 + v10**2).mean(axis=(1,2)))
23How do you write code that calculates total daily precipitation from hourly values in a 3D array?
tp.sum()
24How do you write code that finds the gridpoint with the maximum surface pressure?
np.unravel_index(np.argmax(sp), sp.shape)
25How do you write code that filters for all humidity values above 70%?
humidity[humidity > 70]
26How do you write code that converts a temperature array from Kelvin to Celsius?
t2m - 273.15
27How do you write code that creates a function to convert m/s to km/h for a NumPy array?
def ms_to_kmh(arr): return arr * 3.6
28How do you write code that calculates wind speed from u and v components?
np.sqrt(u10**2 + v10**2)
29How do you write code that calculates wind direction (meteorological) from u and v components?
np.arctan2(-u10, -v10) * 180 / np.pi
30How do you write code that returns the average wind speed for each hour in a 3D array?
np.sqrt(u10**2 + v10**2).mean(axis=(1,2))
31How do you write code that finds all time steps with total precipitation > 10 mm?
np.where(tp.sum(axis=(1,2)) > 10)
32How do you write code that averages temperature across time but keeps lat/lon structure?
t2m.mean(axis=0)
33How do you write code that averages temperature across lat/lon to get a time series?
t2m.mean(axis=(1,2))
34How do you write code that labels high cloud cover (>60%) as 'cloudy' and others as 'clear'?
np.where(cloud > 60, 'cloudy', 'clear')
35How do you write code that builds a reusable function to calculate average humidity?
def avg_humidity(arr): return arr.mean()
36How do you write code that documents a function that returns max wind and the hour it occurs?
def max_wind(ws): """Return max wind and time index."""; return ws.max(), np.argmax(ws)