Gireesha Devara

Gireesha Devara

173 Articles Published

Articles by Gireesha Devara

Page 5 of 18

Top Hat and Black Hat Transform using OpenCV Python

Gireesha Devara
Gireesha Devara
Updated on 30-May-2023 3K+ Views

Top Hat and Black Hat Transforms are the Morphological transformations operations on the binary images. Generally, the morphological operations process the image based on the morphology, structure, or shape. Top-hat transform is an operation that opens an image and then subtracts it from the original image (top hat = image - opening). It is used to extract small elements and details from given images which is nothing but feature extraction, image enhancement, and other operations. Whereas the Black Hat Transform operation is nothing but the difference between an image closing and the input image itself (black hat = closing ...

Read More

Conversion between binary, hexadecimal and decimal numbers using Coden module

Gireesha Devara
Gireesha Devara
Updated on 30-May-2023 262 Views

The coden is a python library developed by Tanmay Earappa, which is used for secret codes (decoding and encoding secret codes). This module provides functionalities to do the code conversions. Following are few functions and their functionalities provided by this module – coden.secret(): It is used for decode or encode the secret codes based on the input of the mode parameter. hex_to_bin(): It will do the Hexadecimal to Binary conversion. int_to_bin(): It will do the Decimal to Binary conversion. int_to_hex(): It will do the Decimal to Hexadecimal conversion Install Coden with pip With the pip command we can ...

Read More

Conversion Functions in Pandas DataFrame

Gireesha Devara
Gireesha Devara
Updated on 30-May-2023 401 Views

Pandas is one of the most potent libraries in python that provide high-performance data manipulation and analysis tools, it allows us to work with tabular data like spreadsheets, CSV, and SQL data using DataFrame. A DataFrame is a 2-dimensional labeled data structure it represents the data in rows and columns format. Data present in each column may have different data types. DataFrame: Integers Floats Strings Dates 0 1.0 1.300 p 2023-05-07 1 2.0 NaN y 2023-05-14 2 5.0 4.600 t 2023-05-21 3 3.0 1.020 h 2023-05-28 4 6.0 0.300 o 2023-06-04 5 NaN 0.001 n 2023-06-11 The DataFrame demonstrated above is having 6 rows and 4 columns and the data present in each row has different datatypes. And Conversions functions ...

Read More

Convert a nested for loop to a map equivalent in Python

Gireesha Devara
Gireesha Devara
Updated on 30-May-2023 870 Views

In general, for loop is used to execute/iterate a block of code a fixed number of times. And nested for loop is nothing but, iterating a block of code for x number of times, then we need to run another block of code within that code for y number of times. Nested for loop syntax for x in sequence: for y in sequence: inner loop outer loop The map is a built-in function in python that is used to iterate the items of a sequence and ...

Read More

Convert \"unknown format\" strings to datetime objects in Python

Gireesha Devara
Gireesha Devara
Updated on 30-May-2023 2K+ Views

Dates can be in many formats like: “2009/05/13 19:19:30”, “May 13 2009 07:19PM", and “2009-05-13 19:19”. Python provides many modules to work with data related to date times. To read an unknown format of date strings into a python datetime object, we can use the python dateutil, datetime modules. The python datetime object is a single object that has all the information about the date and time objects. It represents the data related to the year, month, day, hours, mintunes, seconds, and time zones also. In this article below, we will see how to convert the unknown format strings to ...

Read More

Convert a NumPy array to a Pandas series

Gireesha Devara
Gireesha Devara
Updated on 30-May-2023 2K+ Views

A Numpy array is an N-dimensional array also called a ndarray, it is a main object of the NumPy library. In the same way, the pandas series is a one-dimensional data structure of the pandas library. Both pandas and NumPy are validly used open-source libraries in python. Below we can see the one-dimensional numpy array. NumPy array array([1, 2, 3, 4]) The pandas Series is a one-dimensional data structure with labeled indices and it is very similar to a one-dimensional NumPy array. Pandas Series: 0 1 1 2 2 3 ...

Read More

Convert a NumPy array to Pandas dataframe with headers

Gireesha Devara
Gireesha Devara
Updated on 30-May-2023 2K+ Views

Both pandas and NumPy are validly used open-source libraries in python. Numpy stands for Numerical Python. This is the core library for scientific computing. A Numpy array is a powerful N-dimensional array object which is in the form of rows and columns. NumPy array array([[1, 2], [3, 4]]) Pandas provide high-performance data manipulation and analysis tools in Python, it allows us to work with tabular data like spreadsheets, CSV, and SQL data. And it has data structures like DataFrame and Series that are mainly used for analyzing the data. DataFrame is a 2-dimensional labeled data structure used to ...

Read More

Python Program to insert multiple elements into the array from the specified index

Gireesha Devara
Gireesha Devara
Updated on 29-May-2023 2K+ Views

An array is a collection of homogeneous data elements stored in an organized way. And each data element in the array is identified by an index value. Arrays in python Python does not have a native array data structure. So that, we can use the list data structure as an alternative to the arrays. [10, 4, 11, 76, 99] Also we can Python Numpy module to work with arrays. An array defined by the numpy module is − array([1, 2, 3, 4]) The indexing in python starts from 0, so that the above array elements are accessed ...

Read More

Python Program to find the distinct elements from two arrays

Gireesha Devara
Gireesha Devara
Updated on 29-May-2023 3K+ Views

In programming, an array is a data structure that is used to store a collection of homogeneous data elements. And each element in the array is identified by a key or index value. Arrays in python Python doesn’t have a specific data type to represent arrays. Instead, we can use the List as an array. [1, 4, 6, 5, 3] Finding distinct elements from two arrays means, identifying the unique elements between the two given arrays. Input Output Scenarios Assume we have two arrays A and B with integer values. And the resultant array will have distinct elements ...

Read More

Python Program to get the first given number of items from the array

Gireesha Devara
Gireesha Devara
Updated on 29-May-2023 215 Views

An array is a data structure of a set of items with the same data type, and each element is identified by an index. Arrays in python Python does not have its own data structure to represent an array. However, we can use the list data structure as an alternative to the arrays. Here we will use list an array − [10, 4, 11, 76, 99] Python provides some modules also which are more appropriate, and the modules are Numpy and array modules. An integer array defined by using the array module is − array('i', [1, 2, 3, ...

Read More
Showing 41–50 of 173 articles
« Prev 1 3 4 5 6 7 18 Next »
Advertisements