Questions tagged [xlsxwriter]

XlsxWriter is a python module for creating Excel XLSX files

XlsxWriter is a Python module for creating Excel XLSX files.

It can be used to write text, numbers, and formulas to multiple worksheets and it supports features such as formatting, images, charts, page setup, autofilters, conditional formatting and many others.

This module cannot be used to modify or write to an existing Excel XLSX file.

1959 questions
0
votes
0 answers

Excel from Pandas creating a lot of empty rows when opening file

I do not have code specifics for this problem unfortunately, but using Python 2.7+openpyxl engine after writing to xlsx causes the excel worksheet to be initially opened with a lot of blank rows, which then gets fixed automatically after scrolling…
William
  • 33
  • 4
0
votes
0 answers

Python/xlsxwriter how to set column to be same format across multiple worksheets

I am working with xlsxwriter and trying to dynamically format columns that have the same format across multiple sheets. I am currently creating a list of all my data frames ( worksheets), looping through each one, and then adding the format based on…
ARE
  • 99
  • 9
0
votes
2 answers

Invalid extension for engine problem, iterating through directories and files

I have a code, which is working properly if I manually insert strings for path, directory and file name, here is the code: path = r"test//ab3b//ab3b_all_anal.xlsx" directory = "test" file1 = "test//ab3b//ab3b80.csv" df1 = all_calc_80(file1,…
0
votes
0 answers

How to get the content of table after a keyword in Microsoft Word using Python

I have many paragraphs and many tables in a Microsoft Word file. I need to get the content of the table after the specified keyword in paragraph using Python. How should I write my code? I tried to use docx package in Python, but the syntax is…
TJJJ
  • 1
0
votes
0 answers

How to add edit sheet in Excel file to add formula?

I'm trying to create an excel file with the content of the list games below. I want to create DATA sheet with a table containing the information of games list. Then I'd like to have PIVOT sheet containing a pivot table with season field as first…
Rasec Malkic
  • 373
  • 1
  • 8
0
votes
0 answers

Anyone know why my plot is turning up blank on my excel sheet?

I am trying to paste my plot into my excel sheet, but it keeps popping up blank. This is super weird because the names match up, and the correct plot comes up in Spyder. If anyone could help me out that would be awesome. Here is a condensed version…
Zane B
  • 1
  • 2
0
votes
2 answers

How to map color names with their HEX to make a conditionnal formating

I have the dataframe below: import pandas as pd df = pd.DataFrame({'ID': ['ID001', 'ID002', 'ID003', 'ID004', 'ID005', 'ID006'], 'Color': ['Red', 'Green', 'Blue', 'Green', 'Yellow', 'Purple']}) ID Color 0 ID001 …
Timeless
  • 22,580
  • 4
  • 12
  • 30
0
votes
1 answer

Unhandled color format: '' " while using xlsxwriter pandas

I am trying to highlight cells when a certain criteria is met but if not, I don't want to add any color. If I try with space, I get the aforementioned error. I can't use white as the cell linings in excel vanish. Code: def highlight_cells(val): …
kriti
  • 3
  • 2
0
votes
0 answers

Python xlsxwriter static date into dd/mm/yyyy hh:mm:ss am/pm format

I tried using datetime_format = 'dd/mm/yyyy hh:mm:ss AM/PM' but this didn't change it. How else can I get the date to format like this?
0
votes
0 answers

How to convert Excel (XLSXWriter) file to PDF in Python

I have created an xlsx file in memory (BytesIO) with the help of the XLSXWriter Library. I now want to read that in-memory file and convert it into pdf format, and the result should also be a bytes object. Which library and how can I achieve this…
0
votes
0 answers

set bg_color without changing cell contents in xlsxwriter python

I have a script that uses xlsxwriter to generate an excel spreadsheet. Most of the cells are populated with the formatting and values one cell at a time using loops. However, we've recently had to introduce a new formula that behaves differently…
0
votes
0 answers

Pandas dataframe pivot table save to_excel filtering by a column

I'm using pandas data frames to create a pivot table and then exporting to Excel format. I've tried some of the examples in the docs, but it doesn't create the filter drop down. I would like to recreate how Excel does the pivot table when you add a…
Rich
  • 183
  • 5
0
votes
1 answer

Xlsxwriter with pandas, use dot as thousand separator

I would like for my excel numbers to come out having a . separator for thousands in the excel output example.xlsx. So I do not want to change the pandas numbers. So instead of (my current result if you run the code) 1,000 123,123,123 I would like…
DaveR
  • 1,696
  • 18
  • 24
0
votes
1 answer

How to Conditionally Format Excel Rows With Text Phrases Using xlswriter Module

The script below works as intended by highlighting the Excel Rows that contain keyword1 as red. import xlsxwriter workbook = xlsxwriter.Workbook('conditional_format.xlsx') worksheet1 = workbook.add_worksheet() # Keyword keyword1 = 'red' keyword2 =…
MarkWP
  • 177
  • 6
0
votes
0 answers

Add filled region on excel plot using python and xlsxwriter

Using python, I'm trying to build graphs in excel via pandas and xlsxwriter. The graphs themselves are obtained easily, but it is not clear how to do the fill. It is necessary to paint over some area of the drawing. The coordinates on the y axis are…