-2

I am trying to plot a df column vs a datetime64 column. it plots OK, with just one problem - the intervals between ticks are equally spaced, although the datetime64 data is NOT equally spaced.

df.info

   Date       ^GSPC Open  ^GSPC High  ^GSPC Low  ^GSPC Close  \

0 2019-10-10 2918.55 2948.46 2917.12 2938.13
1 2019-10-11 2963.07 2993.28 2963.07 2970.27
2 2019-10-14 2965.81 2972.84 2962.94 2966.15
3 2019-10-15 2973.61 3003.28 2973.61 2995.68
4 2019-10-16 2989.68 2997.54 2985.20 2989.69

df.dtypes

Date datetime64[ns] ^GSPC Open float64 ^GSPC High float64 ^GSPC Low float64 ^GSPC Close float64 ^GSPC Adj Close float64 ^GSPC Volume int64 QQQ Open float64 QQQ High float64 QQQ Low float64 QQQ Close float64 QQQ Adj Close float64 QQQ Volume int64 dtype: object

plot showing equally spaced ticks of non-equally spaced dates...

and adviced would be helpful. Thanks

1 Answers1

0

first of all, welcome to StackOverflow. Please consider to take a look how to make good reproducible pandas examples. It would make it easier and faster to answer, if you provide the dataframe itself, instead of only the output.

dboy
  • 1,004
  • 2
  • 16
  • 24