Q:

Multiple string selection with specific parameter

I am trying to do a multiple selection and modification on a column of dates. The dates are converted in string for other applications. 
Right now i want to select all dates that are in year 1900 using df.loc[]. 
Dates are in format mm/dd/yyyy (still strings tho)
So my try : 
df.loc[df['Trade Date'][-4:]=='1900']=1

Raise this error : 

IndexingError('Unalignable boolean Series key provided')
  pandas.core.indexing.IndexingError: Unalignable boolean Series key provided

Is it possible ? 
Or do i have to iterate with a df.get_value()

A:

It looks like you want to slice the string, to do this use .str:
df.loc[df['Trade Date'].str[-4:]=='1900']=1

depending on what you really intending to do it may make more sense to convert to datetime:
df['Trade Date'] = pd.to_datetime(df['Trade Date'])

then you can do:
df.loc[df['Trade Date'].dt.year == 1900]=1

using datetime makes more sense as numerical operations will just work whilst keeping the data as strings is not as easy to work with

