Tuple unpacking assigns the elements of an iterable to multiple variables in one assignment. When a filename is split into a city and state, the two resulting strings can be captured directly. section 7.2
Extracting location fields from a filename
The filename `new+york,ny.csv` becomes two values after its path, suffix, and delimiter are removed. Tuple unpacking assigns them to `city` and `state`; later string methods normalize the values before adding them to a DataFrame. section 7.2
city, state = (
one_filename
.removeprefix('../data/')
.removesuffix('.csv')
.split(',')
)
This compact expression shows the complete transformation from filename to two named variables. section 7.2


