1. Numpy:

Numpy (Numerical Python) is a fundamental package for scientific computing with Python. It provides various mathematical functions for arrays and matrices, enabling array operations to be performed more efficiently than native Python arrays.

Example:

# Importing numpy

import numpy as np

# Creating a numpy array

a = np.array([1,2,3])

b = np.array([4,5,6])

# Adding two numpy arrays

c = a + b

# Multiplying two numpy arrays

d = a * b

Package: numpy

2. Pandas:

Pandas is an open-source data manipulation and analysis library. It provides data structures to effectively handle structured data like csv and excel. It is built on top of Numpy package and provides easy-to-use data manipulation functions.

Example:

# Importing pandas library

import pandas as pd

# Reading a csv file

data = pd.read_csv('filename.csv')

# Selecting a column

column = data['column_name']

# Filtering data using condition

filtered_data = data[data['column_name']>2]

Package: pandas

3. Matplotlib:

Matplotlib is a plotting library for creating static, animated, and interactive visualizations in Python. It provides a simple yet versatile way to create custom visualizations.

Example:

# Importing matplotlib library

import matplotlib.pyplot as plt

# Creating a line plot

x = [1, 2, 3, 4, 5]

y = [3, 6, 2, 7, 1]

plt.plot(x, y)

# Adding axis labels and title

plt.xlabel('X-axis')

plt.ylabel('Y-axis')

plt.title('Line Plot')

Package: matplotlib

Numpy (Numerical Python) is a fundamental package for scientific computing with Python. It provides various mathematical functions for arrays and matrices, enabling array operations to be performed more efficiently than native Python arrays.

Example:

# Importing numpy

import numpy as np

# Creating a numpy array

a = np.array([1,2,3])

b = np.array([4,5,6])

# Adding two numpy arrays

c = a + b

# Multiplying two numpy arrays

d = a * b

Package: numpy

2. Pandas:

Pandas is an open-source data manipulation and analysis library. It provides data structures to effectively handle structured data like csv and excel. It is built on top of Numpy package and provides easy-to-use data manipulation functions.

Example:

# Importing pandas library

import pandas as pd

# Reading a csv file

data = pd.read_csv('filename.csv')

# Selecting a column

column = data['column_name']

# Filtering data using condition

filtered_data = data[data['column_name']>2]

Package: pandas

3. Matplotlib:

Matplotlib is a plotting library for creating static, animated, and interactive visualizations in Python. It provides a simple yet versatile way to create custom visualizations.

Example:

# Importing matplotlib library

import matplotlib.pyplot as plt

# Creating a line plot

x = [1, 2, 3, 4, 5]

y = [3, 6, 2, 7, 1]

plt.plot(x, y)

# Adding axis labels and title

plt.xlabel('X-axis')

plt.ylabel('Y-axis')

plt.title('Line Plot')

Package: matplotlib

Frequently Used Methods

Frequently Used Methods

Frequently Used Methods

Related in langs

Frequently Used Methods

Related