Hafeezul Kareem has Published 257 Articles

Count all prefixes in given string with greatest frequency using Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 12-Feb-2020 11:10:44

670 Views

In this tutorial, we are going to write a program that counts and prints the words with a higher frequency of an alphabet than the second one.Take a string and two alphabets. The prefixes with a higher frequency of the first alphabet will be printed. And display the count at ... Read More

Boolean Indexing in Pandas

Hafeezul Kareem

Hafeezul Kareem

Updated on 02-Jan-2020 06:58:52

2K+ Views

Boolean indexing helps us to select the data from the DataFrames using a boolean vector. We need a DataFrame with a boolean index to use the boolean indexing. Let's see how to achieve the boolean indexing.Create a dictionary of data.Convert it into a DataFrame object with a boolean index as ... Read More

Calendar Functions in Python -(monthrange(), prcal(), weekday()?)

Hafeezul Kareem

Hafeezul Kareem

Updated on 02-Jan-2020 06:47:01

636 Views

We are going to explore different methods of calendar module in this tutorial. Let's see one by one.calendar.monthrange(year, month)The method calendar.monthrange(year, month) returns starting weekday number and number of days of the given month. It returns two values in a tuple. Let's see one example.Example Live Demo# importing the calendar module ... Read More

Apply function to every row in a Pandas DataFrame in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Nov-2019 09:50:20

1K+ Views

In this tutorial, we are going to learn about the most common methods of a list i.e.., append() and extend(). Let's see them one by one.apply()It is used to apply a function to every row of a DataFrame. For example, if we want to multiply all the numbers from each ... Read More

Apply uppercase to a column in Pandas dataframe in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Nov-2019 09:47:01

2K+ Views

In this tutorial, we are going to see how to make a column of names to uppercase in DataFrame. Let's see different ways to achieve our goal.ExampleWe can assign a column to the DataFrame by making it uppercase using the upper() method.Let's see the code.# importing the pandas package import ... Read More

Arithmetic Operations on Images using OpenCV in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Nov-2019 09:45:00

1K+ Views

In this tutorial, we are going to learn about the arithmetic operations on Images using OpenCV. We can apply operations like addition, subtraction, Bitwise Operations, etc.., Let's see how we can perform operations on images.We need the OpenCV module to perform operations on images. Install the OpenCV module using the ... Read More

as_integer_ratio() in Python for reduced fraction of a given rational

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Nov-2019 09:42:09

466 Views

In this tutorial, we are going to write a program that returns two numbers whose ratio is equal to the given float value. We have a method called as_integer_ratio() that helps to achieve our goal.Let's see some examples.Input: 1.5 Output: 3 / 2 Input: 5.3 Output: 5967269506265907 / 1125899906842624Let's examine ... Read More

Audio processing using Pydub and Google Speech Recognition API in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Nov-2019 08:19:42

945 Views

In this tutorial, we are going to work with the audio files. We will breakdown the audio into chunks to recognize the content in it. We will store the content of the audio files in text files as well. Install the following modules using the below commands.pip install pydubIf you ... Read More

Barnsley Fern in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Nov-2019 08:11:37

502 Views

In this tutorial, we are going to learn about the Barnsley Fern, which is created by Michael Barnsley. The features of Barnsley Fern is similar to the fern shape. It is created by iterating over the four mathematical equations known as Iterated Function System(IFS). The transformation has the following formula.f(x, ... Read More

Basic Python Programming Challenges

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Nov-2019 08:06:14

592 Views

In this tutorial, we are going to write a solution for a challenge.ChallengeWe have to generate a random set of basic arithmetic operations. The user will give the number of questions, and we have to generate questions. After every question, the user will answer it. At the end of the ... Read More

Advertisements