python reverse list

3 Different Methods To Reverse Python List

In-place reverse, slicing list, and reverse iterator are three main methods to reverse a list or array in Python. In this article, we see how to do every single method via the examples. Method #1: In-Place Reverse List According to Python Document, we can use the built-in reverse() method to...

how to drop a column in Pandas

How To Drop A Column In Pandas

It is a common situation when we have to drop one or multiple columns in Pandas Dataframe. The Pandas library offers us a built-in function, DataFrame.drop(), to do it easily. Prerequisite Any example in Pandas will start with creating a DataFrame. We assume that you have the essential knowledge of...

Python Tips #1: Generator And Yield Keyword In 5 Minutes

Python Tips #1: Generator And Yield Keyword In 5 Minutes Python generator gives us a lazy iterator that is introduced in PEP255. We probably guess the idea from the "lazy" term. It means we are able to evaluate the piece of code whenever you want. It's hard to understand clearly,...

Sending Email With Python

Sending Email with Python Sending email is a very common task in any system. You probably found this tutorial because you want to send emails using Python. In this tutorial, we will learn how to send emails with and without attachment/HTML contents in Python. After complete the tutorial, I have...

Python Pandas for Beginners – A Complete Guide (Part 2)

Python Pandas for Beginners - A Complete Guide (Part 2)   In this article, we continue learning Python Pandas. We will know how to read DataFrame from file and the most important Pandas operator for beginners. In the previous post of the series, we understand the basic concepts in Pandas...

Python if not

Python if not

Python if not is an easy way to check whether a value is False or True.  A Quick Example data1 = 10 if not data: print("Not a zero value") /* Result: Not a zero value */   Python Membership Operators The not operator is not only used to check value...

Python Pandas for Beginners – A Complete Guide (Part 1)

Python Pandas for Beginners - A Complete Guide (Part 1)   This post series, Python Pandas for Beginner, will be the best starting point to learn pandas library for the beginner. You will learn some of the most important pandas features such as exploring, cleaning, transforming, visualizing data. Pandas is...

Python Filter Function

Python filter() function constructs an iterator from elements of an iterable for which a function returns true. We can understand that filter will test every element of iterators to be true or not. A Quick Example marks = [5, 7, 2, 8, 9] def is_pass_test(x): if m < 5: return...

Python Lambda Function

A lambda function is an anonymous function. In this post, we'll learn what is it, its syntax and how to use it (with examples). After that, we can make our code better by using lambda. A Quick Example: y = lambda x : x + 1 print(y(1)) /* Result: 2...

Python Map Function

Python map function is used to execute a function on all elements of an iterator. The function to execute will be passed to map() as a parameter. Through this blog post, we will understand map() function via many examples in coding. A Quick Example: def newfunc(val): return val * 2...