-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: setitem with at not inferring dtype correctly #6942
Comments
Hey, I am gonna give it a shot 👍 EDIT1: The behaviour on the StackOverflow link isn't replicated with the current build In [1]: import pandas as pd
In [2]: from datetime import datetime
In [3]: start = pd.to_datetime('20140401')
In [4]: df = pd.DataFrame(index=pd.date_range(start,periods=1), columns=['timenow','Live'])
In [5]: df.at[start,'timenow'] = datetime.today() # initial value
In [6]: df
Out[6]:
timenow Live
2014-04-01 2018-10-24 16:39:27.734368 NaN
In [7]: df.at[start,'timenow'] = datetime.today() # this works
In [8]: df
Out[8]:
timenow Live
2014-04-01 2018-10-24 16:39:36.485698 NaN
In [9]: df.Live = True
In [10]: df.at[start,'timenow'] = datetime.today() # this doesn't work - nothing changes
In [11]: df
Out[11]:
timenow Live
2014-04-01 2018-10-24 16:39:55.149644 True
Also can you elaborate on the dtype not infered correctly? |
This looks to be working on master. Could use a test. |
@mroeschke I am working on this. |
Sure, will be easier to review in a PR |
@mroeschke sure I'll submit the PR soon. |
@mroeschke submitted the PR, have a look. |
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
worksThe text was updated successfully, but these errors were encountered: