Communicating Results --- python graph axis not getting label

affordable_apps = paid[paid["Price"]<50].copy()
cheap = affordable_apps["Price"] < 5
reasonable = affordable_apps["Price"] >= 5
affordable_apps[cheap].hist(column="Price", grid=False, figsize=(12,6))
affordable_apps[reasonable].hist(column="Price", grid=False, figsize=(12,6))
affordable_apps["affordability"] = affordable_apps.apply(
    lambda row: "cheap" if row["Price"] < 5 else "reasonable",
    axis=1

https://app.dataquest.io/m/467/communicating-results/5/exploring-the-price

I ran the solution code above but still no label on axis —

Create a column in affordable_apps called affordability . It should have the value cheap if the price is lower than 5 , and reasonable otherwise.

Hello, @jamesberentsen.

I believe you posted the wrong screen link since what you described happens on step 5 and you posted the link for step 6. But do not worry, I fixed it for you.

The reason you don’t see labels on the axes is that this code does not create the labels. Histograms usually do not have labels since they are basically frequency tables, which means the x-axis shows the different values and the y-axis shows the frequency of each value in the dataset. Therefore, it does not make much sense to label the axes and the title does the job of identifying what the histogram is about.

Also, notice that the instructions do not ask for labels:

  1. Create a mask called cheap to identify the apps in affordable_apps that cost less than $5.
  2. Create a mask called reasonable to identify the apps in affordable_apps that cost $5 or more.
  3. Using the same syntax as above, create two histograms:
  • One where we pass cheap as a boolean mask to affordable_apps
  • Another where we pass reasonable as a boolean mask to affordable_apps
  1. Create a column in affordable_apps called affordability. It should have the value cheap if the price is lower than 5 , and reasonable otherwise.