here i have a code snip that creates a groupby object with the count of duplicates.
gbo = data2.groupby("1").count()
display(gbo)
this works perfectly because the column names are indexes but will not work if the columns do not have a numeric index. i want to call the column by index number for the groupby function and need the correct simple syntax. this is the output of the above code and has the correct result.
0 2 3 4 5
1
Alph 7 6 5 4
Beta 351 350 337 303
Gamma 234 233 230 226
Delt 2 1 0 0
the issue is that if the columns were designated as Col1, Col2, Col3.. ect,. how do i access Col1 as column index0 or column 2 as column index1. i cant seem to find the proper syntax