In the article, we will see what causes the “dataframe object has no attribute ‘unique’ error“. The main reason why this error comes is when we use the unique() method on the data frames. We can use the unique() method…
Programming
In the article, we will see how to use the async & await APIs provided by asyncio for writing asynchronous code with a “fire and forget” pattern. When do we use the fire and forget pattern? It is particularly used…
In this article, we will see how to add a constant column to the spark DataFrame. What is a constant column? The constant column is said to be a column in a DataFrame that has the same value for every…
In this article, we will see how to use PyCrypto to encrypt and decrypt data using AES-256. We will use the AES CBC mode which is a popular encryption algorithm used for secure communication and data protection to encrypt &…
In this article, we will see how to download an image in Python using the URLlib. let’s first import the URLlib library. After importing the library, we can use the function urlretrieve() to download a file from the URL and…
In this article, we will see how to print the optional values in C++. Using the value_or We can use the value_or method to print the optional value. This method takes the value as an argument and prints it if…
In this article, we will see the possible causes of the error “numpy ndarray object has no attribute intersection” and how to resolve it. The “ndarray object has no attribute intersection” error message usually occurs when we try to perform…
In this article, we will see how to delete a group after pandas groupby operation in Python. Let’s first import the pandas library and create a sample data set: The above dataset consists of three groups (‘A‘, ‘B‘, and ‘C‘)…
In this article, we will see how to rank rows in a pandas dataframe based on multiple columns. By using the rank() method with the method parameter set to 'min' and the ascending parameter set to False. We can also…
In this article, we will see how to convert the pandas dataframe to the dictionary by excluding Na. to_dict() with omit parameter The easiest way to convert a pandas data frame to a dictionary without Na values is to use…