'I received this error: TypeError: 'DataFrame' object is not callable
I have received an error that: TypeError: 'DataFrame' object is not callable. How do I go about it?
Bike_share_casual = Bikeshare_all[Bikeshare_all.member_casual == 'casual']
Bike_share_member_p = Bike_share_member(['start_hour','Weekday']).ride_id.count().unstack().T.reindex().reindex(['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'])
Bike_share_casual_p = Bike_share_casual(['start_hour','Weekday']).ride_id.count().unstack().T.reindex().reindex(['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'])```
Solution 1:[1]
Solved.
I added a groupby:
Bike_share_member_p = Bike_share_member.groupby(['start_hour','Weekday']).ride_id.count().unstack().T.reindex().reindex(['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']) Bike_share_casual_p = Bike_share_casual.groupby(['start_hour','Weekday']).ride_id.count().unstack().T.reindex().reindex(['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'])
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Pius Kimathi |