Is there a way to tell pandas not to index by character columns? My code is
A=['a','b','c']
B=[1,2,3]
pd.DataFrame(A,B)
0
1 a
2 b
3 c
What I want is just two columns so I can do groupby column A. How do I go about doing this? I can do something like this but I would like to skip the column names to gain as much performance as possible.
pd.DataFrame({'A':A,'B':B})
A B
0 a 1
1 b 2
2 c 3
df = pd.DataFrame([A, B]).Tshould give you what you want.pd.DataFrame(list(zip(A,B)))