In this article, we will see how to take input in nested list in Python. Suppose we want to take an input as shown below: [[‘Aby’, 21], [‘Brandon’, 26], [‘Dany’, 34]] Let’s see the code first and understand what is …
In Python, the absolute value can be found using the built-in method abs(). This function returns the absolute value of the input given to it. The argument given can be an integer, a float number or a complex number. Output:
In this article, we will learn to swap two variables in Python. Method 1: Output: Method 2: Output: Method 3: Output:
In this article, we will learn to store user input in dictionary in Python. You can input both keys and values using input() method and process it to separate the keys and values. Output:
Python is an easy to learn, flexible, interpreted, high-level programming language. In this article, we will see how to start Python in Windows. If you have not installed Python in your system, check out the installation article on the site. …
In this article, we will discuss standardization of data with scikit-learn. Often when working with datasets for data science, we may need to standardize our dataset before fitting a machine learning model to it. Standardization refers to shifting the distribution …
The sort() is a built-in python function for sorting. In this article, we will see how to sort number in Python without sort function. Output:
Python lists have a built-in list.sort() method that modifies the list. There is also a sorted() built-in function that builds a new sorted list from an iterable. In this article, we will see the various techniques for sorting data using Python. sorted() This built-in …
A dictionary in Python is a collection of items that stores data as key-value pairs. We have used the sorted() function and lambda for sorting the dictionary by values Output:
We can use the sort_values() function in Pandas to sort a Pandas DataFrame. In this article, we will learn to sort a dataframe in many ways. We are performing the sorting in the below dummy data. 1. Sort Pandas DataFrame in …