I have the below df that I am trying to create a comma delimeted list from based on the values in the "combined_sector" column. The result should look like the following:
IG Credit: Financials - Lehman Sector: '46647PAY2', '36164QMS4','36164QMS4'
High Yield: Industrials - Lehman Sector: '26112TAJ5','29273VAD2'
cusip sector_path_0 sector_path_1 sector_path_2 combined_sector
0 46647PAY2 FMBI UNIV Breakdown IG Credit Financials - Lehman Sector IG Credit: Financials - Lehman Sector
1 36164QMS4 FMBI UNIV Breakdown IG Credit Financials - Lehman Sector IG Credit: Financials - Lehman Sector
2 948741AH6 FMBI UNIV Breakdown IG Credit Financials - Lehman Sector IG Credit: Financials - Lehman Sector
3 26112TAJ5 FMBI UNIV Breakdown High Yield Industrials - Lehman Sector High Yield: Industrials - Lehman Sector
4 29273VAD2 FMBI UNIV Breakdown High Yield Industrials - Lehman Sector High Yield: Industrials - Lehman Sector
Is it possible to select which columns to use df['column'].values.tolist()
on? Meaning, can i select which columns to create a list from?