我在这个pyspark命令进出的列中有空格:
results2 = results.select( cast("`HCAHPS Base Score`" as int), `HCAHPS Base Score`, cast("HCAHPS Consistency Score" as int) `HCAHPS Consistency Score` )
我在第一个开始时得到一个SyntaxError作为int(在as之前)。
答案 0 :(得分:0)
在pyspark中投射就像是,
results2 = results.select( results['HCAHPS Base Score'].cast(IntergerType()),results['HCAHPS Consistency Score'].cast(IntegerType()))