1

I have a dataframe like this:

click to show the pic

how can i get the list like:

[[2017-08-01,1.18263,1.18266,1.18109,1.18113], ......, [2017-08-18,1.18263,1.18266,1.18109,1.18113]]

error
  • 2,356
  • 3
  • 23
  • 25

1 Answers1

-1

DataFrame.values returns the data as a numpy array, from there you can go to a list by adding tolist()

Deb
  • 1,098
  • 10
  • 22
  • use df.values.tolist() i got this: [[Timestamp('2017-08-01 00:00:00'), 1.18263, 1.18266, 1.18109, 1.18113, 1.18381, 1.18385, 1.17863, 1.17867, 1.1812761994752348, 1.1813188445315443],..... how to remove the "Timestamp" – Developer333 Sep 01 '17 at 07:45
  • i have solve the problem,before tolist(), covert the columns type,thanks – Developer333 Sep 01 '17 at 07:50