Guest User

Untitled

a guest
Mar 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. def statistics():
  2. '''Calculates and prints out the descriptive statistics about a city and time period
  3. specified by the user via raw input.
  4.  
  5. Args:
  6. none.
  7. Returns:
  8. none.
  9. '''
  10. # Filter by city (Chicago, New York, Washington)
  11. city = get_city()
  12. city_file = pd.read_csv(city)
  13. print (city_file)
  14. city_file["Start Time"] = pd.to_datetime(city_file(["Start Time"]))
  15. city_file["End Time"] = pd.to_datetime(city_file(["End Time"]))
  16. city_file["day_of_week"] = city_file["Start Time"].dt.weekday
  17. city_file["month"] = city_file["Start Time"].dt.month
Add Comment
Please, Sign In to add comment