You're trying to compare a df, which is unnecessary here by the way, with a scalar value which is incorrect as it becomes ambiguous for testing a scalar value against because you may have 1 or more matches. I think you want: if all(stock['Whs']] == 'VLN'): or if you know...
python,python-2.7,pandas,hashlib,pandasql
hashlib.md5 takes a single string as input -- you can't pass it an array of values as you can with some NumPy/Pandas functions. So instead, you could use a list comprehension to build a list of md5sums: ob['md5'] = [hashlib.md5(val).hexdigest() for val in ob['ssno']] ...
In [22]: pd.set_option('max_rows',20) In [33]: N = 10000000 In [34]: df = DataFrame({'A' : np.random.randint(0,100,size=N), 'B' : np.random.randint(0,100,size=N)}) In [35]: df[df.groupby('A')['B'].transform('max') == df['B']] Out[35]: A B 161 30 99 178 53 99 264 58 99 337 96 99 411 44 99 428 85 99 500 84 99 598 98 99...