我想将此数据框转换为列表列表
Year Sales Expenses Profit
2014 1000 400 200
2015 1170 460 250
2016 660 1120 300
2017 1030 540 350
Run Code Online (Sandbox Code Playgroud)
这是预期的输出
[
['Year', 'Sales', 'Expenses', 'Profit'],
['2014', 1000, 400, 200],
['2015', 1170, 460, 250],
['2016', 660, 1120, 300],
['2017', 1030, 540, 350]
]
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 spacy,noun_chunks但它抛出了一个错误。我下载了模型
python -m spacy download en_core_web_sm
AttributeError: 'English' object has no attribute 'noun_chunks'
NLP = spacy.load('en_core_web_sm')
NOUN_CHUNKS = NLP.noun_chunks
Run Code Online (Sandbox Code Playgroud)