pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.18k stars 17.77k forks source link

Date issue in dataframe #6877

Closed upjohnc closed 10 years ago

upjohnc commented 10 years ago

I have a set of code that works with 0.13.0 and with 0.13.1. The code snippet is attached. I've highlighted the row in the code snippet. In one I have saved the date in the other just "1". The output is in the snippet of the csv attached. To point out the second output snippet shows that the "elif" saves the date correctly when the "if" statement saves "1".

tradetest2_py_-_algotrading_-____projects_algotrading_

tradetest2_py_-_algotrading_-____projects_algotrading_

screenshot_4_13_14__8_05

screenshot_4_13_14__8_05

jreback commented 10 years ago

you are chain indexing, see here: http://pandas-docs.github.io/pandas-docs-travis/indexing.html#indexing-view-versus-copy

set using .loc with both row and column indexers instead