Ask Your Question

Pandas in Sage : how to remove elements when the name of the column has white spaces inside it.

asked 2020-08-23 13:27:05 -0500

anonymous user


updated 2020-08-23 14:33:57 -0500

I am using Pandas from Sage and I have a stupid problem. I have a data bases whose column titles incorporate some "space characters" like Sortie de Chais 2019. Unfortunately, there is also a column untitled Sortie de Chais 2018 so I cannot use only Sortie as the name of the column. So a command like

df = df[df.Sortie de Chais 2019 != 0]

could not do the job. Of course if the name was Sortie_de_Chais_2019, the problem would disapear. But I cannot change the titles of the data base directly. I know the number of the column (in this case 26). So how can I manage my problem ?

Thanks for help

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-08-23 15:54:47 -0500

Cyrille gravatar image

The following URL gives the answer.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-08-23 13:27:05 -0500

Seen: 57 times

Last updated: Aug 23