concept median in category dask

appears as: medi, medi, median, medis
Data Science with Python and Dask

This is an excerpt from Manning's book Data Science with Python and Dask.

  • The middle point between the minimum and maximum value (also called the median)
  • Listing 6.13 Calculating the median age for each vehicle type
    with ProgressBar():
        passenger_vehicles = nyc_data_filtered[nyc_data_filtered['Plate Type'] == 'PAS']    #1  
        commercial_vehicles = nyc_data_filtered[nyc_data_filtered['Plate Type'] == 'COM']
    
        median_PAS = passenger_vehicles['Vehicle Age'].quantile(0.5).compute()    #2  
        median_COM = commercial_vehicles['Vehicle Age'].quantile(0.5).compute()
    
    #1   Split into two DataFrames based on Plate Type.
    #2   Calculate the medians for each Plate Type.