Pradeep Elance has Published 417 Articles

Add style to Python tkinter button

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 06:22:39

3K+ Views

Tkinter has great support for creating the GUI programs based on python. It offers different ways of styling a button on the Tkinter canvas based on its font, size, colour etc. In this article we will see how to apply style to specific buttons or all buttons in general on ... Read More

Python - Filtering data with Pandas .query() method

Pradeep Elance

Pradeep Elance

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

2K+ Views

Pandas is a very widely used python library for data cleansing, data analysis etc. In this article we will see how we can use the query method to fetch specific data from a given data set. We can have both single and multiple conditions inside a query.Reading the dataLet’s first ... Read More

Python - Filter out integers from float numpy array

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 08:36:16

507 Views

As part of data cleansing activities, we may sometimes need to take out the integers present in a list. In this article we will have an array containing both floats and integers. We will remove the integers from the array and print out the floats.With astypeThe astype function will be ... Read More

Python - Filter dictionary key based on the values in selective list

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 08:34:33

2K+ Views

Sometimes in a Python dictionary we may need to to filter out certain keys of the dictionary based on certain criteria. In this article we will see how to filter out keys from Python dictionary.With for and inIn this approach we put the values of the keys to be filtered ... Read More

Python - fabs() vs abs()

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 08:32:37

1K+ Views

Both abs() and fabs() represent the mathematical functions which give us the absolute value of numbers. But there is a subtle difference between both of them which we can explore in the exmaples below.ExampleThe abs() functions returns the absolute value as an integer or floating point value depending on what ... Read More

Python - end parameter in print()

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 08:30:56

1K+ Views

The print() function in python always creates a newline. But there is also a parameter for this function which can put other characters instead of new line at the end. In this article we will explore various options for this parameter.ExampleIn the below example we see various ways we can ... Read More

Python - Difference in keys of two dictionaries

Pradeep Elance

Pradeep Elance

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

3K+ Views

Two python dictionaries may contain some common keys between them. In this article we will find how to get the difference in the keys present in two given dictionaries.With setHere we take two dictionaries and apply set function to them. Then we subtract the two sets to get the difference. ... Read More

Python - Create a dictionary using list with none values

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 08:23:09

663 Views

Suppose you are given a list but we want to convert it to dictionary. Dictionary elements hold two values are called key value pair, we will use in case of value. The elements of the list become keys and non will remain a placeholder.With dictThe dict() constructor creates a dictionary ... Read More

Python - Convert given list into nested list

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 08:19:44

1K+ Views

There may be a situation when we need to convert the elements in the list into a list in itself. In other words, create a list which is nested as its elements are also lists.Using iterationThis is the novel approach in which we take each element of the list and ... Read More

Broadcasting with NumPy Arrays in Python

Pradeep Elance

Pradeep Elance

Updated on 22-Jul-2020 08:15:47

237 Views

We know the arithmetic operations between different arrays happens monthly if the arrays are of equal size awesome required specific size. But there are scenarios when we can take erase of unequal size and still apply arithmetic operations on them by enhancing one of the arrays by filling array with ... Read More

Advertisements