AmitDiwan has Published 11365 Articles

What is a Negative Indexing in Python?

AmitDiwan

AmitDiwan

Updated on 25-Aug-2023 00:33:24

38K+ Views

Negative Indexing is used to in Python to begin slicing from the end of the string i.e. the last. 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 ... Read More

Rename multiple files using Python

AmitDiwan

AmitDiwan

Updated on 24-Aug-2023 14:24:44

48K+ Views

To rename files in Python, use the rename() method of the os module. The parameters of the rename() method are the source_address (old name) and the destination_address (new name). Install and Import the OS module To install the OS module − pip install os To import − import os ... Read More

How to insert new keys/values into Python dictionary?

AmitDiwan

AmitDiwan

Updated on 23-Aug-2023 21:18:38

61K+ Views

To insert new keys/values into a Dictionary, use the square brackets and the assignment operator. With that, the update() method can also be used. Remember, if the key is already in the dictionary, its value will get updated, else the new pair gets inserted. Consider a Dictionary as a set ... Read More

Python Pandas - How to delete a row from a DataFrame

AmitDiwan

AmitDiwan

Updated on 23-Aug-2023 21:13:18

60K+ Views

To delete a row from a DataFrame, use the drop() method and set the index label as the parameter.At first, let us create a DataFrame. We have index label as w, x, y, and z:dataFrame = pd.DataFrame([[10, 15], [20, 25], [30, 35], [40, 45]], index=['w', 'x', 'y', 'z'], columns=['a', 'b'])Now, ... Read More

How to update a Python dictionary values?

AmitDiwan

AmitDiwan

Updated on 23-Aug-2023 13:40:05

67K+ Views

Values of a Python Dictionary can be updated using the following two ways i.e. using the update() method and also, using square brackets. Dictionary represents the key-value pair in Python, enclosed in curly braces. The keys are unique and a colon separates it from value, whereas comma separates the items. ... Read More

Python program to check if a number is Prime or not

AmitDiwan

AmitDiwan

Updated on 22-Aug-2023 00:23:58

195K+ Views

A prime number is a natural number greater than 1 that is not a product of two smaller natural numbers. Any whole number which is greater than 1 and has only two factors that is 1 and the number itself, is called a prime number Let’s say the following is ... Read More

Default exports vs Named exports in JavaScript

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 16:35:06

742 Views

In this article, we will learn the difference between default exports and named exports in javascript, and how we can use them to effectively organize our code structure. In javascript, we can use default exports and named exports so as to have separate files or modules for separate pieces of ... Read More

What are Promises in JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 16:04:39

563 Views

Promises, in JavaScript, can be used to simplify asynchronous programming, making it easier to handle asynchronous operations like I/O operations or communicate with an external system or machine. Promises are objects that represent the eventual completion or failure of an asynchronous operation and its resulting value. They provide an easy ... Read More

How to use named arguments in JavaScript functions?

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:58:15

848 Views

In this article, we will learn how to use named arguments in javascript, and how we can use it to significantly enhance code readability and maintainability. Javascript allows us to use named arguments, which eliminate the need for the order of parameters to matter during function execution. We may ... Read More

Exports & Imports in JavaScript

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:55:32

228 Views

We will learn how to utilise imports and exports in javascript in this post, as well as how to use them to break our code into different modules in order to better organise it. To facilitate modular development in programming, which enables us to organise our code into reusable modules, ... Read More

Advertisements