Skip to content
  • YouTube
  • FaceBook
  • Twitter
  • Instagram

Data Analytics Ireland

Data Analytics and Video Tutorials

  • Home
  • Contact
  • About Us
    • Latest
    • Write for us
    • Learn more information about our website
  • Useful Links
  • Glossary
  • All Categories
  • Faq
  • Livestream
  • Toggle search form
  • how to select columns with SQL SQL
  • Python Tutorial: Pandas groupby columns ( video 2) Python
  • What Is An Array In Python? array
  • raise an exception in python class
  • ValueError: invalid literal for int() with base 10 Value Error
  • TypeError: List Indices Must Be Integers Or Slices, Not Tuple exceptions
  • Tableau Desktop versus Tableau Server data visualisation
  • R Tutorial: How to pass data between functions R Programming

Python Tutorial: How to sort lists

Posted on April 20, 2020May 3, 2021 By admin No Comments on Python Tutorial: How to sort lists

Estimated reading time: 2 minutes

Following on from our post on how to use Python lists have you ever wondered how to sort lists for your Python project?

Our latest video on lists will go through some of the techniques available so that you can get an idea of how to structure your data and sort.

Getting to understand how to implement

In this latest video we will look at:

  • sort() method
  • sorted() function
  • sorting a list through a function

 

Adding in those extra bits to help make the process smoother

Have you thought about sorting ascending/descending?

  • There is also a discussion on this topic as well, and while an index is available for the list, which you may feel does not merit sorting, there could be other logical reasons to implement sorting.
  • Leaving out the reverse = True/False in the sorted method can have an impact, though if you require it left out of the list you have created, automatic ascending will be the default.

On this channel, we have discussed a number of different ways to manage your data. In thinking about sorting a list, why would you want to do this?

Some common reasons are:

  • To visually see if there are duplicates, either on the screen or printed out.
  • If other objects are dependant on the list, say a combo box, then having duplicates visible can help to reduce the size of their contents.
  • Iteration – If you are looking to iterate over a list, it will be quicker if it is sorted.

If you want to learn about lists, using them, and how how they can be iterated over, why not visit Data Analytics Ireland YouTube channel, there are lots of videos there that will help explain the concepts discussed here further.

To get some more links on this topic click here python sort method, it is a blog posting from our website that has some useful links and explanations for you.

Python Lists, Python Tutorial Tags:Learn python, Learn python online, list, Python List, Python Tutorial, Sort lists

Post navigation

Previous Post: data cleansing in a business environment
Next Post: Python Tutorial: How to import data from files

Related Posts

  • How to check if a file is empty Python
  • How to data cleanse a database table Python Data Cleansing
  • How to import data into excel Python Tutorial
  • How To Delete a Set of Keys From a Python Dictionary python dictionaries
  • How To Check For Unwanted Characters Using Loops With Python Python Data Cleansing
  • How to Create an XML file from Excel using Python Python

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Select your language!

  • हिंदी
  • Español
  • Português
  • Français
  • Italiano
  • how to remove spaces from a string regular expressions
  • How to save data frame changes to a file Python Dataframe
  • What is data analytics and why it is important Articles
  • How to Group By in a Select Statement SQL
  • ValueError: invalid literal for int() with base 10 Value Error
  • How to count the no of rows and columns in a CSV file CSV
  • How to show percentage differences between files in Python CSV
  • how to add sine and cosine in python code numpy

Copyright © 2023 Data Analytics Ireland.

Powered by PressBook Premium theme

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT