Universal Functions In Pandas
1. UNIVERSAL FUNCTIONS: INDEX PRESERVATION
import numpy as np
import pandas as pd
# creating random state
rand = np.random.RandomState(42)
# Creating Pandas Series of random integers
ser1 = pd.Series(rand.randint(10, size=4))
print(ser1)0 6
1 3
2 7
3 4
dtype: int64# Creating Pandas DataFrame
df1 = pd.DataFrame(rand.randint(10,size=(3,4)),
columns=['a','b','c','d'])
print(df1)2. UNIVERSAL FUNCTIONS: INDEX ALIGNMENT
2.1. Index Alignment in Series
add() method with fill_value
2.2. Index Alignment in DataFrame
add() method with fill_value
2.3. Python Operators and their equivalent Pandas Methods
Python operator
Parameter method(s)
3. UNIVERSAL FUNCTIONS: OTHER OPERATIONS
3.1. Understanding βaxisβ keyword argument
One way to look at axis kwarg:
axis kwarg:Another way to look at axis kwarg:
axis kwarg:3.2. Operations on Self
3.3. Operation between Series and DataFrame
Last updated