Flat map on GraphLab Create SDK

User 942 | 6/12/2015, 3:46:47 PM

Hello,

I am trying to port a python code to C++ using the SDK. I couldn't find the flat map function defined in the python SFrame.

My problem is the following:

I have a SArray of flex_list containing pairs of nodes like this:

gl_sarray arr = [
	[[1,2], [3, 4]], 
	[[4, 8]],
	...
]

I want to unpack them to create a new graph. What is the most efficient way to do this? In my python version I used flat_map.

Thanks

Comments

User 1207 | 6/15/2015, 9:45:45 PM

Hi kikohs,

Calling stack() followed by unpack() should give you what you are looking for.

-- Hoyt


User 942 | 6/16/2015, 9:06:37 AM

Awesome, thanks !