1

how to insert data from list into excel in python for example i exported this data from log file :

data= ["101","am1","123450","2015-01-01 11:19:00","test1 test1".....]
      ["102","am2","123451","2015-01-01 11:20:00","test2 test3".....]
      ["103","am3","123452","2015-01-01 11:21:00","test3 test3".....]

Output result: [1]: https://i.sstatic.net/7uTOE.png

.

1
  • You can use Pandas module to export data as .xlsx Commented May 14, 2022 at 22:15

1 Answer 1

1

The module pandas has a DataFrame.to_excel() function that would do that.

import pandas as pd

data= [["101","am1","123450","2015-01-01 11:19:00","test1 test1"],
      ["102","am2","123451","2015-01-01 11:20:00","test2 test3"],
      ["103","am3","123452","2015-01-01 11:21:00","test3 test3"]]

df = pd.DataFrame(data)

df.to_excel('my_data.xmls')

That should do it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.