import pandas as pd
import matplotlib.pyplot as plt
rostov = 'Rostovskaya Oblast'
spb = 'Sankt-peterburg'
rostov = rostov.astype({'price':'float'})
rostov['date'] = pd.to_datetime(rostov['date'], format='%Y-%m-%d')
spb = spb.astype({'price':'float'})
spb['date'] = pd.to_datetime(spb['date'], format='%Y-%m-%d')
plt.scatter(rostov['date'], rostov['price'])
plt.scatter(spb['date'], spb['price'])
plt.show()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-9-5107f46d9e74> in <module>
3 rostov = 'Rostovskaya Oblast'
4 spb = 'Sankt-peterburg'
----> 5 rostov = rostov.astype({'price':'float'})
6 rostov['date'] = pd.to_datetime(rostov['date'], format='%Y-%m-%d')
7 spb = spb.astype({'price':'float'})
AttributeError: 'str' object has no attribute 'astype'
import matplotlib.pyplot as plt
rostov = 'Rostovskaya Oblast'
spb = 'Sankt-peterburg'
rostov = rostov.astype({'price':'float'})
rostov['date'] = pd.to_datetime(rostov['date'], format='%Y-%m-%d')
spb = spb.astype({'price':'float'})
spb['date'] = pd.to_datetime(spb['date'], format='%Y-%m-%d')
plt.scatter(rostov['date'], rostov['price'])
plt.scatter(spb['date'], spb['price'])
plt.show()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-9-5107f46d9e74> in <module>
3 rostov = 'Rostovskaya Oblast'
4 spb = 'Sankt-peterburg'
----> 5 rostov = rostov.astype({'price':'float'})
6 rostov['date'] = pd.to_datetime(rostov['date'], format='%Y-%m-%d')
7 spb = spb.astype({'price':'float'})
AttributeError: 'str' object has no attribute 'astype'