Category : dataframe

I have dataframe in below format import pandas as pd df=pd.DataFrame({‘From’: [‘A’,’B’,’C’,’A’,’C’,’D’,’E’], ‘To’:[‘B’,’C’,’A’,’C’,’D’,’E’,’C’], ‘User’:[1,1,1,1,1,1,1]}) I want to extract all possible journeys for a user. Expected output: [A],[B],[C],[D],[E],[A,B],[B,C],[C,A],[A,C],[C,D],[D,E],[E,C],[A,B,C],[B,C,A]………… I tried heuristic model, i get the graph, but i am not able to convert into tabular data. How can i achieve this using python operations or by ..

Read more