Skip to content
Advertisement

Tag: subset

Selecting rows based on condition in python pandas

I have a data-frame with columns as [‘ID’,’Title’,’Category’,’Company’,’Field’] and it has both blank values and at some places missing values are put as N/A. I have to pick the row which has maximum information available. For example one case could be. In this case i want to select the row number 2 as it has maximum information available. I tried

Splitting a dataframe with many labels

I’m trying to split my data by different labels, like this: And this works fine for small amounts of numbers. However, I want to do this for many values. for example: This spits outs an error: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). I’ve read the other questions with this error,

Advertisement