[英]How to join two Series type object and make another column in Data Frame
df['SAMPLE_GAS'] = df['NAME'].str.cat(df['SAMPLING_POINT'], sep=' ')
要么,
df['SAMPLE_GAS'] = [x + ' ' + y for x, y in zip(df['NAME'], df['SAMPLING_POINT'])]
為了表現。
根據您的輸出,您只需添加字符串,
df['SAMPLE_GAS'] = df['NAME'] +' '+ df['SAMPLING_POINT']
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.