You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to merge the two dataframe such that I get:
variable
entry
subentry
0
1
X
2
Y
3
Z
1
1
A
2
B
Simply using df1.append(df2, ignore_index=True) gives
variable
0
X
1
Y
2
Z
3
A
4
B
In other words, it appends on the highest level (level 1) in the dataframes. I think it important to allow the user dealing with mutli-index dataframes to specify which level of the dataframe to append on. In the simple example above, this would allow me to specify "entry" as the index to append on.
Here is a code sinppet that will reproduce the problem:
In practice, I am looking ao combine N dataframes, each with a different number of "entry" rows. So I am looking for an approach that will not rely on me knowing the exact of the dataframes I am combining.
The text was updated successfully, but these errors were encountered:
This is exactly what I'm asking to make more flexible. The reseting of the index causes the loss of my multi-index structure. I think there should be flexibility in append to just append on one level and only reset one level's index.
I have two dataframes:
The first one looks like this:
and the second one looks like:
I would like to merge the two dataframe such that I get:
Simply using
df1.append(df2, ignore_index=True)
givesIn other words, it appends on the highest level (level 1) in the dataframes. I think it important to allow the user dealing with mutli-index dataframes to specify which level of the dataframe to append on. In the simple example above, this would allow me to specify "entry" as the index to append on.
Here is a code sinppet that will reproduce the problem:
In practice, I am looking ao combine N dataframes, each with a different number of "entry" rows. So I am looking for an approach that will not rely on me knowing the exact of the dataframes I am combining.
The text was updated successfully, but these errors were encountered: