ValueError: No engine for filetype: 'xlsk' [closed]
Asked Answered
S

4

6
from datetime import datetime
x="Hello, it is now %s." % datetime.now().strftime('%d-%m-%Y %H:%M:%S')
import csv
try:
    with open('output.csv', 'w+') as csvFile:
        writer=csv.writer(csvFile)
        writer.writerow(x.encode('UTF-8'))
        print(x.encode('UTF-8'))
finally:
    csvFile.close()
import pandas as pd
data = pd.read_csv('output.csv')
data.to_excel('output.xlsk')

Is this office365 problem? or my code

environment:windows10

Sackman answered 17/4, 2019 at 21:17 Comment(3)
there is not such format xlskBackbreaker
Yeah you want xlsx, not xlskMcalpine
I did mistake..Sackman
B
40

Your title answers the question. There is no such excel file format as '.xlsk'. Perhaps you meant

data.to_excel('output.xlsx')

?

Bonsai answered 17/4, 2019 at 21:21 Comment(0)
P
0

As mentioned by @osprey, the file output for excel files are generally xlsx.

However,

pandas relies on a package called openpyxl

(an engine to read/write Excel 2010 xlsx/xlsm/xltx/xltm files)

to write pandas dataframes to excel files. Make sure to install this before writing out your data.

Pickard answered 2/1 at 11:28 Comment(0)
S
-1

simply try

df.to_csv("output.csv")
Surah answered 2/1, 2021 at 8:57 Comment(2)
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From ReviewBautzen
I was getting same error and i converted this --data.to_excel('output.xlsk')-- to this ---df.to_csv("output.csv")-- is got my desired output,Surah
M
-1

You should use the file extension when mentioning the file name. In this case for Excel File the extension would be .xlsx so with the correction it will be data.to_excel('output.xlsx')

Mot answered 6/6 at 9:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.