How to make a column of set of lists in python?
I can give the answer of my question i think.
Suppose i have a dataset called XYZ, It has @ column A,B. Now i want to add one more column C which is a set of lists ie, there are same number of lists as number of rows.
XYZ = pd.read_csv('untitled.csv', usecols = ['A', 'B']) XYZ['C'] = pd.Series([]*len(XYZ), dtype = object) for i in range(len(XYZ)): XYZ['C'][i] = []
I have a data frame in hand, now i want to add one more column in that data frame. that column will be a set of lists, ie, if the length of the data frame is 10, the column will be set of 10 lists. Each row associate with one list. How can i make this? And initially those lists will be blank list so that i can append objects further.