## Pages

Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

# Class 12 Informatics Practices - Scatter Plots Using Matplotlib

A scatter plot also called scatter chart uses dots to represent data points for two different numeric variables. The position of each dot on the horizontal and vertical axis represent an individual data point.

A scatter plot is commonly used to compare distribution of two variables and to find visually any correlation between them. If there are distinct clusters/segments within the data, it will be clear in the scatter plot.

Let us try to plot a few scatter graphs using matplotlib.  # Python Snippets For Class 11 and Class 12

List of Python programs for students studying Informatics Practices and Computer Science.

Program 1: Write a program in python to accept a string and display it in reverse order.

`# write a program in python to accept a string and display it in a reverse order.str1=input("Enter a string: ")print("Reverse string is: ",str1[::-1])`

Output:  ## Python Basics - Numpy Arrays

CBSE Class 11 - Informatics Practices

Q1: What is NumPy?

1. NumPy stands for Numerical Python.

2. It is the core library for scientific computing in Python.

3. A NumPy array (also called ndarray) is a homogeneous multidimensional array of data objects.

4. A NumPy array is a table of elements (usually numbers), all of the same type, indexed by a tuple of positive integers.

5. Numpy module provides a set of methods and tools for working with these arrays.

6. In Numpy dimensions are called axes. The number of axes is rank.

Q2: What is the command line option to install NumPy module?

Answer: Run the following command at the command prompt.
pip install numpy

Q3: What is one dimensional (1D) array?

Answer: A one-dimensional array or 1D array is a named group of a contiguous set of elements having the same data type. 1D arrays are also called vectors.

Q4: What is a multi-dimensional array?

Answer: A multidimensional array is an array of arrays. Multi-dimensional arrays are also known as matrices. For example, a two-dimensional array (2D array) has two axes i.e. rows and columns.  ## Python Snippets - 1(Arithmetic Operators)

Arithmetic operators are used with numeric values to perform mathematical operations. Python supports the following arithmetic operators  