I have a list of string labels. i want to keep the substring of very element before the second "." and remove all characters after the second ".".
I found post that show how to do this with a text string using the split function. However, the list datatype does not have a split function. The actual data type is a pandas.core.indexes.base.index which appears to be a list to me.
For the first element in the list, I want to keep L1.Energy and remove everything after the second ".".
current_list = ['L1.Energy.Energy', 'L1.Utility.Energy', 'L1.Technology.Utility', 'L1.Financial.Utility']
desired_list = [L1.Energy', 'L1.Utility', 'L1.Technology,'L1.Financial']