英文:
I get this error when I try to convert a list from a Snowpark df to a Pandas df: AttributeError: 'list' object has no attribute 'to_pandas'
问题
这是我用来创建(通过追加)列表的循环:
results=[]
for col in df_col:
results.append(col['COLUMN_NAME'])
print(results)
当我尝试运行以下代码:
results = results.to_pandas()
我收到这个错误:AttributeError: 'list' object has no attribute 'to_pandas'
英文:
Here's the loop I use to create (via appending) to my list:
results=[]
for col in df_col:
results.append(col['COLUMN_NAME'])
print(results)
When I try to run the following code:
results = results.to_pandas()
I get this error: AttributeError: 'list' object has no attribute 'to_pandas'
答案1
得分: 0
你的 results
是一个 list
。
List 没有属性 to_pandas
。
如果你想将你的 snowpark dataframe 转换成 pandas,你可以:
pandas_df = snowpark_df.to_pandas()
英文:
Your results
is a list
.
List has no attribute 'to_pandas'
.
If you want to convert your snowpark dataframe to pandas then you can:
pandas_df = snowpark_df.to_pandas()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论