I want to do something equivalent to
Select x,y,z from data where f(x, Y);
And f is my customized function that looks into the values of specific columns in a row and returns True or False. I tried the following:
df = df.ix[_is_detection_in_window(df['Product'], df['CreatedDate'])== True]
But I get
TypeError: 'Series' objects are mutable, thus they cannot be hashed
I think it does not iterate over the rows. I also tried:
i = 0
for index, row in df.iterrows():
if _is_detection_in_window(row['Product'], row['CreatedDate']):
print 'in range '
new_df.iloc[i] = row
i+= 1
df = new_df
but I get :
IndexError: single positional indexer is out-of-bounds