apply with .loc[:, col] method failed when the DataFrame only has one row and the column's type is datetime64 #18027
Labels
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
Duplicate Report
Duplicate issue or pull request
Indexing
Related to indexing on series/frames, not to indexes themselves
Code Sample, a copy-pastable example if possible
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
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
The text was updated successfully, but these errors were encountered: