Tag: Not
Check if a Pandas DataFrame is empty or not
In this article, we will discuss four different ways to check if a given DataFrame is empty or not. Check whether DataFrame is empty using Dataframe.empty In Python’s pandas, the Dataframe class provides an attribute empty i.e. Dataframe.empty It return True if DatafFrame contains no data. Advertisements Let’s see an example, Create an empty DatafFrame …
Pandas : Check if a value exists in a DataFrame using in & not in operator | isin()
In this article we will dicuss different ways to check if a given value exists in the dataframe or not. First of all, we need to import the pandas module i.e. Advertisements import pandas as pd Let’s create a dataframe, # List of Tuples empoyees = [(‘jack’, 34, ‘Sydney’, 155) , (‘Riti’, 31, ‘Delhi’ , …
Pandas : Check if a value exists in a DataFrame using in & not in operator | isin()Read More
Python: check if two lists are equal or not ( covers both Ordered & Unordered lists)
In this article we will discuss 8 different ways to check if two lists are equal or not. Suppose we have two lists and we want to check if both the lists are equal or not. There can be two meanings of 2 equality here, Advertisements Both lists must contain the same unique elements and …
Python: check if two lists are equal or not ( covers both Ordered & Unordered lists)Read More
Solved- TypeError: dict_values object does not support indexing
In this article, we will discuss about the reasons of getting error ‘TypeError: ‘dict_values’ object does not support indexing’ and how to resolve this error. A little background, In Python, the dictionary class provides functions keys(), values() and items() to fetch keys, values or all items (key-value pairs). But all these functions returns view objects, …
Solved- TypeError: dict_values object does not support indexingRead More
Solved- TypeError: dict_keys object does not support indexing
In this article, we will discuss about the reasons of getting error ‘TypeError: ‘dict_keys’ object does not support indexing’ and how to resolve this error. A little background, In Python, the dictionary class provides functions keys(), values() and items() to fetch keys, values or all items (key-value pairs). But all these functions return view objects, …
Solved- TypeError: dict_keys object does not support indexingRead More
INSERT record if NOT EXISTS in MySQL
This article will discuss how to insert a record IF NOT EXISTS in MySQL. We will be using MySQL subqueries with NOT EXISTS clause to fulfill the purpose. Table of Contents INSERT NOT EXISTS Syntax INSERT single record if NOT EXISTS in MySQL INSERT multiple record if NOT EXISTS in MySQL INSERT record or UPDATE …
MySQL SELECT WHERE NOT IN
This article will be going through a few examples to illustrate MySQL SELECT WHERE with NOT IN clause. Table of Contents:- Syntax MySQL SELECT WHERE NOT IN LIST MySQL SELECT WHERE NOT IN SUBQUERY MySQL SELECT WHERE NOT IN ANOTHER TABLE Let us get started by making the sample data used across the examples. We will be creating two …
MySQL ADD COLUMN IF NOT EXISTS
This article will discuss the script to add a column to a MySQL table only if it does not already exist. Let us get started by making the sample table using the create table script. CREATE TABLE IF NOT EXISTS sale_details ( id INT auto_increment, sale_person_name VARCHAR(255), no_products_sold INT, sales_department VARCHAR(255), primary key (id) ); …
MySQL create table if not exists
This article will discuss the script to create a table in MySQL only if it does not already exist. We will be using the IF NOT EXISTS clause within the create table script. Further, in the examples, we will be writing create table scripts using the IF NOT EXISTS clause and without it to analyze the difference …
How to use “not equal” operator in Python?
In this Python tutorial, you will learn how to use the “not equal” operator in Python. Table Of Contents “not equal” operator (!=) in Python “not equal” Operator ( != ) in conditional statements “not equal” operator (!=) in Loops in Python “not equal” operator (!=) with Data Structures in Python Summary Let’s dive into …