Relative Content

Tag Archive for pythonpandasdataframeanalysis

How to find the change in characters while comparing 2 strings from 2 columns of the dataframe using python?

For example, I have a string from one of the column of the dataframe as “BHEEMAVARAM GANGADHRAM” and other string from the other column of the same dataframe as “B GANGADHRAM” , I want to separate the strings from each row of these 2 columns whenever “space” character appears and store them in 2 separate lists and comparing these 2 lists whether they have the similar item exists in the list and if item exists then iterating over the characters to find out the difference in the characters. Please write a script code in python and store the difference of the count in a dataframe. Splitting the string after each space character and storing the strings in 2 separate lists. What changes I need to made in the below code and require to find out in which word the character is changed.