how to retrieve a column from pyspark dataframe and and insert it as new column within existing pyspark dataframe?
问题 The problem is: I've got a pyspark dataframe like this df1: +--------+ |index | +--------+ | 121| | 122| | 123| | 124| | 125| | 121| | 121| | 126| | 127| | 120| | 121| | 121| | 121| | 127| | 129| | 132| | 122| | 121| | 121| | 121| +--------+ I want to retrieve index column from df1 and insert it in the existing dataframe df2 ( with same lengths). df2: +--------------------+--------------------+ | fact1| fact2| +--------------------+--------------------+ | 2.4899928731985597|-0