Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

Write Word Doc (or docx) from a list of series in python

$
0
0

Primary Category | Comments A | Comments B | Company Apple | Good taste| I like it | ABC Company Banana | awesome | taste better than apple | XYZ Company Apple | Don't like it| it is cheap | ABC Company Apple |is read | round shape |XYZ Company Banana |good | affordable | ABC Company ... ... so on

I wanted to convert the above DataFrame into paragraphs and exported the word docs with the plots I have already saved.

Ideally, the plots would come first in the word documents, and the paragraphs would be like: ABC Company said: Apple - Primary Category Comments A Comments A Comments B Comments B

Banana - Primary Category Comments A Comments A

and another paragraph XYZ Company said: Apple - Primary Category Comments A Comments A Comments B Comments B Banana - Primary Category Comments A Comments A

I have tried to export the DataFrame to excel but that's not what I wanted, I've tried to filter the data first and put them into series

but I just don't know how I can combine the series and write into a new generated word doc.

abc_apple_comments= overall_comments[overall_comments['Primary_Category'].isin(['Apple']) & (overall_comments['Company'].isin(['ABC']))]

Basically it is a DataFrame with all text and wanted to sort then by company first and them primary category and then all the comments in comments a and then comments b and so on and convert the series into a word document.


Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>