![]() |
Pandac_concat - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Pandac_concat (/thread-2720.html) |
Pandac_concat - yamanda - Apr-05-2017 Dear all I want to combine two different data frames in one so i have a code Quote:SUM=pd.concat([SUM_1a, result_F1], join='outer' ,axis=1, ignore_index=True and it shows me these: 0 156790.0 YES 12345.0 Field 1 NaN NaN NaN NaN NaN NaN 1 156790.0 YES 12345.0 Field 1 NaN NaN NaN NaN NaN NaN 2 156790.0 YES 12345.0 Field 1 NaN NaN NaN NaN NaN NaN 3 156790.0 YES 12345.0 Field 1 NaN NaN NaN NaN NaN NaN 4 156790.0 YES 12345.0 Field 1 NaN NaN NaN NaN NaN NaN 16 NaN NaN NaN NaN Ver_point_1 0 0 0 2 NaN 17 NaN NaN NaN NaN Ver_point_2 0 0 0 3 NaN 18 NaN NaN NaN NaN Ver_point_3 0 0 0 4 NaN 19 NaN NaN NaN NaN Ver_point_4 0 0 0 5 NaN 20 NaN NaN NaN NaN Ver_point_5 0 0 0 6 NaN 10 11 12 13 14 0 NaN NaN NaN NaN NaN 1 NaN NaN NaN NaN NaN 2 NaN NaN NaN NaN NaN 3 NaN NaN NaN NaN NaN 4 NaN NaN NaN NaN NaN 16 NaN Plane_1 0 0 Note: 17 NaN Plane_2 0 0 Note: 18 NaN Plane_3 0 0 Note: 19 NaN Plane_4 0 0 Note: 20 NaN Plane_5 0 0 Note: How to combine without 16-20 rows?? Thank you :) RE: Pandac_concat - zivoni - Apr-05-2017 You are still joining on index values, parameter ignore_axis=True means ignoring index values on concatenating axis (in this case it removes columns names). To "ignore index" on rows axis you need to set both indices to same values - you can reset them but its faster to set second index as first one ...Simple example:
RE: Pandac_concat - yamanda - Apr-05-2017 Yes it works. Thank You very much :) |