xlsxwriter Questions
4
Solved
I have a panda dataframe that I write to a xslx file, and would like to add a table over that data. I would also like to keep the headers that I have already written, instead of adding them again. ...
Wealthy asked 25/4, 2016 at 11:32
1
Per this example the to_excel method should save the Excel file with background color. However, my saved Excel file does not have any color in it.
I tried to write using both openpyxl and xlsxwrite...
Esquimau asked 18/3, 2019 at 19:53
4
I have a 140MB Excel file I need to analyze using pandas. The problem is that if I open this file as xlsx it takes python 5 minutes simply to read it. I tried to manually save this file as csv and ...
Ohl asked 7/12, 2017 at 21:4
3
Solved
So I've been using XLSXWriter in the past to export an excel file containing one tab filled with two pandas dataframes. In the past I've only been exporting the file to a local path on the user's c...
Alarmist asked 25/5, 2016 at 2:36
2
Solved
I want to add some sheets to one workbook.
sheets = ["A.csv", "B.csv", "C.csv"]
for sh in sheets:
workbook = xlsxwriter.Workbook('myxlsx.xlsx')
worksheet = workbook.add_worksheet(sh)
worksheet....
Semiautomatic asked 27/4, 2016 at 7:38
1
Solved
It's possible with xlsxwriter to save variables to existing excel files and read them after, though the problem is that the variables are stored as strings in my excel file.
Let's say I have a li...
Awry asked 7/12, 2018 at 5:28
2
I'm trying to conditional formatting in XLSX writer with a 3 color scale with a 0 midpoint value in the middle. I want all negative values to scale from red (lowest number) to yellow (when the valu...
Laskowski asked 12/4, 2017 at 23:31
1
Solved
I see a couple examples of how to set the orientation of a text box, but not cell in a text box. I see how to format other things, like bold:
bold_format = workbook.add_format({'bold': True})
work...
Scandinavian asked 29/10, 2018 at 16:9
2
Solved
I'm looking to set the default number format when writing to Excel from a Pandas dataframe. Is this possible?
I can set the default date/datetime_format with the following, but couldn't find a way...
Journalese asked 27/6, 2018 at 17:24
1
Solved
I have a column (column V) that I used to conditionally format another column (column U) using engine xlsxwriter.
So I have this:
# Light yellow fill with dark yellow text.
format1 = workbook.a...
Sunsunbaked asked 30/6, 2018 at 4:23
3
Solved
I'm getting lost of using worksheet.set_column all the time. Is there any possibility of setting the width of all columns automatically?
What would be the Python function that simulates it? (using ...
Slavin asked 1/3, 2016 at 16:30
2
Solved
Given this format:
format0 = workbook.add_format({'bg_color': 'none'})
I'd like to apply it (no background color) if the cell is blank.
Here's what I've tried so far:
worksheet.conditional_form...
Shandashandee asked 25/8, 2016 at 2:22
1
I am trying to style and write excel files dynamically. Here is my code
import pandas as pd
import copy
class OutputWriter(object):
def __init__(self, fmt_func, sheet_name='data'):
'''
Initi...
Directive asked 20/4, 2018 at 11:50
1
Solved
Is there any option to add thick border in Excel using xlsxwriter?
I'm writing a border between a range using conditional format.
Add table won't work in my case.
Siward asked 4/4, 2018 at 2:12
1
Solved
I want to write a Pandas dataframe into Excel with formatting. For this I'm using xlsxwriter. My question is twofold:
First, how can I apply conditional formatting to a whole column? In the examp...
Sugar asked 26/3, 2018 at 9:40
1
Solved
I have code from a while ago that I am re-using for a new task. The task is to write a new DataFrame into a new sheet, into an existing excel file. But there is one part of the code that I do not u...
Omora asked 20/7, 2017 at 16:20
1
Cannot write to an excel AttributeError: 'Worksheet' object has no attribute 'write'
I am trying to write text to an excel I am following this post. This was working earlier but now it is not. I get:
Error:
line 122, in <module>
worksheet.write(0, 11, 'HI')
AttributeError...
Andresandresen asked 13/12, 2017 at 6:31
2
Solved
I am using xlsxwriter engine to push some dataframes into excel sheet with pandas.to_excel(), but I need a caption above each table.
Here is an example of what result I would like to achieve:
I...
Seawright asked 23/11, 2017 at 10:3
4
Solved
I'm writing a program that writes data to an Excel file using the xlsxwriter module.
The code that opens the workbook is:
excel = xlsxwriter.Workbook('stock.xlsx')
This used to work. Then I cha...
Slipway asked 5/4, 2015 at 3:13
1
Solved
How do permanently set the font size using xlswriter when you first create the workbook?
I tried:
book = xlsxwriter.Workbook(os.getcwd() + '\\test.xlsx')
sheet1 = book.add_worksheet()
format = bo...
Froze asked 16/5, 2017 at 2:17
4
Solved
I use the .to_excel method of pandas to write a DataFrame as an Excel workbook.
This works nice even for multi-index DataFrames as index cells become merged.
When using the pure XlsxWriter I can ap...
Artilleryman asked 5/6, 2014 at 16:32
1
Solved
Given the following data frame:
import pandas as pd
d=pd.DataFrame({'a':['a','a','b','b'],
'b':['a','b','c','d'],
'c':[1,2,3,4]})
d=d.groupby(['a','b']).sum()
d
I'd like to export this with ...
Raulrausch asked 28/12, 2016 at 14:48
3
Solved
I have a dictionary with 2000 items which looks like this:
d = {'10071353': (0, 0), '06030011': (6, 0), '06030016': (2, 10), ...}
Given that I want to write it to an .xlsx file, I use this code ...
Fatma asked 4/10, 2016 at 9:11
1
I am having some problem getting xlsxwriter to create box borders around a number of cells when creating a Excel sheet. After some searching I found a thread here where there was a example on how t...
Grange asked 19/6, 2016 at 12:49
3
Solved
I am currently using xlwt quite successfully to create .xls files. I am also learning xlsxwriter for possible future applications where I'll need some of its features.
xlwt smoothly writes lists o...
Poore asked 17/9, 2014 at 5:37
© 2022 - 2024 — McMap. All rights reserved.