Pradeep Elance has Published 417 Articles

Bisect Algorithm Functions in Python

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 08:12:31

231 Views

This module provides support for maintaining a list in sorted order without having to sort the list after each insertion of new element. We will focus on two functions namely insort_left and insort_right.insort_leftThis function returns the sorted list after inserting number in the required position, if the element is already ... Read More

Avoiding class data shared among the instances in Python

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 08:06:41

145 Views

When we instantiate a class in Python, all its variables and functions also get inherited to the new instantiated class. But there may be e occasions when we do not want some of the variables of the parent class to be inherited by the child class. In this article, we ... Read More

Average of each n-length consecutive segment in a Python list

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 07:53:06

352 Views

We have a list containing only numbers. We plan to get the average of a set of sequential numbers from the list which keeps rolling from the first number to next number and then to next number and so on.ExampleThe below example simplifies the requirement of finding the average of ... Read More

asksaveasfile() function in Python Tkinter

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 07:49:40

1K+ Views

TKinter is a Python module which is used for GUI programming in Python. We create a Canvas and place our UI components with many properties and behaviors in it. In this article, we will see e how to use the ask essay file function to save files created through Python ... Read More

Arithmetic operations in excel file using openpyxl in Python

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 07:45:19

406 Views

Python can help us use excel files directly from the python environment. We can refer to the each cell or a range of cells in excel and apply arithmetic operators on those cells. The results of those operations can also be stored at some cells whose location can be specified ... Read More

Python - Contiguous Boolean Range

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:36:51

337 Views

Given a list of values, we are interested to know at which position are the Boolean values present as a contiguous list. Which means after we encounter a value which is TRUE there is a continuous value of true from that position until FALSE value is found. Similarly when a ... Read More

Python - Column deletion from list of lists

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:34:40

1K+ Views

In a list of lists an element at the same index of each of the sublist represents a column like structure. In this article we will see how we can delete a column from a list of lists. Which means we have to delete the element at the same index ... Read More

Python - Check if given words appear together in a list of sentence

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:32:49

1K+ Views

Say we have a list containing small sentences as its elements. We have another list which contains some of the words used in this sentences of the first list. We want to find out if two words from the second list are present together in some of the sentences of ... Read More

Python - Check if all elements in a list are identical

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:30:02

928 Views

There may be occasions when a list will contain all the values which are same. In this article we will see various way to verify that.With allWe use the all function to find the result of comparison of each element of the list with the first element. If each comparison ... Read More

Python - Check if a list is contained in another list

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:28:07

1K+ Views

Given two different python lists we need to find if the first list is a part of the second list.With map and joinWe can first apply the map function to get the elements of the list and then apply the join function to cerate a comma separated list of values. ... Read More

Advertisements