I'm unable to plot the histogram in Jupyter notebook. Here's the code below and the error message in response to it.
import pandas as pd import numpy as np from sklearn.datasets import load_boston import matplotlib.pyplot as plt housing_data = load_boston() %matplotlib inline housing_data.hist(bins = 50, figsize = (20, 15)) plt.show() KeyError Traceback (most recent call last) /anaconda3/lib/python3.6/site-packages/sklearn/utils/__init__.py in __getattr__(self, key) 60 try: ---> 61 return self[key] 62 except KeyError: KeyError: 'hist' During handling of the above exception, another exception occurred: AttributeError Traceback (most recent call last) <ipython-input-17-570a88b85d5d> in <module>() ----> 1 housing_data.hist(bins = 50, figsize = (20, 15)) 2 plt.show(); /anaconda3/lib/python3.6/site-packages/sklearn/utils/__init__.py in __getattr__(self, key) 61 return self[key] 62 except KeyError: ---> 63 raise AttributeError(key) 64 65 def setstate(self, state):
AttributeError: hist I'm new to this and please help me with this.

plotin your call:housing_data.plot.hist(...)should do ithousing_datawas a pandas dataframe. Theplot.histmethod is specific for pandas dataframes.housing_datais a dictionary, more or less; you need to figure out how you want to deal with that or what data from there you want to plot.