The*_*tor -3 python list python-3.x
我有一个看起来像这样的列表:
{
'J2EE': 0.0202219636,
'financial': 0.2439565346,
'Guru': 0.0202219636,
'AWS': 0.0202219636,
'next generation': 0.12072663160000001,
'Machine Learning': 0.2025762767,
'technology': 0.066936981
}
Run Code Online (Sandbox Code Playgroud)
如何仅提取文本部分并使我的列表看起来像:
['J2EE', 'financial', 'Guru', 'AWS', ...]
Run Code Online (Sandbox Code Playgroud)
我应该使用正则表达式吗?
小智 5
你有什么是字典,而不是列表,你想要的是键:
your_dict = {'J2EE': 0.0202219636, 'financial': 0.2439565346, 'Guru': 0.0202219636, 'AWS': 0.0202219636, 'next generation': 0.12072663160000001, 'Machine Learning': 0.2025762767, 'technology': 0.066936981}
your_dict_keys = your_dict.keys()
Run Code Online (Sandbox Code Playgroud)