There is a CSV which reads as follows:
bike_sharing = pd.read_csv("BIKE_SHARING_ASSIGNMENT\day.csv")
bike_sharing.yr
The yr
has 2 possible values: 0 and 1. I want to update the collection and map them to 2018 and 2019 respectively. I currently doing it as follows:
bike_sharing ['yr'] = bike_sharing[['yr']].apply(lambda x: x.map({0:'2018',1:'2019'}) )
bike_sharing ['yr'].value_counts()
I get correct results the first time, but when I run it the second time, it changes all values to NAN
. Why does this happen?