With the following DataFrame:
baz = pd.DataFrame({("a", "b"): [1, 2, 3], "g": [11, 12, 13]})
if I try to select columns from it like this:
baz[[("a", "b"), "g"]]
everything is fine. If, however, I access it like this:
baz[["g", ("a", "b")]]
I get an error:
ValueError: setting an array element with a sequence
Is this a bug, or something I'm doing wrong? I'm using pandas 0.22.0, the same happens with 0.20.1
Edit: This is not the same as Numpy ValueError: setting an array element with a sequence. This message may appear without the existing of a sequence? since I'm not explicitly setting anything per se. (Although it may of course relate to the same underlying bug; I have no idea.)