I want to do something equivalent to
Select x,y,z from data where f(x, Y);
df = df.ix[_is_detection_in_window(df['Product'], df['CreatedDate'])== True]
TypeError: 'Series' objects are mutable, thus they cannot be hashed
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
df = new_df
IndexError: single positional indexer is out-of-bounds
It seems like your function doesn't accept
Series, but that can be changed using
v = np.vectorize(_is_detection_in_window) df = df.loc[v(df['Product'], df['CreatedDate'])]
Furthermore, you should refrain from using
.ix which is now deprecated as of v20.