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'

huangapple go评论64阅读模式
英文:

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()

huangapple
  • 本文由 发表于 2023年4月11日 14:10:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/75982851.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定