You want to sort based on the
float values (not string values), so try:
>>> b = ["949.0","1099.0"] >>> b.sort(key=float) >>> b ['949.0', '1099.0']
More Related Contents:
- Piping and forking in python
- Mirror individual words in a sentence, but not the sentence itself
- pip install from git repo branch
- Pythonic way to combine two lists in an alternating fashion?
- What is a “slug” in Django?
- How to manage local vs production settings in Django?
- Simplify Chained Comparison
- Abstract attributes in Python [duplicate]
- Unable to reverse lists in Python, getting “Nonetype” as list
- ImportError: No Module Named bs4 (BeautifulSoup)
- How to read file with space separated values in pandas
- What does model.eval() do in pytorch?
- How to find a Python package’s dependencies
- How can I create a tmp file in Python?
- Python raw strings and trailing backslash [duplicate]
- Writelines writes lines without newline, Just fills the file
- How do you uninstall a python package that was installed using distutils?
- Find index where elements change value numpy
- How do comparison operators < and > work with a function as an operand?
- Editing the date formatting of x-axis tick labels
- How to split an integer into a list of digits?
- Playing note with pygame.midi
- parsing a fasta file using a generator ( python )
- Converting a 2D numpy array to a structured array
- “Failed to load HostKeys” warning while connecting to SFTP server with pysftp
- Big Sur clang “invalid version” error due to MACOSX_DEPLOYMENT_TARGET
- Pandas: parse merged header columns from Excel
- Python silent print PDF to specific printer
- Determining the most contributing features for SVM classifier in sklearn
- matplotlib taking time when being imported