Skip to content
data manipulation notes
  • AI Chat
  • Code
  • Report
  • Spinner
    # Start coding here...
    # Import NumPy and create custom IQR function
    import numpy as np
    def iqr(column):
        return column.quantile(0.75) - column.quantile(0.25)
    
    # Update to print IQR and median of temperature_c, fuel_price_usd_per_l, & unemployment
    print(sales[["temperature_c", "fuel_price_usd_per_l", "unemployment"]].agg([iqr, np.median]))