I have 30+ xlsx files in same directory and using python I would like to convert all files to csv with utf-8 encoding, regardless of whatever encoding is present in the file. I am using python’s magic library to get the file names (below code).For conversion, I tried the code mention by SO user Julian here (I used the code
Tag: excel
XLWINGS conditional formatting based on value
I have a dataframe in Pandas that I have exported to Excel and formatted headers etc. using XLWINGS. That works like a charm. But I would like to format two columns based on their value in each cell (row), so if the value is above 0 then green and below zero then red. I can’t seem to find that option
Assigning an Excel Chart Object Name with XlsxWriter
Is it possible to assign an Excel Chart Object name to a chart I am creating with XlsxWriter? Thanks Answer It is (unintentionally) undocumented but you can set the object name for a chart when you create it. Like this: Output: Update: It is documented now.
Calculating the average value for every 10 cells in each column by pandas
In my excel csv files, there are around 1500 rows and 30 columns. I believe I can use python to complete it. so here is my target: How to let python read my excel file correctly. I want to reduce the number of rows to 1/10, so How can I calculate the average value for every 10 rows in each
making multiple request at the same time with the module requests and print the output on excel(python)
Hi this is quite a complicated question From this script: The code by itself do what is supposed to do (getting the data:foward eps,peg ratio,sector and paste them on an excel file)but the issue is that it takes a lot of time and the list stock is quite long(2531 elements) is there a way to make this code more efficent
How to scroll down to last row with data?
I have an Excel file with many rows and it gets many entries daily. That’s why I would like to scroll down the file to last row with data. To find the last row, I use: How could I scroll down to it using Python (and preferably XLWings module)? Answer Use used_range, it’s more robust than expand(“down) or end(“down”), if
How to convert Excel file to json using pandas?
I would like to parse Excel file which has a couple of sheets and save a data in JSON file. I don’t want to parse first and second sheet, and also the last one. I want to parse those in between and that number of sheets is not always equal and names of those sheets are not always the same.
Errno2 file not found after working with said path and/or possible bugs i’m overlooking
I have to create an app that gets a path from the user and renames, after the content of a cell, the entire document (excel documents in this case). For example, if in a specified cells, there is “2”, the document will be names 2.xlsx and so on, until al the files are renamed properly. The problem is that, after
How to delete a certain value in a cell in columns of csv using pandas
I need help with deleting “None” along with extra comma in language columns that have one or more language Here is the existing csv: Where f now looks like: And the result should be like this: There are also other columns that have only ‘None’ values in language column, so I can’t just use the replace function in excel, and
how to delete rows from excel who has red background color using python
read_file.style.apply(lambda x: [ ‘background-color:%s’ % ‘red’ if x < y else ‘background-color :%s’ % ‘green’ for x in read_file.language], axis=0 ,inplace=True) print(“done”) read_file.to_excel(‘coloured.xlsx’,engine=’openpyxl’, index=False) Answer Use: color.xlsx: no_red.xlsx: More than one column input: Output: