I have created a dataframe like this from a list.
Name
0 Security Name % to Net Assets* DEBENtURES 0.04
1 Britannia Industries Ltd. EQUity & RELAtED 96.83
2 HDFC Bank 6.98
3 ICICI 4.82
4 Infosys 4.37
using df = pd.DataFrame(list1, columns=['Name'])
I want to split Name in another such that the dataframe looks like this:
Name value
0 Security Name % to Net Assets* DEBENtURES 0.04
1 Britannia Industries Ltd. EQUity & RELAtED 96.83
2 HDFC Bank 6.98
3 ICICI 4.82
4 Infosys 4.37
I tried doing something like df = pd.DataFrame(df.row.str.split(",", 1).tolist(), columns=["Security Name", "Weights"]) however it gave an error like AttributeError: 'DataFrame' object has no attribute 'row'
How exactly do I split a column such that I get another column? Please help