I read data from mssql and as in data format below:
from pandas import DataFrame
import pandas as pd
data = pd.DataFrame({'Index':[1,2],'Metrics':["
['ga:users','ga:newUsers']","['ga:bounceRate','ga:pageviews']"]})
What I need is list of each row dimension column:
list1= ['ga:users','ga:newUsers']
list2=['ga:bounceRate','ga:pageviews']
below what I tried but :
Metrics1=data.loc[data['Index']==1,'Metrics'].iloc[0][1:-1].split(', ')
I got some extra "
["'ga:users','ga:newUsers'"]
How can I fix this please help? Thank you