housing.plot(kind="scatter", x="longitude", y="latitude", alpha=0.4,
s=housing["population"]/100, label="population", figsize=(10,7),
c="median_house_value", cmap=plt.get_cmap("jet"), colorbar=True,
sharex=False)
plt.legend()
TypeError: object of type ‘NoneType’ has no len()
After removing label =’population ‘, the picture can be displayed
but a new warning appears
No handles with labels found to put in legend.
I didn’t finish the adjustment for two hours until I updated Matplotlib:) it is OK.
Read More:
- [2021-10-05] Python Error: AttributeError: ‘NoneType‘ object has no attribute ‘append‘
- [Solved] python Error: AttributeError: ‘NoneType‘ object has no attribute ‘split‘
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘astype‘
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘append‘
- [Solved] pandas ExcelWrite AttributeError: ‘NoneType‘ object has no attribute ‘group‘
- [Solved] Paramiko error: AttributeError: ‘NoneType’ object has no attribute ‘time’
- [Solved] Failed to initialize GLFW AttributeError: ‘NoneType’ object has no attribute ‘point_size’
- [Solved] Simple jwt Error: AttributeError: type object ‘BlacklistedToken‘ has no attribute ‘objects
- Python TypeError: coercing to Unicode: need string or buffer, NoneType found
- How to Solve Python AttributeError: ‘dict’ object has no attribute ‘item’
- [Modified] AttributeError: ‘socket‘ object has no attribute ‘ioctl‘ python linux
- [Solved] PyQt: RuntimeError: wrapped C/C++ object has been deleted & has no attribute of flush in python
- [Solved] Python 3.6 Error: ‘dict’ object has no attribute ‘has_key’
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- Python 3.7 Error: AttributeError: ‘str‘ object has no attribute ‘decode‘ [How to Solve]
- Python Pandas Typeerror: invalid type comparison
- [Solved] Python Keras Error: AttributeError: ‘Sequential‘ object has no attribute ‘predict_classes‘
- [Solved] Selenium python send_key error: list object has no attribute
- [Solved] TypeError: Object of type ‘bytes’ is not JSON serializable
- Python Openyxl Error: AttributeError: ‘int‘ object has no attribute ‘upper‘ [How to Solve]