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
Programming Articles - Page 127 of 2501
1K+ Views
Commonly used in statistical analysis and data modelling, the Gaussian distribution, alternatively referred to as the normal distribution, presents a familiar bell-shaped curve that represents a continuous probability distribution for a real-valued random variable. Its bell-shaped curve characterises it and is often used to model real-world phenomena. The random module generates a set of pseudorandom numbers drawn from a normal distribution with a stipulated mean and standard deviation. Syntax numpy.random.uniform(low=0.0, high=1.0, size=None) Parameters low : It takes floating or array like values as its argument represents the minimum value that can be generated. The default value is ... Read More
1K+ Views
When working with strings in Python, you might have come across situations where special characters, escape sequences, or backslashes caused unexpected behavior or required extra attention. This is where raw strings come to the rescue. Raw strings, denoted by the 'r' prefix, offer a convenient way to handle strings without interpreting escape sequences or special characters. They are particularly useful when dealing with regular expressions, file paths, and any scenario that involves literal string representations. In this article, we will explore the concept of raw strings in Python and understand how they differ from regular strings. We will delve into ... Read More
1K+ Views
Tinyhtml is a Python library used to generate HTML5 expressions or code. This is useful for generating HTML code when you are not as knowledgeable about the syntax of HTML. As the name says so, it is a ‘tiny’ library and can render HTML5 expressions. There are many methods of rendering HTML code using tinyhtml few of which we’ll be seeing. To learn more, go through the documentation here. Due to the lightweight nature of tinyhtml, it is easier to integrate it with other tools, for example, HTML code snippets can be rendered in Jupyter Notebooks by importing ... Read More
297 Views
Text processing often requires manipulating the case of characters in a string. One common task is converting lowercase characters to uppercase. In Python, there are built-in functions and methods that simplify this task. In this article, we will explore how to write a Python program to convert characters to uppercase. Uppercasing characters is essential for various applications, such as data cleaning, text analysis, and string matching. By converting characters to uppercase, we can ensure uniformity, improve readability, and enable effective comparison and matching operations. In this article, we will discuss the problem statement, explore the approach and algorithm to uppercase ... Read More
3K+ Views
In the study of statistics and data-analysis, normal distribution or Gaussian Distribution is a widely used probability distribution. It is a bell-shaped curve that characterizes the probability and is often used to model real-world phenomena. We use the random module available in Python’s Numpy library to generate random numbers from the normal distribution. It also allows users to generate random numbers from the normal distribution with a specified mean and standard deviation. Syntax numpy.random.normal(loc=0.0, scale=1.0, size=None) Parameters loc (float or array_like): It is the mean or centre of the distribution. The default value is 0.0 ... Read More
4K+ Views
In Python, dictionaries are powerful data structures that allow us to store and manipulate key-value pairs. They provide a convenient way to organize and access data based on unique keys. Often, we encounter situations where we need to update a dictionary with values from another dictionary list. This means taking the values from multiple dictionaries and merging them into a single dictionary, either by adding new key-value pairs or updating existing ones. In this article, we will explore different approaches to tackle this task in Python. We will discuss three methods: using a for loop and the update() method, utilizing ... Read More
731 Views
When working with strings in Python, it is often necessary to validate whether a string contains only numbers and alphabets or if it includes other special characters. String validation is crucial in various scenarios such as input validation, data processing, and filtering. In this article, we will explore a Python program to test if a given string consists of only alphanumeric characters. We will discuss the criteria for a valid string, provide examples of valid and invalid strings, and present an efficient approach to solve this problem using built-in string methods. Understanding the Problem Before we dive into solving the ... Read More
4K+ Views
In Python programming, lists are a versatile and commonly used data structure. They allow us to store and manipulate collections of elements efficiently. At times, we may need to swap the positions of two elements within a list, either to reorganize the list or to perform specific operations. This blog post explores a Python program that swaps two elements in a list. We will discuss the problem, outline an approach to solve it, and provide a step-by-step algorithm. By understanding and implementing this program, you will gain the ability to manipulate lists and change the arrangement of elements according to ... Read More
2K+ Views
A modified version of the PIL called pillow library can be used to generate a text-based CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) in Python Imaging Library. Types of CAPTCHA There are different types of CAPTCHA and some of them are follows below. Text-based CAPTCHA : A sequence of characters is provided with features distorted and random noise to make character recognition difficult. ... Read More
664 Views
Natural Language Processing (NLP) allows computers to interpret and analyze human language. Finding the most identical word or sentence to a given input sentence is a prevalent NLP problem. In Python, there are various methods available to find identical sentences. Required Resources To get this done you have to install nltk library in your system. Therefore run the following command in your Python command prompt to install nltk. pip install nltk You may also run the following command in your Windows cmd if the above command fails to execute. python --version pip --version pip ... Read More