Something like:
>>> l = ['element1\t0238.94', 'element2\t2.3904', 'element3\t0139847']
>>> [i.split('\t', 1)[0] for i in l]
['element1', 'element2', 'element3']
More Related Contents:
- How do you split a list into evenly sized chunks?
- How to split a string into a list?
- Split a Pandas column of lists into multiple columns
- Split a string by a delimiter in python
- Splitting a list based on a delimiter word
- How do I split a list into equally-sized chunks?
- Split list into smaller lists (split in half)
- How do I split a string into a list?
- Splitting on last delimiter in Python string?
- Python split string into multiple string [duplicate]
- How to split strings inside a list by whitespace characters
- Convert string to list. Python [string.split() acting weird]
- Attribute Error: ‘list’ object has no attribute ‘split’
- Convert list of strings to dictionary
- How to transform string of space-separated key,value pairs of unique words into a dict
- How do I split a string into a list of words?
- How to split by comma and strip white spaces in Python?
- python list by value not by reference [duplicate]
- Access multiple elements of list knowing their index
- Appending the same string to a list of strings in Python
- Are tuples more efficient than lists in Python?
- Appending to the same list from different processes using multiprocessing
- How to use python numpy.savetxt to write strings and float number to an ASCII file?
- Checking if any elements in one list are in another [duplicate]
- python: most elegant way to intersperse a list with an element
- Converting a string that represents a list, into an actual list object
- how to keep elements of a list based on another list [duplicate]
- Flatten an irregular (arbitrarily nested) list of lists
- How to concatenate (join) items in a list to a single string
- Ellipsis lists […] and concatenating a list to itself [duplicate]