0% found this document useful (0 votes)
3 views5 pages

NumPy and Pandas Basics Guide

The document provides an introduction to NumPy and Pandas, covering basic array creation, operations, indexing, and slicing in NumPy, as well as Series and DataFrame creation, access methods, and data operations in Pandas. It includes examples of creating arrays and DataFrames, performing calculations, and manipulating data structures. Key functions and methods for both libraries are highlighted for efficient data handling.

Uploaded by

fake786king
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

NumPy and Pandas Basics Guide

The document provides an introduction to NumPy and Pandas, covering basic array creation, operations, indexing, and slicing in NumPy, as well as Series and DataFrame creation, access methods, and data operations in Pandas. It includes examples of creating arrays and DataFrames, performing calculations, and manipulating data structures. Key functions and methods for both libraries are highlighted for efficient data handling.

Uploaded by

fake786king
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Page 1: Introduction to NumPy

import numpy as np

Arrays:

arr = [Link]([1, 2, 3])

Zeros and Ones:

[Link]((2, 3))

[Link]((2, 2))

Basic Operations:

arr + 1, arr * 2, [Link], [Link]


Page 2: NumPy Indexing and Slicing

Access elements:

arr[0], arr[-1]

Slicing:

arr[1:3], arr[:], arr[::-1]

Boolean Indexing:

arr[arr > 2]

Multidimensional Access:

arr[1, 2], arr[:, 1]


Page 3: NumPy Functions

Useful functions:

[Link](arr), [Link](arr), [Link](arr)

[Link](arr), [Link](arr), [Link](arr)

Reshape and Flatten:

[Link](3, 2), [Link]()


Page 4: Introduction to Pandas

import pandas as pd

Series:

s = [Link]([1, 2, 3])

DataFrame:

df = [Link]({'A': [1, 2], 'B': [3, 4]})

Access:

df['A'], [Link][0], [Link][0]


Page 5: Pandas Data Operations

[Link](), [Link]()

[Link](), [Link]()

Filtering:

df[df['A'] > 1]

Adding Columns:

df['C'] = df['A'] + df['B']

Drop Columns:

[Link]('C', axis=1)

You might also like