阿帕奇齐柏林飞艇

2024-06-09 05:53:51 发布

您现在位置:Python中文网/ 问答频道 /正文

ApacheZeppelin(版本0.6.1)上的以下代码

%python
import pandas as pd
del(listResult)
listResult = list(collection.distinct("species",{"yr": yrs,"species":{"$ne":""}}))
df =  pd.DataFrame(listResult,columns=['Species sighted and/or captured this year'])
z.show(df)

只适用于我第一次点击“运行所有段落”。 之后,如果我运行该段落,将出现以下错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 27, in show
  File "<stdin>", line 32, in show_dataframe
TypeError: 'list' object is not callable

它只在我重新启动python解释器时才起作用。你能帮我了解发生了什么事吗? 谢谢!你知道吗


Tags: 代码inimport版本dfshowstdinline