【发布时间】:2021-11-12 00:55:08
【问题描述】:
我有元组:
wordsTuple = [(('431949',['python',
'print',
'hellow',
'world',
'at',
'py',
'file',
...]
我想把它改成[(python, 1), (print, 1) ...]。我如何只使用 PySpark 中的一行代码或某些功能来实现这一点?
counts = wordsTuple._________________
【问题讨论】:
-
您能清楚地说明您的
wordsTuple的样子吗?它只是tuple的tuple或list吗?描述显示不同的格式,而标题显示不同 -
请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。
标签: python pyspark word-count