【发布时间】:2017-04-15 12:20:30
【问题描述】:
我正在处理 pyspark 中的数据框。我有数据框 df 和列 col_1 ,它是数组类型并且也包含数字。
是否有内置函数可以从此字符串中删除数字?
数据框架构:
>>> df.printSchema()
root
|-- col_1: array (nullable = true)
| |-- element: string (containsNull = true)
列中的示例值:
>>>df.select("col_1").show(2,truncate=False)
+-------------------------------------------------------------------------------+
|col_1
+-------------------------------------------------------------------------------+
|[use, bal, trans, ck, pay, billor, trans, cc, balances, got, grat, thnxs] |
|[hello, like, farther, lower, apr, 11, 49, thank]|
+-------------------------------------------------------------------------------+
在这种情况下,我正在寻找可以从第二行去除数字 11、49 的函数。谢谢你。
【问题讨论】:
标签: python numbers pyspark strip pyspark-sql