Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python中近乎意外的错误_Python_Matplotlib_Nlp - Fatal编程技术网

python中近乎意外的错误

python中近乎意外的错误,python,matplotlib,nlp,Python,Matplotlib,Nlp,我正在用python进行NLP,遇到了matplot库中的2个函数。plot和.u plot。我在运行它时遇到了以下错误 :~$ fdist1.plot( 50 , cumulative = True) bash: syntax error near unexpected token `50' ~$ text4.dispersion_plot(["citizens","democraacy","freedom","duties","America"]) bash: syntax error ne

我正在用python进行NLP,遇到了matplot库中的2个函数。plot和.u plot。我在运行它时遇到了以下错误

:~$ fdist1.plot( 50 , cumulative = True)
bash: syntax error near unexpected token `50'
~$ text4.dispersion_plot(["citizens","democraacy","freedom","duties","America"])
bash: syntax error near unexpected token `["citizens","democraacy","freedom","duties","America"]'

我已经通过pip安装了matplotlib并运行了Ubuntu14.04LTS,我是python新手,所以有人可以给我提供python中NLP的快速参考。

请确保启动python解释器:

→ python < --------- bash prompt
Python 2.7.8 (default, Jul  3 2014, 16:35:39)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> < -------- python interpreter
→ python<-----------bash提示符
Python 2.7.8(默认值,2014年7月3日,16:35:39)
[GCC 4.2.1达尔文兼容苹果LLVM 5.1(clang-503.0.40)]
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
>>><----python解释器

您是在bash(终端)提示符下输入代码,而不是在Python解释器提示符下。