目標:將df.apply函數的多個返回值賦值到df的多個列中
代碼:
先看返回值包含多列,如下:
df1['RFRV'].apply(get_need)
首先將這些多列放到df的一列中,再拆分爲四列,如下:
df1['text'] = df1['RFRV'].apply(get_need)
df1[['complexity','comple_ci','num_ci','count']] = df1['text'].apply(pd.Series)
目標:將df.apply函數的多個返回值賦值到df的多個列中
代碼:
先看返回值包含多列,如下:
df1['RFRV'].apply(get_need)
首先將這些多列放到df的一列中,再拆分爲四列,如下:
df1['text'] = df1['RFRV'].apply(get_need)
df1[['complexity','comple_ci','num_ci','count']] = df1['text'].apply(pd.Series)
鍵盤改造 🥋 回憶上次內容 上次練習了複製粘貼 按鍵 作用 <kb