小编Adi*_*pta的帖子

How to use pandas datafames in weka wrapper instead of arff files?

I am new to this weka wrapper and trying to apply the attribute selection algorithm on my panda's data frame bowDataFrame. Please help. `

jvm.start(packages=True)
search = ASSearch(classname="weka.attributeSelection.BestFirst", options=["-D", "1", "-N", "5"])
evaluator = ASEvaluation(classname="weka.attributeSelection.CfsSubsetEval", options=["-P", "1", "-E", "1"])
print("We are here")
attsel = AttributeSelection()
attsel.search(search)
attsel.evaluator(evaluator)
attsel.select_attributes(bowDataFrame)`
Run Code Online (Sandbox Code Playgroud)

python weka

5
推荐指数
0
解决办法
103
查看次数

无法安装 python-docx (MacOS)

我正在尝试安装docx包。但得到以下信息ImportError

ImportError: cannot import name Document

因此,按照此处的建议,我尝试了:

pip install python-docx 但出现以下错误(python版本:2.7.15)

..
..
..

    creating build/lib/docx/templates
    copying docx/templates/default-header.xml -> build/lib/docx/templates
    copying docx/templates/default-settings.xml -> build/lib/docx/templates
    copying docx/templates/default-footer.xml -> build/lib/docx/templates
    error: can't copy 'docx/templates/default-docx-template': doesn't exist or not a regular file 
    Command 

 /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import  

setuptools,tokenize;__file__='/private/var/folders/0c/v_yb4q7n2h3fg94rlfrr165r0000gn/T/pip-build-ks26RP/python-docx/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n',  

'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/0c/v_yb4q7n2h3fg94rlfrr165r0000gn/T/pip-1SQvtb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/0c/v_yb4q7n2h3fg94rlfrr165r0000gn/T/pip-build-ks26RP/python-docx/
Run Code Online (Sandbox Code Playgroud)

python macos importerror python-2.7 python-docx

5
推荐指数
1
解决办法
2874
查看次数

标签 统计

python ×2

importerror ×1

macos ×1

python-2.7 ×1

python-docx ×1

weka ×1