These are chat archives for EntilZha/PyFunctional

12th
Jun 2017
Pedro Rodriguez
@EntilZha
Jun 12 2017 00:09
@Bennyelg Did you try passing mode='wa'. Those are passed to open which if I recall correctly opens the file in append mode
Benny Elgazar
@Bennyelg
Jun 12 2017 11:24
map(lambda cell: [cell, cell_level, user_input.area_name]).to_csv('/tmp/test.csv' ,mode='wa').
File "/usr/local/lib/python2.7/dist-packages/functional/pipeline.py", line 1498, in to_csv
with universal_write_open(path, mode=mode, compression=compression) as output:
File "/usr/local/lib/python2.7/dist-packages/functional/io.py", line 221, in universal_write_open
newline=newline)
ValueError: must have exactly one of read/write/append mode
map(lambda cell: [cell, cell_level, user_input.area_name]).to_csv('/tmp/test.csv' ,mode=u'a').
File "/usr/local/lib/python2.7/dist-packages/functional/pipeline.py", line 1501, in to_csv
csv_writer.writerow([six.u(str(element)) for element in row])
TypeError: must be unicode, not str
Pedro Rodriguez
@EntilZha
Jun 12 2017 15:56
Sorry, try just 'a'