Skip to content
Advertisement

Get rid of characters when writing a dataframe to postgress

I have a large script that saves data to a postgres database. Tell me how can I get rid of [‘ and ‘]. I need the data in the storage to be saved without these characters

JavaScript

This is how the data looks in the database

JavaScript

Tell me how to get rid of these characters, perhaps the problem occurs after parsing when writing to a dataframe. It is necessary to get rid of the first [‘ and ‘], the following brackets must be left Help please

this is an example of how i would like the data to look like

JavaScript

Replace doesn’t help.

Advertisement

Answer

Try map with specific column and add lstrip and rstrip in lambada

JavaScript

Hope this will work for you.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement