Dataframe looks the same but the structure is different when loop

I am generating a dataframe from a JSON file, this JSON file can come from 2 different sources, so the internal structure is slightly different, so what I am doing is first detecting the source and from there I do a set of operations that gives me a Dataframe

Everything is good until here (I thought), as when I print it in jupyter it shows me the way I wanted they look the same (structure), the problem goes when I loop through them,

I get completely different results (this df have each same number of columns, 7 columns)

When I loop:

In 1 I have only 2 columns in the other one I get all the columns.

I am looping:

for i, (index, row) in enumerate(df_trans.iterrows()):
print(row)


Is there a way to see how is structure, I am quite confused of why the print of the df loops the same but when looping is not

EDIT

I notice that when I print the dataframe after a grouping I get the followin

df_summary_trans_cs.groupby(['Date'])['sale', 'refund','Balance'].agg('sum')


I get all the columns

but when I add the column

df_summary_trans_cs.groupby(['Date'])['sale', 'refund','Balance', 'Trans'].agg('sum')


I only get that column, the other 3 dissapears

• Its possible that in the df that prints only 2 columns the other are set as index. Print df1.columns and df2.columns and see if they are the same. – yoav_aaa Aug 12 '18 at 12:18
• @DaFanat both shows me Index(['detail', 'date', 'amount'], dtype='object') however when i do type() only 1 shows me pandas.core.frame.DataFrame but it doesnt have much sense as both I defined them as df = pd.DataFrame() – Manza Aug 12 '18 at 12:27

df.MissingColumn = df.MissingColumn.astype(np.float64)