0

I have DataFrame where one column names "X" has value and second "Y" is timestamp, DataFrame looks like below:

enter image description here

The type of this column "X" is "int64", type of column "Y" is "object". My question is how can I create time series chart for these columns in my DataFrame.

I would like achieve something like below, nevetheles graph below concerns a time series over the years and I need changes over the days or months:

me

dingaro
  • 2,156
  • 9
  • 29

1 Answers1

0

Assuming you already read you dataset into arrays named X and Y, For you x-axis you can generate an numpy array

x_axis_arr = np.arange(len(Y))

Then, after you plot with matplotlib, you can change the x-axis labels with

plt.plot(X, x_axis_arr)
plt.xticks(Y)

You might have to convert Y to a string array beforehand

Gokberk Gul
  • 120
  • 8