It is possible to set directories using adding the root to the file such as
follows:

import pandas as pd

## df is a DataFrame

df.to_csv('001.csv',sep=',',index=False,header=False) ## the file is saved
in the predetermined directory.
df.to_csv('C:\MyWorksInPython\001.csv',sep=',',index=False,header=False)
## the file is saved in  'C:\MyWorksInPython\

You may use a new directory if you would use many files.

By the way, take care with the direction of the symbol '\'.

Regards

On Wed, Jun 10, 2020 at 11:04 PM Austin Peña <[email protected]>
wrote:

> Every time I create a new file, it creates it in the /tmp directory. And
> then when I go to save it, I can only save it via a "very long" relative
> path. What's the recommended workflow?
>
> --
> You received this message because you are subscribed to the Google Groups
> "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/spyderlib/2b4c0887-c49b-42a5-a4b6-dbfb70e305f1o%40googlegroups.com
> <https://groups.google.com/d/msgid/spyderlib/2b4c0887-c49b-42a5-a4b6-dbfb70e305f1o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

Atentamente,
Mauricio Azálgara Bedoya

Dirección: 120 Calle Lima | Int. A-1, Yanahuara

                   04017 Arequipa

                   PERU

Móvil: ++51 998 050 690

Teléfono: ++51 54 317 803

Cuenta Skype: mazalgarab

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/spyderlib/CAFXHJR%3DyQ4Bjyo9u0Abz%3DjU44QiPh0cr%3DaZ5qj_Op4D9g_F_uQ%40mail.gmail.com.

Reply via email to