Found 26504 Articles for Server Side Programming

How to add group-level summary statistics as a new column in Pandas?

Manas Gupta
Updated on 23-Mar-2023 15:18:07

280 Views

Pandas is an extremely popular data handling library used frequently for data manipulation and analysis. The Pandas library offers powerful features for analysis such as grouping to analyze various samples having some common features. In this article, we are going to learn how to add these summary statistics obtained through groups of samples as a new column in our existing Pandas dataframes. NOTE − The code in this article was run on a jupyter notebook. Let's begin by importing Pandas. import pandas as pd ExampleFollowing is the sample d ataset we will work on. It has 3 columns storing ... Read More

How to add header row to a Pandas Dataframe?

Manas Gupta
Updated on 23-Mar-2023 15:13:30

7K+ Views

Pandas is a super popular data handling and manipulation library in Python which is frequently used in data analysis and data pre-processing. The Pandas library features a powerful data structure called the Pandas dataframe, which is used to store any kind of two-dimensional data. In this article we will learn about various ways to add a header row (or simply column names) to a Pandas dataframe. NOTE − The code in this article was tested on a jupyter notebook. We will see how to add header rows in 5 different ways − Adding header rows when creating a ... Read More

Program to check the similarity of given two triangles

Simran Kumari
Updated on 23-Mar-2023 14:49:07

547 Views

In this problem, we will learn to check the similarity of two given triangles, which have many real-world use cases from the viewpoint of a programmer. To construct and manage 2D and 3D models of things, CAD systems are utilized, and one key function is the capability to compare two triangles. For instance, engineers working in design and construction may need to make that the foundational measurements of a building match the blueprint. Engineers can rapidly evaluate whether the angles and sides of the foundation game the layout by utilizing a CAD tool that has a built-in feature to check ... Read More

Program to calculate the Surface Area of a Triangular Prism

Simran Kumari
Updated on 23-Mar-2023 14:40:10

435 Views

Let us see how to write a program to calculate the Surface Area of a Triangular Prism. It might seem very basic to calculate the surface area of a triangular prism, but there are various areas where programmers may feel the need for it. Some of the common scenarios are listed below − 3D graphics and animation − While constructing 3D models, animators and game developers may need to compute the surface area of a triangular prism in order to correctly represent it in a virtual world. Engineers and architects may need to determine the surface area of ... Read More

Number of triangles in a plane if no more than two points are collinear

Simran Kumari
Updated on 23-Mar-2023 14:35:32

281 Views

Let us see how to calculate the number of triangles in a plane with n number of points given, with the constraint that not more than two points are collinear. Computing the number of triangles in a plane with no more than two collinear points is a typical problem in computational geometry, and it is used in computer graphics, image processing, and other areas of computer science. While creating a 2D image from a 3D scene in 3D graphics, for instance, the issue of counting triangles in a plane with no more than two points collinear can come up. The ... Read More

Different ways to represent N as the sum of K non-zero integers

Simran Kumari
Updated on 23-Mar-2023 14:31:37

792 Views

The problem “Different ways to represent N as the sum of K non-zero integers” has many real-world use cases. Cryptography − In cryptography, specific cryptographic methods are designed using the concept of encoding a number N as the sum of K non-zero integers. Representing an integer N as the sum of K non-zero integers might appear as a subproblem in different optimization issues in the context of optimization methods. Machine learning − In machine learning, feature vectors that depict the distribution of data points can be created by using the problem of representing an integer N as the sum of ... Read More

Commands to Get Min, Max, Median, and Mean of a Dataset

Satish Kumar
Updated on 23-Mar-2023 16:33:43

2K+ Views

When working with datasets, it's important to understand characteristics of data. One of most fundamental aspects of a dataset is its central tendency - point around which data tends to cluster. This can be quantified in a number of ways, including minimum, maximum, median, and mean. In this article, we'll explore these different measures of central tendency and show you how to calculate them using a variety of programming languages. What is Minimum of a Dataset? The minimum of a dataset is smallest value in set. This value is useful for understanding lower bounds of data and can help identify ... Read More

Vieta’s Formulas

Rinish Patidar
Updated on 16-Mar-2023 11:01:17

5K+ Views

In mathematics, Vieta’s formulas are the concept of polynomials which relates a polynomial’s coefficients to the sums and products of the roots of the polynomial. Vieta’s formulas can be useful tools for learning relations between the polynomial’s roots without really knowing their numerical value and coefficients of the equation. We will be focusing on the concept of Vieta’s formulas and try to solve some problems using this formula in this article. Vieta’s Formulas The formulas developed by the mathematician Vieta establish the relationship between the sum and product of any polynomial’s roots and its coefficients. Since this formula deals with ... Read More

Subsequence of size k with maximum possible GCD

Rinish Patidar
Updated on 16-Mar-2023 10:58:17

881 Views

The problem statement says we will be given an array as input and a positive integer K, we need to figure out the maximum possible gcd(greatest common divisor) of a ksized subsequence of an array in this problem. It can be solved using different algorithms to find gcd of the numbers and figuring out the maximum gcd for a k-sized subsequence. Before that we must know about the subsequence of an array. A subsequence of an array is a sequence of numbers from the array not necessarily adjacent numbers in the array but the order of the numbers in the ... Read More

Smarandache-Wellin Sequence

Rinish Patidar
Updated on 16-Mar-2023 10:55:17

373 Views

The problem includes printing first m terms of Smarandache-Wellin Sequence where m is any positive integer. We will see the algorithm to print the first m term of Smarandache-Wellin Sequence in C++. But before that we must know about the Smarandache-Wellin sequence. A Smarandache-Wellin sequence is a sequence of Smarandache-Wellin numbers. Smarandache-Wellin numbers are the integers which are formed by concatenation of the consecutive prime numbers. The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23…. The first Smarandache-Wellin number of the sequence is 2. The second number of the sequence is 23, which ... Read More

Advertisements