I'm creating multi-level columns for dataframes:
lst_of_tuples = [('A', 'X'), ('A', 'Y'), ('B', 'X'), ('B', 'Y')]
columns = pd.MultiIndex.from_tuples(lst_of_tuples, names=[None, None])
Which seems to match the documenation, example below (though I'm building multi-level columns, not an index):
index = pd.MultiIndex.from_tuples(tuples, names=["first", "second"])
and I'm getting a warning from PyCharm about an expected type, specifically on the "names" variable:
Expected type 'Optional[Sequence[Hashable]]', got 'list[None]' instead
I'm getting the results I wanted, but I'd love to clear this warning up anyway. I'm not sure what type of object should be entered here, since the documentation seems clear. Is this a PyCharm bug? Thanks in advance for any insights!