Rohan Singh has Published 171 Articles

Python Program to Replace a Character at a Specific Index

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 14:31:19

18K+ Views

In Python, we can easily replace a character at a specific index by converting the string into a list of characters using the list() method. Then, we modify the character at the desired index and convert the list back to the string using the join() method. We can also replace ... Read More

Python Program to Print the first letter of each word using regex

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 14:28:13

2K+ Views

Regex library in Python is used for pattern matching and manipulation of text data. We can print the first letter of each word using regex by identifying a new word after spaces using its pattern-matching functionality. In this article, we will implement a program to print the first letter of ... Read More

Python Program to Determine the Unicode Code Point at a given index

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 14:21:54

2K+ Views

A Unicode code point is a unique number that represents a number in the Unicode character set. Unicode is a character encoding standard that is used to assign unique codes to every character in the world. Unicode supports around 130, 000 characters including letters, symbols, and emojis.We can determine the ... Read More

Python Program to Compare two strings lexicographically

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 14:19:53

2K+ Views

We can compare two strings lexicographically in Python using comparison operators like '', '==', ' string2[i]: print(string2, "comes before", string1) break i += 1 else: if len(string1) < len(string2): ... Read More

How to Save Pandas Dataframe as gzip/zip File?

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 14:16:35

5K+ Views

Pandas dataframe can be saved in gzip/zip format using the gzip and zipfile module in Python. Pandas is a Python library that is used for data manipulation and analysis. It provides a two-dimensional labeled data structure with columns of potentially different data types. To reduce the size of the data ... Read More

How to save a NumPy array to a text file?

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 13:57:37

17K+ Views

The Numpy array can be saved to a text file using various methods like the savetxt() method, save() method, and dataframe.to_csv() function. Numpy is a Python library that is used to do the numerical computation, manipulate arrays, etc. In this article, we will discuss the methods that can be used ... Read More

How to Run Python Flask App Online using Ngrok?

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 13:54:17

4K+ Views

Ngrok is a tool that is used to create a secure tunnel between your local machine and the internet. It is used to test the web application and allows developers to expose their local web server to the internet without having to deploy it to a remote server. Python Flask ... Read More

How to run multiple Python files in a folder one after another?

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 13:52:19

8K+ Views

The subprocess module can be used to run multiple Python files in a folder one after another. Running multiple files one after another is required in various situations like when processing large data sets or performing complex analysis. In this article, we will discuss the steps involved in running multiple ... Read More

How to Run Javascript from Python?

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 13:29:36

6K+ Views

In Python, we can run Javascript using the PyExecJS library or the js2py library of Python. The PyExecJs library provides a consistent API for running JavaScript code from within Python using a variety of JavaScript engines, including Node.js, JavaScriptCore, and Google's V8 engine. The js2py library allows you to execute ... Read More

How to round array elements to the given number of decimals using NumPy?

Rohan Singh

Rohan Singh

Updated on 11-Jul-2023 13:25:57

371 Views

The round() function of the Numpy library is used to round array elements to the given number of decimals. Numpy is a Python library that is used to perform mathematical operations, manipulation, and creation of arrays, etc. In this article, we will use the round() function to round array elements ... Read More

Advertisements