Мой блокнот jupyter выдает ошибку для правильных кодов. В частности, это моя ошибка: AttributeError: ‘NoneType’ object has no attribute ‘plot’
Я проверил и проверил снова, я переписал свои коды, я также запускал свой код ячейка за ячейкой и также использую Run all
. но не работает. Ваша помощь будет искренне оценена.
вот мой код
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
recent_grads = pd.read_csv("recent-grads.csv")
cleaned_data_count = recent_grads.count()
print (cleaned_data_count)
Это мой вывод ошибок
AttributeError Traceback (most recent call last)
<ipython-input-6-e0fa232c36bf> in <module>
1 # Look up the number of rows to ascertain if data has been droped
----> 2 cleaned_data_count = recent_grads.count()
3 print (cleaned_data_count)
AttributeError: 'NoneType' object has no attribute 'count'
мой график также дает ошибку. Вот код для моего сюжета
recent_grads.plot(x="Sample_size", y="Median", kind = "scatter", title = "Sample_size VS Median")
recent_grads.plot(x="Sample_size", y="Unemployment_rate", kind = "scatter", title = "Sample_size VS Uemployemny")
recent_grads.plot(x="Full_time", y="Median", kind = "scatter", title = "Full_time VS Median")
recent_grads.plot(x="ShareWomen", y="Unemployment_rate", kind = "scatter", title = "Sharewoman VS Unemployment_rate")
recent_grads.plot(x="Men",y="Median", kind = "scatter", title = "Men VS Median")
recent_grads.plot(x="Women",y="Median", kind = "scatter", title = "Sample_size VS Median")
вот мой вывод ошибки сюжета
AttributeError Traceback (most recent call last)
<ipython-input-23-6d7d435b7c0f> in <module>
----> 1 recent_grads.plot(x="Sample_size", y="Median", kind = "scatter", title = "Sample_size VS Median")
2 recent_grads.plot(x="Sample_size", y="Unemployment_rate", kind = "scatter", title = "Sample_size VS Uemployemny")
3 recent_grads.plot(x="Full_time", y="Median", kind = "scatter", title = "Full_time VS Median")
4 recent_grads.plot(x="ShareWomen", y="Unemployment_rate", kind = "scatter", title = "Sharewoman VS Unemployment_rate")
5 recent_grads.plot(x="Men",y="Median", kind = "scatter", title = "Men VS Median")
AttributeError: 'NoneType' object has no attribute 'plot'
вот мой скриншот код и скриншот ошибки код и скриншот ошибки для участка