Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas boolean array calculating the average of two columns based on a filter or a 3rd column

print(bike_sharing[bike_sharing['workingday']==0][['casual', 'registered']].mean())
print(bike_sharing[bike_sharing['workingday']==1][['casual', 'registered']].mean())
Source by community.dataquest.io #
 
PREVIOUS NEXT
Tagged: #pandas #boolean #array #calculating #average #columns #based #filter #column
ADD COMMENT
Topic
Name
3+4 =