AmitDiwan has Published 11365 Articles

What does [::-1] do in Python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 14:28:57

18K+ Views

Slicing in Python gets a sub-string from a string. The slicing range is set as parameters i.e. start, stop and step. For slicing, the 1st index is 0. For negative indexing, to display the 1st element to last element in steps of 1 in reverse order, we use the [::-1]. ... Read More

What is slicing in Python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 14:22:36

2K+ Views

Slicing in Python gets a sub-string from a string. The slicing range is set as parameters i.e. start, stop and step. Syntax Let us see the syntax # slicing from index start to index stop-1 arr[start:stop] # slicing from index start to the end arr[start:] # slicing from ... Read More

What are the basic concepts of Python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 13:45:39

17K+ Views

Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. Features of Python Following are key features of Python − Python supports functional and structured programming methods as well as OOP. It can be used as a scripting language or can be compiled to byte-code for building large ... Read More

What type of language is python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 13:43:59

3K+ Views

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Let’s understand the paradigms one by one. Paradigms classify programming languages based on their features. Interpreted Language Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar ... Read More

How are dataframes in Pandas merged?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 13:43:21

221 Views

Pandas is an open-source Python Library providing high-performance data manipulation and analysis tool using its powerful data structures. A Data frame in Pandas is a two-dimensional data structure, i.e., data is aligned in a tabular fashion in rows and columns. In this article, we will see how to merge dataframes ... Read More

How to create an empty class in Python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 12:58:13

5K+ Views

A class in Python user-defined prototype for an object that defines a set of attributes that characterize any object of the class. The attributes are data members (class variables and instance variables) and methods, accessed via dot notation. We can easily create an empty class in Python using the pass ... Read More

What is _init_ in Python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 12:54:37

1K+ Views

The classes in Python have the __init__() function. This function gets executed when the class is being initiated. Let’s see some key points bout __init__ - The classes in Python have __init__() function. Similar to constructors in Java, the __init__() function executes when the object gets created. The __init__() ... Read More

How to combine dataframes in Pandas?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 12:52:38

698 Views

To combine dataframes in Pandas, we will show some examples. We can easily combine DataFrames or even Series in Pandas. Pandas is an open-source Python Library providing high-performance data manipulation and analysis tool using its powerful data structures. A Data frame is a two-dimensional data structure, i.e., data is aligned ... Read More

Reverse the Rows of a Pandas Data Frame?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 12:46:02

491 Views

We will see here how to reverse the rows of a Pandas Dataframe. Pandas is an open-source Python Library providing high-performance data manipulation and analysis tool using its powerful data structures. A Data frame is a two-dimensional data structure, i.e., data is aligned in a tabular fashion in rows and ... Read More

Create a Series from a List, Numpy Array, and Dictionary in Pandas

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 12:44:36

1K+ Views

Pandas is an open-source Python Library providing high-performance data manipulation and analysis tool using its powerful data structures. The name Pandas is derived from the word Panel Data – an Econometrics from Multidimensional data. Series is a one-dimensional labelled array capable of holding data of any type i.e. integer, string, ... Read More

Advertisements