# np.where(condition, value if condition is true, value if condition is false) df['hasimage'] = np.where(df['photos']!= '[]', True, False) df.head()