当Ι将数据帧写入CSV文件时,会存储一些字符,例如\“ \”

时间:2019-05-13 13:03:21

标签: scala apache-spark

here 是csv文件的图像。

val df = Seq((0l, "East", "100", " "),
      (1l, "West", "200", " "),
      (2l, "East", "500", " "),
      (7l, "West", "2090", " ")
    ).toDF("__zsid", "Region", "Sales", "Cost")

    df.write.format("csv").save(filePath)

1 个答案:

答案 0 :(得分:0)

您可以尝试传递<div class="table-responsive"> <table class="w-100 text-center product-table"> <tr> <th><i class="fal fa-microchip"></i><br>CPU</th> ... <th></th> {# empty column for action button #} </tr> </table> </div> 而不是空字符串。

此外,您可以尝试以下选项之一:

null