Skip to content

The "Create DataFrame with a MultiIndex" code example in the cheatsheet contains an extra bracket #25029

Closed
@M-YD

Description

@M-YD

The code example shown for "Create DataFrame with a MultiIndex" in the cheatsheet is incorrect as it contains an extra trailing bracket:

df = pd.DataFrame(
          {"a" : [4 ,5, 6], 
           "b" : [7, 8, 9], 
           "c" : [10, 11, 12]},    index = pd.MultiIndex.from_tuples(
          [('d',1),('d',2),('e',2)],
             names=['n','v'])))

It should read:

df = pd.DataFrame(
          {"a" : [4 ,5, 6], 
           "b" : [7, 8, 9], 
           "c" : [10, 11, 12]},    index = pd.MultiIndex.from_tuples(
          [('d',1),('d',2),('e',2)],
             names=['n','v']))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions