Skip to content
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

writeheader=true ineffective in combination with header= #1085

Open
RossBoylan opened this issue May 4, 2023 · 0 comments
Open

writeheader=true ineffective in combination with header= #1085

RossBoylan opened this issue May 4, 2023 · 0 comments
Labels

Comments

@RossBoylan
Copy link

ofile = open("mycsv.csv", "w")
# various regular writes to ofile
# clus a DataFrame
CSV.write(ofile, clus, header=["truez", "id", "sumY", "zhat"], append=true, writeheader=true )
close(ofile)

Did not write any headers to the file. Deleting the header= argument and using
rename!(clus, ["truez", "id", "sumY", "zhat"] did result in the headers being written to the file.

CSV v0.10.9
Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 20 × Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, broadwell)
Threads: 16 on 20 virtual cores
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS =

RossBoylan added a commit to ucsf-deb/BP-MSEP that referenced this issue May 11, 2023
The csv file has the outputs.
Found a bug in the CSV package: CSV.write() outputs no headers if
CSV.write(ofile, clus, headers=["truez", "id", "sumY", "zhat"], append=true, writeheader=true )
hence the use of rename! in the code.
Filed bug JuliaData/CSV.jl#1085 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants