Jun-27-2017, 07:10 PM
(This post was last modified: Jun-27-2017, 07:10 PM by ulrich48155.)
Thanks, that worked!!! My plot now looks like this:
[Image: zUcgC]
Is it maybe possible to display those dates on the x-axis which start and end a data gap? So that one can easily identify these gaps? Because now it seems that they were randomly chosen.
My code looks like this now:
[Image: zUcgC]
Is it maybe possible to display those dates on the x-axis which start and end a data gap? So that one can easily identify these gaps? Because now it seems that they were randomly chosen.
My code looks like this now:
import pandas as pd from matplotlib import pyplot as plt import numpy as np colnames=['Timestamp','Currency','Rate','Volume'] usecols=['Timestamp','Currency'] series=pd.read_csv('prices.csv', names=colnames, usecols=usecols) series.Timestamp = pd.to_datetime(series.Timestamp) series = series.set_index('Timestamp') missing = series.resample('3h').min().notnull() missing = missing[missing.columns[0]].astype(int) plt.bar(missing.index, np.ones(len(missing)), color = [['y','b'][idx] for idx in missing], width = 1) plt.xticks(rotation=70)