Issue 1:
Code Sample, a copy-pastable example if possible

import pandas as pd
import datetime as dt

# only one row
s = pd.DataFrame(columns=['a', 'b', 'c'], index=[1])
s.loc[:, 'a'] = dt.datetime.now()
s.loc[:, 'b'] = 1
s.loc[:, 'c'] = dt.datetime.now()

s.loc[:, 'b'] = s.loc[:, 'b'].apply(lambda x: x + 1)

# no problem
s.loc[:, 'c'] = s.loc[:, 'c'].apply(lambda x: x.date().strftime("%Y-%m-%d"))

# raise TypeError
s.loc[:, 'a'] = s.loc[:, 'a'].apply(lambda x: x.date().strftime("%Y-%m-%d"))

# raise TypeError
temp = s.loc[:, 'a'].apply(lambda x: x.date().strftime("%Y-%m-%d"))
s.loc[:, 'a'] = temp

# no problems when DataFrame has more than 2 rows
s = pd.DataFrame(columns=['a', 'b', 'c'], index=[1, 2])
s.loc[:, 'a'] = dt.datetime.now()
s.loc[:, 'b'] = 1
s.loc[:, 'c'] = dt.datetime.now()

s.loc[:, 'b'] = s.loc[:, 'b'].apply(lambda x: x + 1)
temp = s.loc[:, 'a'].apply(lambda x: x.date().strftime("%Y-%m-%d"))
s.loc[:, 'a'] = temp
# s.loc[:, 'a'] = s.loc[:, 'a'].apply(lambda x: x.date().strftime("%Y-%m-%d"))
s.loc[:, 'c'] = s.loc[:, 'c'].apply(lambda x: x.date().strftime("%Y-%m-%d"))

Problem description

In my situation, I need to get user's login history from the database, then trans the type of the login time(timestamp in MySQL db, datetime64 in pandas) to string("%Y-%m-%d"). But when a user only has one login record, I have this problem occurred.

Really got confused

Expected Output

In[3]: s
Out[3]:
a b c
1 2017-10-30 2 2017-10-30

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None

python: 3.5.3.final.0

python-bits: 64

OS: Windows

OS-release: 10

machine: AMD64

processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel

byteorder: little

LC_ALL: None

LANG: None

LOCALE: None.None

pandas: 0.19.2

nose: None

pip: 9.0.1

setuptools: 36.2.7

Cython: None

numpy: 1.12.1

scipy: 0.19.0

statsmodels: None

xarray: None

IPython: 5.3.0

sphinx: None

patsy: None

dateutil: 2.6.0

pytz: 2016.10

blosc: None

bottleneck: None

tables: None

numexpr: None

matplotlib: 2.0.2

openpyxl: 2.4.8

xlrd: 1.0.0

xlwt: None

xlsxwriter: None

lxml: 3.7.3

bs4: 4.6.0

html5lib: 0.9999999

httplib2: None

apiclient: None

sqlalchemy: 1.1.6

pymysql: 0.7.10.None

psycopg2: None

jinja2: 2.9.5

boto: None

pandas_datareader: 0.4.0

Issue 2:
xref #14179

xref #12499

xref #18027

http://stackoverflow.com/questions/23250333/in-pandas-dataframe-after-i-set-an-entire-column-i-cant-update-another-column

but .loc works

In [50]: df = pd.DataFrame(index=pd.date_range(start,periods=1), columns=['timenow','Live'])

In [51]: df.at[start,'timenow'] = datetime.today() # initial value

In [52]: df
Out[52]:
timenow Live
2014-04-01 2014-04-23 12:42:38.883082 NaN

[1 rows x 2 columns]

In [53]: df._data
Out[53]:
BlockManager
Items: Index([u'timenow', u'Live'], dtype='object')
Axis 1: <class 'pandas.tseries.index.DatetimeIndex'>
[2014-04-01]
Length: 1, Freq: D, Timezone: None
ObjectBlock: [timenow, Live], 2 x 1, dtype: object

In [54]: df = pd.DataFrame(index=pd.date_range(start,periods=1), columns=['timenow','Live'])

In [55]: df.loc[start,'timenow'] = datetime.today() # initial value

In [56]: df
Out[56]:
timenow Live
2014-04-01 2014-04-23 12:43:00.554915 NaT

[1 rows x 2 columns]

In [57]: df._data
Out[57]:
BlockManager
Items: Index([u'timenow', u'Live'], dtype='object')
Axis 1: <class 'pandas.tseries.index.DatetimeIndex'>
[2014-04-01]
Length: 1, Freq: D, Timezone: None
DatetimeBlock: [timenow, Live], 2 x 1, dtype: datetime64[ns]