Pandas resample.plot () funktioniert nicht, weil datetimeIndexressamplerPython

Python-Programme
Anonymous
 Pandas resample.plot () funktioniert nicht, weil datetimeIndexressampler

Post by Anonymous »

Ich versuche zu lernen, Pandas zu verwenden, also folge ich einem Tutorial.

Code: Select all

bitcoin.loc['2019','Close'].resample('M').plot() plt.show()
< /code>
und es gibt einen Fehler zurück: < /p>
AttributeError: 'DatetimeIndexResampler' object has no attribute 'plot'
Aber der Mann im Video erhält eine Grafik mit verschiedenen Farben, die nach Monat aufgeteilt sind. Ich verstehe nicht, warum?
Vielleicht eine falsche Version von Pandas oder etwas anderes? />

Code: Select all

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

bitcoin = pd.read_csv('BTC-EUR.csv',index_col='Date',parse_dates=True)

bitcoin.loc['2019','Close'].resample('M').plot()
plt.show()
Laden Sie den Datensatz herunter:
BTC-eur.csv = https://fr.finance.yahoo.com/quote/btc- ... ?p=btc-eur
Erwartete: src = "https://i.sstatic.net/yc8ar.png"/>
Got fol:

Code: Select all

AttributeError: 'DatetimeIndexResampler' object has no attribute 'plot'

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post