Skip to content

Edge Cases

EC-1: MultiIndex columns

df.columns = pd.MultiIndex.from_tuples([('A', 'one'), ('A', 'two'), ('B', 'one')])
Creates complex hierarchical column structures that require special handling.

Not Supported

EC-2: Rename operations

df = df.rename(columns={'old': 'new'})
Changes column names while preserving their data and position.

Not Supported

EC-3: Set operations

df.columns = ['A', 'B', 'C']
Completely replaces the column structure with a new set of names.

Not Supported

EC-4: Arithmetic operations

df['C'] = df['A'] + df['B']
Creates new columns through arithmetic operations on existing columns.

Not Supported

EC-5: String accessor

df[['first', 'last']] = df['name'].str.split(expand=True)
Expands string content into multiple new columns.

Not Supported

EC-6: JSON normalization

pd.json_normalize(data)
Creates columns with nested names from hierarchical data.

Not Supported

EC-7: Pivot operations

df.pivot_table(index='date', columns='category', values='amount')
Dramatically reshapes the column structure based on unique values.

Not Supported

EC-8: Stack/unstack

df = df.stack().unstack(level=0)
Converts between index levels and columns, potentially changing column names.

Not Supported

EC-9: Transpose

df = df.T
Swaps rows and columns, turning row indices into column names.

Not Supported

EC-10: Column assignment in chain

df.assign(B=1).assign(C=lambda x: x['B']*2)
Creates columns that depend on columns created earlier in the same chain.

Not Supported