How to retrieve the author of an office file in python?

Title explains the problem, there are doc and docs files that which I want to retrieive their author information so that I can restructure my files. os.stat returns only size and datetime,...

python xlrd unsupported format, or corrupt file.

My code: import xlrd wb = xlrd.open_workbook("Z:\\Data\\Locates\\3.8 locates.xls") sh = wb.sheet_by_index(0) print sh.cell(0,0).value The error: Traceback (most recent call last): File...

Python Django requirements.txt

I have a requirements.txt file containing all my dependencies but it is not processed correctly : After a pip install -r requirements.txt, I get the following pip freeze...

Writing/Creating a worksheet using xlrd and xlwt in Python

I'm trying to read multiple excel files with multiple sheets (sheet names are the same in all the excel files) and perform some calculations in each of the worksheet and save the calculation data...

xlrd reading xls XLRDError: Unsupported format, or corrupt file: Expected BOF record; found '\r\n<html>'

This is the code: xls = open_workbook('data.xls') In return: File "/home/woles/P2/fin/fin/apps/data_container/importer.py", line 16, in import_data xls = open_workbook('data.xlsx') File...

DictReader for Excel-Files

I have a file that I currently save to csv but it's originally an Excel-file (Excel 2010). Its content is of this sort: Name;Category;Address McFood;Fast Food;Street 1 BurgerEmperor;Fast Food;Way...

Uploading excel data into django without saving the file

I am a newbie to django and i'm desperate for help uploading and reading excel data without actually saving the data on the machine. I have written some code and taken some from the research i've...

How to make XLRD read hyperlinks in XLSX cells?

This is not a duplicate although the issue has been raised in this forum in 2011https://stackoverflow.com/questions/7056892/getting-a-hyperlink-url-from-an-excel-document, 2013...

Multi select option for a cell in excel using python

I want to create an excel, which should have cell with multi-select dropdown. e.g. if a cell is given options = [a", "b", "c", "d", "e"]. Editor selects "a", then the value in cell should be "a"....

When to use DataFrame.eval() versus pandas.eval() or Python eval()

I have a few dozen conditions (e.g., foo > bar) that I need to evaluate on ~1 MM rows of a DataFrame, and the most concise way of writing this is to store these conditions as a list of strings and...

How to preserve images in an xls sheet edited via xlrd?

I'm using xlrd to edit a few cells in an Excel sheet (.xls). I'm able to preserve cell formatting of the edited info (using this little hack). However, when the file is saved, all the images in...

Read specific columns from excel for python

import xlrd workbook = xlrd.open_workbook(filename) sheet = workbook.sheet_by_index(0) array = [] for i in range(2, 9): array.append([sheet.cell(i, j).value for j in range(2, 5)]) Excel...

one hot encoding for frequent values only

I am looking to do one hot encoding to a column, but only for those that are very frequent. All that are below a threshold T will be put in their own category. My strategy was to create a...

How to copy over an Excel sheet to another workbook in Python

I have a string with a sourcefile path and another string with a destfile path, both pointing to Excel workbooks. I want to take the first sheet of the sourcefile and copy it as a new tab to the...

How to fix [Errno13] permission denied when trying to read excel file?

I tried the following code to be able to read an excel file from my personal computer. import xlrd book = xlrd.open_workbook('C:\\Users\eline\Documents\***\***\Python', 'Example 1.xlsx') But I...

TypeError: __init__() got an unexpected keyword argument 'encoding'

Attempting a scrape of table data using pandas in Python 3.6 using Spyder3 on a MacBook Pro OS v10.13.2 (17C88). The code is: import pandas as pd ... url =...

How to select multiple columns (but same rows) of xlsx file while looping using Openpyxl?

I have an excel file that looks like this (example) [Balance Sheet][1] [1]: https://i.stack.imgur.com/O0WXP.jpg I would like to extract all the items of this financial statement and write it to a...

Why does Pandas read_excel function return an error in Pyinstaller .exe but not under Python interpreter?

I'm using the Pandas read_excel function to import data from a spreadsheet. This works fine when run under the Python interpreter, but when I build an exe with PyInstaller it returns an...

Multivariate polynomial regression with Python

Recently I started to learn sklearn, numpy and pandas and I made a function for multivariate linear regression. Im wondering, is it possible to make multivariate polynomial regression? This is my...

Can't read .xlsx file on Azure Databricks

I'm on Azure databricks notebooks using Python, and I'm having trouble reading an excel file and putting it in a spark dataframe. I saw that there were topics of the same problems, but they don't...

Why does Heroku has to install so many modules every time?

I am developing an app in Django and I am deploying it on Heroku. Why does, with each push, Heroku has to install all these modules? I know there is a way to prevent it from doing it all the...

Does the encoding parameter work for pandas.read_excel?

I need to read .xls files by using pandas.read_excel. They are adsorption data directly exported from the software of the measurement equipment..I...

print "EXTERNSHEET(b7-):" pandas

I was trying to run as ussually my library "pandas" but then I faced a mistake import pandas as pd DF_temp = pd.read_excel("example.xlsx") Output File...

Blob Trigger Azure Function in Python

I'm trying to create a Blob trigger Azure Function in Python that automatically split all sheets in a specific Excel file into separate .csv files onto the same Azure Blob container. My init.py...

Django error 'URLs with hostname components are not permitted'

I have deployed a django application which invokes a python file to send captured data on django form to a third party independent server. The problem is that when the python file is invoked from...

Alpine ERROR: unsatisfiable constraints: py3-pandas (missing):

I have the following dockerfile: FROM alpine:latest ADD crontab.txt /crontab.txt ADD script.sh /script.sh COPY entry.sh /entry.sh ADD app /app RUN chmod 755 /script.sh /entry.sh RUN...

How to make pandas.read_excel with engine='openpyxl' behave like it did with xlrd, not showing nanoseconds by default?

We have a process that reads data in from an Excel .xlsx spreadsheet into a pandas DataFrame. While trying to upgrade to the latest version (1.2.1) of pandas, I saw the following in the doc for...

How to deal with warning : "Workbook contains no default style, apply openpyxl's default "

I have the -current- latest version of pandas, openpyxl, xlrd. openpyxl : 3.0.6. pandas : 1.2.2. xlrd : 2.0.1. I have a generated excel xlsx- file (export from a webapplication). I read it in...

My Pandas is incorrectly reading values from a .xlsx file

I'm trying to read in a .xlsx file into a dataframe. The .xlsx opened in Excel looks like: Heading 1 Heading 2 Heading 3 soda 12 4 pop 12 2 cola 12 3 But the...

Building wheel for cffi (setup.py) ... error while installing the packages from requirements.txt in django

I am trying to install a new Django project from git, I created a new virtual envt using python3(version: 3.8.5). When I try to install the required libraries in the requirements.txt, I get the...