Aan de slagGa gratis aan de slag

Numeric data or ... ?

In this exercise, and throughout this chapter, you'll be working with bicycle ride sharing data in San Francisco called ride_sharing. It contains information on the start and end stations, the trip duration, and some user information for a bike sharing service.

The user_type column contains information on whether a user is taking a free ride and takes on the following values:

  • 1 for free riders.
  • 2 for pay per ride.
  • 3 for monthly subscribers.

In this instance, you will print the information of ride_sharing using .info() and see a firsthand example of how an incorrect data type can flaw your analysis of the dataset. The pandas package is imported as pd.

Deze oefening maakt deel uit van de cursus

Cleaning Data in Python

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Print the information of ride_sharing
print(____.____())

# Print summary statistics of user_type column
print(ride_sharing['____'].____())
Code bewerken en uitvoeren