dictionary - 如何分离元组、字典和列表
问题描述
我有一个通过加入其他 rdd 形成的 rdd。由于我添加它的方式,它的方式很混乱。它具有以下形式:
('string',
([array],
{'string',
'string'}))
所以当我做 bc.first() 时它看起来像这样
('o9eMRCWt5PkpLDE0gOPtcQ',
(['Italian', 'Restaurants'],
{'Traumhaft. \nGemütlich und absolutes Spitzenniveau. \nMan kommt einfach an.\n\nDas Konzept ist wenig Produkte, dafür alles frisch und in Topqualität. \n\nDer Gruß aus der Küche war schon genial, das Foccacia und die Creme spitze. \n\nVorspeise und Hauptgerichte ein Traum.',
'yJqCuWgVBBtFP6nGp6T1jw'}))
基本上我正在寻找的是
('string',
array,
'string',
'string')
对不起,如果这是模棱两可的,如果需要,我可以澄清。我对这种东西很陌生。
我已经研究过使用平面地图,但这对我不起作用。
解决方案
推荐阅读
- c# - 自动更新 Azure 身份验证的最佳方法是什么?
- c# - 异步/等待在方法结束时抛出异常
- webpack - Webpack 将一些文本注入站点
- c++ - QtCreator 如何识别正在使用的覆盖?
- protobuf-java - 将 protobuf 转换为其他 protobuf
- swift - Swift 枚举值不可设置
- sql - 正则表达式解析至少 20 个字符文本,字符串中没有空格
- java - 如何将带有句点(。)的 xml 标记转换为 jaxb 变量
- reactjs - Visual Studio 2017(不是 VS Code)中的 React (jsx) 支持
- javascript - 如何在页面加载时生成随机数?