Skip to content

clean or remove header format after convert to excel #26774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yyz20002008 opened this issue Jun 10, 2019 · 3 comments
Closed

clean or remove header format after convert to excel #26774

yyz20002008 opened this issue Jun 10, 2019 · 3 comments
Labels
Duplicate Report Duplicate issue or pull request

Comments

@yyz20002008
Copy link

Code Sample, a copy-pastable example if possible

`import pandas as pd
import pandas.io.formats.excel
mypath = <Filepath>
#print(mypath)
from os import listdir
from os.path import isfile, join
#print (listdir(mypath))
textfiles = [ join(mypath,f) for f in listdir(mypath) if '.TXT' in  f]

print(textfiles)

for textfile in textfiles:
    df = pd.read_csv(textfile,sep='|', dtype=str)
    #df.dtypes
    #df.ROW = df.ROW.astype(str)
    df.io.formats.excel.header_style = None
    filename=textfile.split('.')[0]
    df.to_excel(filename+'.xlsx', 'Sheet1', index=False) # if your file is tab delimited
    
    `

Problem description

'df.io.formats.excel.header_style = None' doesn't work any more.

Expected Output

How can I clean header format after convert to excel.

Output of pd.show_versions()

Currently header is bold and has a border.

@yyz20002008
Copy link
Author

I read #22773 and #25398.It seems like no good solution yet

@WillAyd
Copy link
Member

WillAyd commented Jun 10, 2019

This is a dup of the other issue you commented on. Would need a community PR to make this happen

@WillAyd WillAyd added the Duplicate Report Duplicate issue or pull request label Jun 10, 2019
@WillAyd WillAyd closed this as completed Jun 10, 2019
@yyz20002008
Copy link
Author

@WillAyd does pandas have this functionality right now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants