xls

Sort dataframe by dates

Sort dataframe by dates Question: I am importing an excel file in which a column is a date in the format dd/mm/yyyy. When I import it from the excel file, I think it is understood as a string. I need to sort the whole DataFrame by date, so I perform this code: import pandas as …

Total answers: 3

Concatenate a .xls file list into .csv

Concatenate a .xls file list into .csv Question: I’m trying to concatenate a .xls file list into .csv: import glob import pandas as pd file_xls = glob.glob(location + "*.xls") print(file_xls) read_file = pd.read_excel(location + file_xls) but I have an error about the concatenation of the list: TypeError: can only concatenate str (not "list") to str …

Total answers: 2

Python Pandas can't read .xls file though engine is xlrd

Python Pandas can't read .xls file though engine is xlrd Question: have a 1 GB excel sheet with xls format (old excel), and I can’t read it with pandas df = pd.read_excel("filelocation/filename.xls",engine = "xlrd") XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'<html>rn’ and if removed the engine it sends this error ValueError: …

Total answers: 2

Outputting A .xls File In Python

Outputting A .xls File In Python Question: I have been teaching myself Python to automate some of our work processes. So far reading from Excel files (.xls, .xlsx) has gone great. Currently I have hit a bit of a snag. Although I can output .xlsx files fine, the software system that we have to use …

Total answers: 4

Python encoding textfile, open it, replace multiple sections and output without empty lines as text formatted in .csv style

Python encoding textfile, open it, replace multiple sections and output without empty lines as text formatted in .csv style Question: What I have is a file "test.xls" which is basically a old xls (xml formatting) which looks like this in notepad: <table cellspacing="1" rules="all" border="1"> <tr> <td>Row A</td><td>Row B</td><td>Row C</td> </tr> <tr> <td>New York</td><td>23</td><td>warm</td> </tr> …

Total answers: 1

How to convert JSON to XLS in Python

How to convert JSON to XLS in Python Question: Does anyone know how can I convert JSON to XLS in Python? I know that it is possible to create xls files using the package xlwt in Python. What if I want to convert a JSON data file to XLS file directly? Is there a way …

Total answers: 5

Get formula from Excel cell with python xlrd

Get formula from Excel cell with python xlrd Question: I have to port an algorithm from an Excel sheet to python code but I have to reverse engineer the algorithm from the Excel file. The Excel sheet is quite complicated, it contains many cells in which there are formulas that refer to other cells (that …

Total answers: 6