I've a spark dataframe where a fixed array or list is to be added in a new column.
(我有一个火花数据框,其中将固定数组或列表添加到新列中。)
Hours = ['hr01', 'hr02', 'hr23', 'hr24']
This list is to be added as a new column "Hours" in existing dataframe, please help with the pyspark syntax.
(此列表将作为现有数据框中的新列“小时”添加,请使用pyspark语法。)
Dataframe should look as :
(数据框应如下所示:)
id | Date | Hours
1 | 2019-12-01 | ['hr01', 'hr02', 'hr23', 'hr24']
2 | 2019-12-01 | ['hr01', 'hr02', 'hr23', 'hr24']
.
(。)
. (。)
. (。)
ask by learner translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…