• 07 January

    How to compare lists in Python

    In this post, we will see how to compare lists in Python. Python compare lists Lists in Python are mutable and can store a finite number of elements. We cannot determine whether a list is greater or less than any other list based on general criteria. So when we talk about comparing lists, we mean […]

  • Python List of dictionaries
    09 December

    List of Dictionaries in Python

    We use both lists and dictionaries in our python programs. Lists are used to store atomic objects while dictionaries store key-value pairs. In this article, we will discuss how we can create a list of dictionaries in python. We will also discuss ways to search records in a list of dictionaries and also to sort […]

  • Python sort list of lists
    17 November

    Sort List of Lists in Python

    Several times we use 2-D lists or lists of lists in our programs to represent a table or matrix. When these tables need to be sorted according to some value, we need to sort the entire list of lists. In this article, we will discuss different approaches to sort a list of lists in python. […]

  • Remove nan from list in Python
    16 November

    Remove nan From List In Python?

    In python, nan is a special value used to represent missing values. In this article, we will discuss the properties of nan values. We will also look at different ways how we can remove nan values from list in python. What is nan in python? The nan values are special floating-point numbers defined in the […]

  • Initialize list with zeros in Python
    25 October

    Four Ways To Initialize List With Zeros In Python

    Lists in Python are one of the most used data structures.  In this article, we will first discuss why we should initialize a list with zeros in Python. This will give us an insight into how different ways of creating lists in python can lead to different usage of memory. After that, we will discuss […]

  • 06 October

    How to find index of all occurrences in list in Python

    List is a data type in Python. It is used to store multiple values in one variable. If you want to find out how many times a certain element shows up in a list and where – you’ve come to the right place. In this tutorial, we’ll show you how to find index of all […]

  • Convert list to matrix in Python
    21 August

    Convert list to matrix in Python

    Python provides some in-built data types to stock multiple items in a single variable. A List is one among these built-in data types. However, performing mathematical functions on lists is impossible due to which we need to convert the given lists to matrices or arrays in order to allow the successful performance of certain mathematical […]

  • List intersection in Python
    11 November

    List intersection in python

    A list is one of Python’s fundamental in-built data types and clusters several items in a single variable. In this article, we will demonstrate the different ways available to retrieve the list intersection in Python. What is the list intersection in Python? The intersection of two lists returns the elements that are present in both […]

  • Sort list alphabetically in Python
    31 May

    Sort list alphabetically in Python

    💡 Outline You can use sort() method of list to sort list alphabetically in Python [crayon-61e58d84bfa56263294578/] In this tutorial, we will discuss different ways to sort a list namely using the sort() function, sorted() function, and implementing the quick sort algorithm. Use of the sort() function to sort list alphabetically in Python. The sort() method […]