In my opinion it's not zip that matters.
df['full_name']=zip(df['name'],df['last name'])
The element in the column full_name
are tuples.
df['full_name']=df['name']+ " " + df['last name']
If you write this, the element in the column full_name
are strings.
Strings are better for showing and printing, but some information about its structure is lost.
For example, if name is "A"
and last name is "B C"
, if join them with a space, it will be "A B C"
. It's OK for human, but for machines, it can not tell if it was "A"
"B C"
or "A B"
"C"
, as "structure info" is lost as I said.
So which one to choose depends on your purpose.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…