Is there a way to apply the lambda statement without having to compute the x.split(' ')[0] twice? I know it can be done using a function i.e. .apply(lambda x: pre_dir(x) and take care of the logic there, but wondering if it can be done in a one-liner.
address.insert(6, 'PRE_DIR', address['STREETNAME'].apply(lambda x: x.split(' ')[0] if x.split(' ')[0] in ['N', 'S', 'E', 'W'] else ''))