qq_41563729 2018-01-11 03:07 采纳率: 0%
浏览 13544
已结题

python 错误:AxisError: axis -1 is out ……

pthon代码出现如下问题,不知道是何原因?谢谢!!!
runfile('D:/Python project/3Olive-lda2vec-master/examples/twenty_newsgroups/data/preprocess.py', wdir='D:/Python project/3Olive-lda2vec-master/examples/twenty_newsgroups/data')
Traceback (most recent call last):

File "", line 1, in
runfile('D:/Python project/3Olive-lda2vec-master/examples/twenty_newsgroups/data/preprocess.py', wdir='D:/Python project/3Olive-lda2vec-master/examples/twenty_newsgroups/data')

File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
execfile(filename, namespace)

File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "D:/Python project/3Olive-lda2vec-master/examples/twenty_newsgroups/data/preprocess.py", line 35, in
corpus.finalize()

File "D:\Python project\3Olive-lda2vec-master\lda2vec\corpus.py", line 155, in finalize
self.keys_loose, self.keys_counts, n_keys = self._loose_keys_ordered()

File "D:\Python project\3Olive-lda2vec-master\lda2vec\corpus.py", line 104, in _loose_keys_ordered
specials = np.sort(self.specials.values())

File "C:\Anaconda3\lib\site-packages\numpy\core\fromnumeric.py", line 822, in sort
a.sort(axis=axis, kind=kind, order=order)

AxisError: axis -1 is out of bounds for array of dimension 0

  • 写回答

3条回答 默认 最新

  • oyljerry 2018-01-11 03:08
    关注

    : axis -1 is out of bounds for array of dimension 0
    你的axis变量中有-1,越界了

    评论

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试