Skip to content

Tag: multi-index

applymap() does not work on Pandas MultiIndex Slice

I have an hierarchical dataset: I want to apply a function to all values under the columns A. I can set the value to something: Easy enough. Now, instead of assigning a value, if I want to apply a mapping to this MultiIndex slice, it does not work. For example, let me apply a simple formatting statement: This…