I am reading a .xlxs file using pandas library and extracting the dataframe. Now I am trying to create a file with .ods extension and write the dataframe into it using pyexcel_ods library.
Here is my code :--
import pandas as pd
from pyexcel_ods import save_data
from collections import OrderedDict
self.current_df = pd.read_excel('filename')
data = OrderedDict()
data.update(df)
save_data("as.ods", data)
It is throwing Error
{TypeError}'int' object is not iterable
Feel free to ask for more code.
Note :-- I am using Python 3.
Please note that in recent versions of Pandas (current is 1.1) has been implemented support for ODS format in functions like pd.ExcelWriter() and pd.read_excel(). You only need to specify the propper engine "odf" to be able of working with OpenDocument file formats (.odf, .ods, .odt)
You will need the odfpy package installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With