This structure is part of a vastly larger project, but I can't seem to figure out how the lambda portion of this works:
for num in range(1,100):
dataframe[f'n{num}_bins'] = dataframe[f'n{num}'].apply(
lambda x: 0 if x < 1
else 1 if x < 2
else 2 if x < 3
else 3 if x < 4
else 4 if x < 5
else 5 if x < 6
else 6
What does lambda check for, exactly?