from datetime import datetime


def col2datetime(df, col, datestr='%m/%d/%Y %H:%M'):
    """
    Converts date strings in a DataFrame to datetime objects
    
    Args:
        df - a pandas DataFrame
        col - the column name in df that contains the date strings
        datestr - a string that encodes the formatting of the datetime strings
                  see python's documentation for datetime to see how these
                  strings are formatted
    
    Returns:
        The DataFrame with all date strings in df[col] converted to datetime objects
    """
    for idx in df.index:
        d = df[col][idx]
        df[col][idx] = datetime.strptime(d, datestr)
    return df