Use GroupBy.size with sort=False if order is important:
s = df.groupby('Product_Description', sort=False).size()
print (s)
Product_Description
MSSQL 2
INFORMATICA 3
DBA 1
dtype: int64
v_1 = s.index.tolist()
v_2 = s.values.tolist()
print (v_1)
['MSSQL', 'INFORMATICA', 'DBA']
print (v_2)
[2, 3, 1]
If order should be different, e.g. Series.value_counts ordering by number of occurencies:
s = df['Product_Description'].value_counts()
print (s)
INFORMATICA 3
MSSQL 2
DBA 1
Name: Product_Description, dtype: int64
v_1 = s.index.tolist()
v_2 = s.values.tolist()
print (v_1)
['INFORMATICA', 'MSSQL', 'DBA']
print (v_2)
[3, 2, 1]
Another solution is create dictionary of lists:
df1 = df.groupby('Product_Description', sort=False).size().reset_index()
df1.columns=['v_1','v_2']
print (df1)
v_1 v_2
0 MSSQL 2
1 INFORMATICA 3
2 DBA 1
d = df1.to_dict(orient='list')
print (d)
{'v_1': ['MSSQL', 'INFORMATICA', 'DBA'], 'v_2': [2, 3, 1]}
print (d['v_1'])
['MSSQL', 'INFORMATICA', 'DBA']
print (d['v_2'])
[2, 3, 1]
pandasseries(pd.Series) objects whereID Numberis theIndex.name?