-1
I am trying to play the content of a dataset on an scv, however the parameter SEP =';' stopped working.
df.to_csv(path,r'\20191122_Consolidados_camara_de_retencao.csv', sep = ';')
When trying to run Python command line gives the following error:
to_csv() got multiple values for argument 'sep'
Someone has already been through this problem ? Can you help me understand the mistake ?
Thank you.
The second parameter of
to_csv
already is thesep
, then you are passing a value by the position,r'\20191122_Consolidados_camara_de_retencao.csv'
, and another by the named parameter,sep = ';'
. That is, the function call is wrong. I recommend that you review the documentation and see how to properly do what you need.– Woss
Thank you for the comment Woss, but could you give me an example of how I would pass a separate < ; > in this case ? I even looked at the documentation and in the example this passing the separator as I did. I was confused. rs
– Adam Lincoln
What is
path
andr'\20191122_Consolidados_camara_de_retencao.csv'
which also passed parameters?– Woss
path = os.chdir('C: Users ADAMLINCOLNOLIVEIRAS Box Sync Director_camara_de_retencao') e r' 20191122_Consolidados_camara_de_retencao.csv' is the file name I want the file to have as far as I know.
– Adam Lincoln
But why pass two paths to the function? You should not concatenate them and ride only one way?
– Woss
is why PATH is the path to the folder where other files are. With the command (path, r' 20191122_Consolids_camara_de_retencao.csv') I’m actually mounting a path only: C: Users ADAMLINCOLNOLIVEIRAS Box Sync Director_camara_de_retencao + /20191122_Consolidados_camara_de_retencao.csv This worked before, but Pandas updated and now this different.
– Adam Lincoln
No, you are passing the two valroes separately to the function, the second being considered as
sep
. If you want to concatenate, use the operator+
– Woss
Let’s go continue this discussion in chat.
– Adam Lincoln