For the code below import pandas as pd df_data = pd.DataFrame( [ {"a": 2, "b": 1}, {"a": 2, "b": 10}, {"a": 3, "b": 77}, ] ) df_data.groupby("a").size().to_frame("size") mypy complains toy.py:12: error: "Series[Any]" not callable [operator] Found 1 error in 1 file (checked 1 source file) I know the complain is due to to_frame call, not sure why or how to fix? versions: pandas: 2.2.2 pandas-stub: 2.2.2.240807 mypy: 1.11.2 Continue reading...