List Zip method identifies series as index

60 Views Asked by At

I have created tuples before like this:

list(zip(df['Column1'],df['Column2']))

But when I do this, it doesn't work.

    Lane    Carrier Scac    Cust Linehaul_2022Q2    Cust Linehaul_2022Q3    Cust Linehaul_2022Q4    Load Number_2022Q2  Load Number_2022Q3  Load Number_2022Q4
0   ADELANTO, CA - BLOOMINGTON, CA  RDWY    0.0 105.9   0.0 0   1   0
1   ALACHUA, FL - LITHIA SPRINGS, GA    MGXB    0.0 1603.0  0.0 0   1   0
2   ALACHUA, FL - LITHIA SPRINGS, GA    RDWY    101.3   105.1   0.0 1   1   0

list(zip(df_SO['Cust Linehaul_2022Q2'],df_SO['Cust Linehaul_2022Q3']))

TypeError: 'Index' object is not callable

I learnt that way to make a tuple from this thread: How do I iterate through two lists in parallel?

But not sure why this one is identifying as an index and not a series.

0

There are 0 best solutions below