这是一个非常奇怪的错误:
以下代码:
a = 'string1'
b = 'string2'
test_dict = {'col1':{a:type(a), b:type(b)},'col2':{a:type(a), b:type(b)}}
pd.DataFrame(test_dict)
在普通的 ipython 控制台中,会按预期产生以下内容:
col1 col2
string1 <type 'str'> <type 'str'>
string2 <type 'str'> <type 'str'>
但是在 ipython notebook 中,应该显示类型的单元格是空的:
请您参考如下方法:
我怀疑如果您在浏览器中执行 View->Source,您将看到预期的
注意:如果我没有在这个答案中输入 <type ...>,我的答案也会发生同样的事情。
