Examples
import numpy as np import pandas as pd
df = pd.DataFrame({'P': [[2, 3, 4], 'fff', [], [4, 5]], 'Q': 2}) df
df = pd.DataFrame({'P': [[2, 3, 4], 'fff', [], [4, 5]], 'Q': 2}) df.explode('P')