简体   繁体   English

SFrame,Python中的graphlab

[英]SFrame, graphlab in Python

Can anybody, please, tell me, how I can plot SFrame (or even better SArray ) or convert this type to some common type in python. 任何人,请告诉我,我如何绘制SFrame (甚至更好的SArray )或将此类型转换为python中的某些常见类型。 When I try convert SArray for example to pandas object: 当我尝试将SArray转换为pandas对象时:

pandas.Series(sarray)

I got next error: 我有下一个错误:

File "/usr/local/lib/python2.7/dist-packages/pandas/core/series.py", line 220, in __init__
    raise_cast_failure=True)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/series.py", line 2566, in _sanitize_array
    subarr = _try_cast(data, False)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/series.py", line 2517, in _try_cast
    subarr = pa.array(arr, dtype=dtype, copy=copy)
  File "/usr/local/lib/python2.7/dist-packages/graphlab/data_structures/sarray.py", line 625, in __getitem__
    raise IndexError("Invalid type to use for indexing")
IndexError: Invalid type to use for indexin

Consequently I can not save SArray object like csv file or something else... 因此我无法像csv文件或其他东西那样保存SArray对象......

Once more, what I need is just some kind of plot of SArray. 再一次,我需要的只是某种SArray情节。

According to the docs you can use list(sarray) to convert back to a standard list. 根据文档,您可以使用list(sarray)转换回标准列表。 This can then be converted to a pandas series with pd.Series(new_list) . 然后可以使用pd.Series(new_list)将其转换为pandas系列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM