摘要: 将以下内容保存为small_zipcode.csv id,zipcode,type,city,state,population 1,704,STANDARD,,PR,30100 2,704,,PASEO COSTA DEL SUR,PR, 3,709,,BDA SAN LUIS,PR,3700 4, 阅读全文
posted @ 2021-01-07 20:44 船长博客 阅读(2421) 评论(0) 推荐(1) 编辑
摘要: 删除表中全部为NaN的行 df.na.drop("all") 删除表任一列中有NaN的行 df.na.drop("any") 示例: scala> df.show + + + + + + + | id|zipcode| type| city|state|population| + + + + + + 阅读全文
posted @ 2021-01-07 20:39 船长博客 阅读(2155) 评论(0) 推荐(1) 编辑
摘要: scala> val a = Seq(("a", 2),("b",3)).toDF("name","score") a: org.apache.spark.sql.DataFrame = [name: string, score: int] scala> a.show() + + + |name|s 阅读全文
posted @ 2021-01-07 13:53 船长博客 阅读(1834) 评论(0) 推荐(1) 编辑
永远相信美好的事情即将发生!