Saturday, 17 August 2013

How to conditionally select items from a pandas Series

How to conditionally select items from a pandas Series

I am using a Pandas Series which consists of lists of numbers, with words
as the index:
$10 [1, 0, 1, 1, 1, 1, 1]
$100 [0, 0, 0]
$15 [1]
$19 [0, 0]
$1? [1, 1]
$20 [0, 1, 1]
$20-$40 [0]
I am trying to write some simple code which creates a new series which
only includes items which contain a list of length 'n' or greater.
A bit like list comprehension for series.
Thanks for any help

No comments:

Post a Comment