我需要使用python将1列转换为3列。我的数据是数据帧类型
My data is:
0 1321.1321
1 text1
2 321113
0 1426.2156
1 text2
2 145454
Run Code Online (Sandbox Code Playgroud)
我想以以下格式接收它:
col1 col2 col3
1321.1321 text1 321113
1426.2156 text2 145454
Run Code Online (Sandbox Code Playgroud)
我尝试使用枢轴,重塑形状,但没有一个可以提供所需的解决方案
My data is:
0 1321.1321
1 text1
2 321113
0 1426.2156
1 text2
2 145454
Run Code Online (Sandbox Code Playgroud)
我想以以下格式接收它:
col1 col2 col3
1321.1321 text1 321113
1426.2156 text2 145454
col1 col2 col3
1321.1321
text1
321113
1426.2156
text2
145454
Run Code Online (Sandbox Code Playgroud)