Found 27104 Articles for Server Side Programming

Python regex - Check whether the input is Floating point number or not

Mrudgandha Kulkarni
Updated on 10-Aug-2023 16:53:42

735 Views

Floating point numbers play a crucial role in various programming tasks, from mathematical computations to data analysis. However, when working with user input or data from external sources, it becomes essential to validate whether the input is a valid floating point number or not. Python provides powerful tools to tackle this challenge, and one such tool is regular expressions. In this article, we will explore how to use regular expressions in Python to check whether the input is a floating point number or not. Regular expressions, commonly known as regex, offer a concise and flexible way to define patterns and ... Read More

Generate a Waffle chart using pyWaffle in Python

Jaisshree
Updated on 10-Aug-2023 16:43:52

197 Views

Data visualization is crucial for efficient information comprehension and presentation. Among the many chart types available, waffle charts offer a novel way to display data as square tiles in a grid-like structure. The powerful Python module PyWaffle facilitates Waffle chart development, similar to many calculations and data analysis methods. In this article, we'll look at how to create a waffle chart using the sophisticated Python module PyWaffle. Let's install PyWafle and see how categorical data can be visualized with it. Run the following command in your cmd to install the library and then import it into your code. ... Read More

Generate Random Numbers From The Uniform Distribution using NumPy

Jaisshree
Updated on 10-Aug-2023 16:41:48

608 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

Python Raw Strings

Mrudgandha Kulkarni
Updated on 10-Aug-2023 16:52:51

528 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

Generate HTML using Tinyhtml Module using Python

Jaisshree
Updated on 10-Aug-2023 16:37:38

732 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

Python Random Module

Mrudgandha Kulkarni
Updated on 10-Aug-2023 16:51:47

365 Views

In the world of programming, the ability to generate random values is often crucial. Whether you're developing games, simulations, statistical models, or simply need to introduce variability into your programs, having a reliable and efficient way to generate random numbers is essential. This is where the Python Random module comes in. The Python Random module provides a suite of functions for generating random values, making it easy to introduce randomness into your Python programs. From generating random numbers within a specific range to shuffling lists, simulating random events, and even generating random passwords, the Random module offers a wide range ... Read More

Python program to uppercase the given characters

Mrudgandha Kulkarni
Updated on 10-Aug-2023 16:50:29

88 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

Generate five Random Numbers from the Normal Distribution using NumPy

Jaisshree
Updated on 10-Aug-2023 16:31:49

2K+ 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

Python program to update a dictionary with the values from a dictionary list

Mrudgandha Kulkarni
Updated on 10-Aug-2023 16:49:38

2K+ 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

Generate Chebyshev series with given complex roots using NumPy in Python

Jaisshree
Updated on 10-Aug-2023 16:24:56

86 Views

Chebyshev series is a polynomial series referring to a series of Chebyshev Polynomials. A Chebyshev Polynomial is a Polynomial that is defined in a specific interval which is orthogonal in nature. It has a weight function $\mathrm{(1-x^{2})^{(-½)}}$. This polynomial is named after the Russian mathematician, Pafnuty Chebyshev. Orthogonality is a specific type of relationship that defines two polynomials. Two polynomials are orthogonal in nature if their relationship satisfies certain conditions. For example, two functions can be considered orthogonal if their integration over a certain interval equates to 0. Chebyshev Polynomials are defined as \mathTn(x). They are defined recursively ... Read More

Advertisements