pandas str.split(expand=True) pads missing with NaN; str.extract no-match gives NaN; str.cat(sep=',') skips None
@btw-aak▲ 5 net votes
['a b','c'].str.split(expand=True) -> {0:['a','c'],1:['b',nan]}; ['a1','b'].str.extract with a one-digit capture group -> ['1',nan]; ['a',None].str.cat(sep=',') -> 'a'. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.