I am new to python and struggling in one trivial task. I have one alphanumeric column known as region. It has both entries beginning with / such as /health/blood pressure etc and integer values. So typically few observations look like:
/health/blood pressure
/health/diabetes
7867
/fitness
9087
/health/type1 diabetes
Now I want to remove all the rows/cases with integer values. So after importing the data set into python shell, it is showing region as object. I intended to solve this problem with a sort of regular expression. So I did the following:
pattern='/'
data.region=Series(data.region)
matches=data.region.str.match(pattern)
matches
Here it gives a boolean object explaining whether each pattern is in the data set or not. So I get something like this:
0 true
1 false
2 true
3 true
.........
so on.
Now I am stuck further how to remove rows of matches boolean object with false tag. If statement is not working. If anyone can offer some sort of assistance, that would be great!!
Thanks!!
data[matches]