小编Pou*_*ria的帖子

在jupyter ipython笔记本上导入pandas失败

我能够在spyder ide中导入pandas包; 但是,如果我尝试打开一个新的juypter笔记本,导入失败.

我在MAC OS X上使用Anaconda软件包分发.

这是我做的:

In [1]: import pandas 
Run Code Online (Sandbox Code Playgroud)

这是我得到的回应:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-5-97925edf8fb0> in <module>()
----> 1 import pandas

//anaconda/lib/python2.7/site-packages/pandas/__init__.py in <module>()
     11                       "pandas from the source directory, you may need to run "
     12                       "'python setup.py build_ext --inplace' to build the C "
---> 13                       "extensions first.".format(module))
     14 
     15 from datetime import datetime

ImportError: C extension: hashtable not built. If you want to import pandas from the source directory, you may need …
Run Code Online (Sandbox Code Playgroud)

python ipython pandas anaconda jupyter

4
推荐指数
2
解决办法
2万
查看次数

TypeError: __init__() 采用 1 个位置参数,但给出了 4 个

class voting():
    number = 0
    name   = ""
    surfer = ""

    def __init__(self, num, na, surf):
        self.number = num
        self.name   = na
        self.surfer = surf

    def save_surfer(self):
        file = open("Surfer_list.txt", "a")
        file.write("%07s%16s%16s\n" % (self.number, self.name, self.surfer))
        file.close()

class judge():

    def __init__(voting):
        voting.__init__(self, num, na, surf)

    def save(self):
        file = open("Surfer_list.txt", "a")
        file.write("%07s%16s%16s\n" % (self.number * 11, self.name,     self.surfer))
        file.close()


surf   = ["Jonny Johns", "Juan Martino", "Joseph Smith", "Stacey O'Neill"]
num  = [1, 2, 3, 4]
running = True

while running: …
Run Code Online (Sandbox Code Playgroud)

python

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

标签 统计

python ×2

anaconda ×1

ipython ×1

jupyter ×1

pandas ×1