发布于 2018-09-25 14:40:35
只显示前五行是典型的pd.Dataframe.head()用法,我认为它是在您的函数executeQueryAndShowResults中调用的,您没有显示它。通常,jupyter notebook打印完整的数据帧(即)所有行,只需键入数据框名并执行单元即可。
我建议调整您的函数以返回如下所示的数据帧
def executeQueryAndShowResults(query):
# executing query ...
# Here is written what is coded in your function body...
# df.head() # I assume/claim that there is a statement like this printing the first five rows of the dataframe. Comment this
return df # Instead, Return the dataframe在Jupyter Notebook中,像这样调用您的函数
df1 = executeQueryAndShowResults(query) # saving returned dataframe
df1 # printing returend dataframehttps://stackoverflow.com/questions/52488078
复制相似问题