import pandas as pd
import numpy as np
 
df = pd.read_csv("./data.csv")
 
df.fillna(np.nan, inplace=True)
 
# Find values in column greater than 0
df["column"].loc[df["column"] > 0]
 
# Find values in column that match regex (4 digit years between 1000-2999)
df["column"].loc[df["column"].str.match(r'^[12][0-9]{3}$')]
 
# Replace match in string column with capturing group
df["column"].str.replace('^[12][0-9]{3}$', lambda m: m.group(0) + 'add stuff here', regex=True, inplace=True)
 

How to

See also