Closed
Description
I ran into the following :
import pandas as pd
data = {}
columns = ['symbol', 'price']
df = pd.DataFrame(data, columns=columns)
df.symbol == 'AAPL'
# TypeError: Could not compare <type 'str'> type with Series
The problem being that an empty dataframe's dtype defaults to float. I've adjusted for it by checking the len of data and setting the dtype to object when at 0. But I feel like an empty DataFrame should act like an empty list, valid for all list operations. Which in lieu of #549, means casting the widest net possible with dtype=object.