我有一个带有一列的 Pandas DataFrame:import pandas as pddf = pd.DataFrame({\'teams\': [[\'SF\', \'NYG\'] for _ in range(7)]}) teams0 [SF, NYG]1 [SF, NYG]...
我有一个包含一列的 Pandas DataFrame:
import pandas as pd
df = pd.DataFrame({"teams": [["SF", "NYG"] for _ in range(7)]})
teams
0 [SF, NYG]
1 [SF, NYG]
2 [SF, NYG]
3 [SF, NYG]
4 [SF, NYG]
5 [SF, NYG]
6 [SF, NYG]
如何将这一列列表分成两列?
期望结果:
team1 team2
0 SF NYG
1 SF NYG
2 SF NYG
3 SF NYG
4 SF NYG
5 SF NYG
6 SF NYG