
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10476 Articles for Python

30K+ 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 a character at a specific index using the slicing and replace method. In this article, we will see examples of replacing a character at a specific index in Python using list and join method, the slicing method and replace method. Method 1: Using list() and join() method Syntax The list() ... Read More

690 Views
Techniques for feature selection play a vital role in the field of machine learning as they are responsible for identifying the most pertinent and informative features that contribute to model training. In this article, we will delve into a variety of methods employed to select a subset of features from a vast pool of variables. These techniques not only enhance model performance and reduce computational complexity but also improve interpretability. Beginning with traditional approaches like a filter, wrapper, and embedded methods, we will explore advanced algorithms such as genetic algorithms and deep learning-based techniques. What is Feature Selection? Feature ... Read More

3K+ 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 each word using regex. Regular Expressions Regular expression or regex is a tool for pattern matching in text. They are a sequence of characters that define a search pattern. They are widely used in programming, particularly in text processing, and are supported by most programming languages, including Python. Printing ... Read More

4K+ 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 Unicode Code point at a specific index using the ord() function, codecs module in Python, unicodedata module, and array module in Python. In this article, we will discuss how we can determine the Unicode code point at a given index using all these methods. Unicode Code Point According to ... Read More

5K+ 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): print(string1, "comes before", string2) elif len(string1) > len(string2): print(string2, "comes before", string1) else: print("The two strings are equal") Output apple comes before banana Example In the below ... Read More

7K+ 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 frame we need to store it in gzip/zip format. In this article, we will understand how we can save Pandas Dataframe as gzip/zip file. Algorithm A generalized algorithm to save a Pandas DataFrame as a compressed gzip/zip file is written below. However, the exact implementation of this algorithm may vary ... Read More

6K+ 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 allows you to create web applications locally but we might want to showcase it to the world by running it online. In this article, we will use the Ngrok tool to run the web application online without hosting it on any server. The Steps to Run Python Flask App Online ... Read More

12K+ 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 Python files in a folder sequentially with examples. Method 1: Using the subprocess() method Steps for creating and running multiple Python files sequentially Step 1: Create multiple Python files to run We need to have three Python files in a folder to run them sequentially. So the first step ... Read More

10K+ 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 JavaScript code from within Python by parsing the JavaScript code and interpreting it in Python. This article will teach us how to run javascript from Python using the PyExecJS library. Method 1: Using the PyExecJS library The PyExecJs library provides a simple interface for executing JavaScript code. It allows developers ... Read More

253 Views
Pygal is a Python library that is used to create interactive, customizable charts and graphs. We can rotate the x-axis label using the x_label_rotation attribute in the Pygal module. The rotation of the x-axis label makes the chart easier to read and comprehend. In this article, we will discuss how to rotate the x-label using Pygal with an example. Algorithm A general algorithm for rotating the x label using pygal is given below − Import the Pygal module. Create a chart object (e.g., Bar, Line, Pie, etc.). Add data to the chart using the add method. Set the x-axis ... Read More