• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: convert pandas data frame column values into comma separated strings

Resolved: convert pandas data frame column values into comma separated strings

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

i have a data frame that looks like this:
Although the items in Column1 look like lists of items, they are strings. I want to remove the square brackets from this string, remove the quotes and replace all values in that column with the same values but as comma separated strings. My desired output would be:
I tried the following function but it does not replace the elements:
Can anyone help me with this? Thanks in advance.

Answer:

As desired, one of the options to convert a string in the mold of a list into a real list to separate the values by comma is:
Output:
Greetings from Brazil!

If you have better answer, please add a comment about this, thank you!

pandas python string
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: correct policy to get secrets on local go app

22/03/2023

Resolved: Vue 3 watchEffect dependency tracking after asynchronous code

22/03/2023

Resolved: Watching state object in pinia doesn’t fire when object changes

22/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.