Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def statistics():
- '''Calculates and prints out the descriptive statistics about a city and time period
- specified by the user via raw input.
- Args:
- none.
- Returns:
- none.
- '''
- # Filter by city (Chicago, New York, Washington)
- city = get_city()
- city_file = pd.read_csv(city)
- print (city_file)
- city_file["Start Time"] = pd.to_datetime(city_file(["Start Time"]))
- city_file["End Time"] = pd.to_datetime(city_file(["End Time"]))
- city_file["day_of_week"] = city_file["Start Time"].dt.weekday
- city_file["month"] = city_file["Start Time"].dt.month
Add Comment
Please, Sign In to add comment