DimaKudosh / pydfs-lineup-optimizer

Daily Fantasy Sports lineup optimzer for all popular daily fantasy sports sites
MIT License
418 stars 156 forks source link

FanDuel Golf #250

Open will6809 opened 3 years ago

will6809 commented 3 years ago

My exporter.csv file prints the lineups every other line when i open it excel lineups.xlsx

. How can i fix this

lightninglarry commented 3 years ago

While this doesnt fix the code, if you select your whole data in excel and select remove duplicates it will leave just one blank row at the top of the data, but then erases all other blank rows. Its how ive been getting around this for golf.

sansbacon commented 3 years ago

If you are using a python library, then remove the whitespace with python after you generate the file (assuming it is named result.csv)

with open('result.csv','rw') as file:
    for line in file:
        if not line.isspace():
            file.write(line)

The underlying issue likely occurs due to an issue in the python csv library. If you want to correct the issue, then change line 27 of lineup_exporter.py from

with open(filename, 'w') as csvfile:

to

with open(filename, 'w', newline='') as csvfile:
DimaKudosh commented 3 years ago

@will6809 Could you provide code sample how do you export? I don't see blank lines when I'm using export