Issue
I currently have lots of 1000s in a column of my dataframe, I would like to change the value of this 1000 into a different number depending on whether the year given is before 2000 or after 2000 this is my code, my dataframe is called sales. year here is the current year obtained using datetime module
sales.loc[sales.remaining_lease==1000 & sales.lease_commence_date>=2000,'remaining_lease']=99-(year-sales.lease_commence_date)
Solution
Try:
sales.loc[(sales.remaining_lease==1000) & (sales.lease_commence_date>=2000),'remaining_lease']=99-(year-sales.lease_commence_date)
Answered By - gtomer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.