Pradeep Elance has Published 417 Articles

Python - Check if all the values in a list are less than a given value

Pradeep Elance

Pradeep Elance

Updated on 03-Mar-2020 06:12:29

1K+ Views

In python data analysis, we sometime face a situation where we need to compare a given number with a list containing many values. In this article we need to fins if a given number is less than each of the values present in a given list. We are going to ... Read More

Possible Words using given characters in Python

Pradeep Elance

Pradeep Elance

Updated on 03-Mar-2020 06:11:04

849 Views

In this article we are going to see a python program that will give output of possible words from a given set of characters. Here we are taking a list as an input which will contain the set of reference words and another list containing the characters from which the ... Read More

Accessing all elements at given Python list of indexes

Pradeep Elance

Pradeep Elance

Updated on 03-Mar-2020 05:31:23

342 Views

We can access the individual elements of a list using the [] brackets and the index number. But when we need to access some of the indices then we cannot apply this method. We need the below approaches to tackle this.Using two listsIn this method, along with the original list, ... Read More

Python - Convert column to separate elements in list of lists

Pradeep Elance

Pradeep Elance

Updated on 26-Feb-2020 08:11:19

305 Views

In analyzing data or processing data using python, we come across situations where the given list has to be remodeled or reshaped to get lists with different columns. We can achieve that with multiple approaches as discussed below.Using SlicingWe can slice the list at certain elements to create the columnar ... Read More

Python - Convert a set into dictionary

Pradeep Elance

Pradeep Elance

Updated on 26-Feb-2020 08:06:33

3K+ Views

Python provides lot of flexibility to handle different types of data structures. There may be a need when you have to convert one Data Structure to another for a better use or better analysis of the data. In this article we will see how to convert a Python set to ... Read More

How to print double quotes with the string variable in Python?

Pradeep Elance

Pradeep Elance

Updated on 26-Feb-2020 07:54:40

14K+ Views

Printing double quotes is tricky, as it itself is required as part of syntax to print the strings by surrounding them. In this article we will see how these double quotes can be printed using print statement.The below scenarios will not print the double quote. The first two lines of ... Read More

Bigram formation from given a Python list

Pradeep Elance

Pradeep Elance

Updated on 26-Feb-2020 07:42:18

820 Views

A bigram is formed by creating a pair of words from every two consecutive words from a given sentence. In python, this technique is heavily used in text analytics. Below we see two approaches on how to achieve this.Using enumerate and splitUsing these two methods we first split the sentence ... Read More

Avoiding quotes while printing strings in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Feb-2020 07:39:41

182 Views

If we print a given list of strings as it is, we have to use quotes and fill in a pair of matching quotes appropriately. We can avoid using quotes in the print statements by following two approaches.Using join()The join method helps us in printing the output of list elements ... Read More

askopenfile() function in Python Tkinter

Pradeep Elance

Pradeep Elance

Updated on 26-Feb-2020 07:36:06

2K+ Views

Instead of hard coding the path to a file to be used by a python program, we can allow the user to browse the os folder structure using a GUI and let the user select the file. This is achieved using the tkinter module in which we define a canvas ... Read More

How to Watch TCP and UDP Ports in Real-time in Linux?

Pradeep Elance

Pradeep Elance

Updated on 25-Feb-2020 06:34:33

1K+ Views

In a computer network, the network service runs a software in each of the computers that are part of the network. In Linux System this network software uses a protocol called TCP or UDP along with port number. TCP is known as transmission control protocol and UDP is known as ... Read More

Advertisements