Aj ml
Aj ml

Reputation: 13

how to read text from excel file in python pandas?

I am working on a excel file with large text data. 2 columns have lot of text data. Like descriptions, job duties.

When i import my file in python df=pd.read_excel("form1.xlsx"). It shows the columns with text data as NaN.

How do I import all the text in the columns ? I want to do analysis on job title , description and job duties. Descriptions and Job Title are long text. I have over 150 rows.

Upvotes: 0

Views: 3117

Answers (2)

Silenced Temporarily
Silenced Temporarily

Reputation: 1004

You can pass a dictionary of column names and datatypes to read_excel with the dtype keyword:

col_dict = {‘a’: str, ‘b’: int}
pd.read_excel("form1.xls", dtype=col_dict)

Upvotes: 0

WWaldo
WWaldo

Reputation: 223

Try converting the file from .xlsx to .CSV I had the same problem with text columns so i tried converting to CSV (Comma Delimited) and it worked. Not very helpful, but worth a try.

Upvotes: 1

Related Questions