I would do something along these lines: frames = [] for contour_id, contour in enumerate(contours): current_frame = pd.DataFrame(contour, columns={'row', 'column'}) current_frame['contour'] = contour_id # creates column with repeated value frames.append(current_frame)
full_data = pd.concat(frames) On Fri, Apr 20, 2018, at 1:22 PM, Matteo wrote: > I am using a modified version of this scikit-image demo[1] to create > contours from the edges resulting from watershed segmentation of an > image. I would like to save the resulting contours in a spreadsheet, > not an image, to take into a GIS package (although I do save image for > another application).> I am trying to use Pandas DataFrames as described in > this > StackOverflow question: > https://stackoverflow.com/questions/49930616/how-to-store-scikit-image-contours-in-a-pandas-dataframe-with-a-single-vertex-an> > > > But I wonder if there's an easier way I overlooked. > Thanks, > Matteo > > -- > You received this message because you are subscribed to the Google > Groups "scikit-image" group.> To unsubscribe from this group and stop > receiving emails from it, > send an email to scikit-image+unsubscr...@googlegroups.com.> To post to > this group, send email to scikit-image@googlegroups.com. > To view this discussion on the web, visit > > https://groups.google.com/d/msgid/scikit-image/674b51dc-b8b9-48d5-8f5e-e62f41e919cd%40googlegroups.com[2].> > For more options, visit https://groups.google.com/d/optout. Links: 1. http://scikit-image.org/docs/dev/auto_examples/edges/plot_contours.html 2. https://groups.google.com/d/msgid/scikit-image/674b51dc-b8b9-48d5-8f5e-e62f41e919cd%40googlegroups.com?utm_medium=email&utm_source=footer -- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscr...@googlegroups.com. To post to this group, send an email to scikit-image@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/scikit-image/1524210517.2505812.1344612472.2E66FF28%40webmail.messagingengine.com. For more options, visit https://groups.google.com/d/optout.