How to access column via index when using iterrows()

I want to know how I can access columns using index rather than name when using iterrows to traverse DataFrames.

This code is most I could find:

for index, row in df.iterrows():
    print row['Date']

This is another approach I took to traverse, but it seems very slow:

for i in df.index:
    for j in range(len(df.columns)):       
                    df.ix[i,j] = 0


You can use ix to access by index:

In [67]: df
       A  B
0  test1  1
1  test2  4
2  test3  1
3  test4  2

In [68]: df.ix[:,1]
0    1
1    4
2    1
3    2
Name: B, dtype: int64

Updating your code with first column:

for index, row in df.iterrows():

I figured it out. Iterate for i to number of columns and use i as index to access columns:

for i in range(len(df.columns)):  
    for index, row in df.iterrows():    
        print row.ix[i]

Need Your Help web api

I've been reading up about MVC 4 and was interested in the web API feature.

Single board computer GPRS and GPS

linux-kernel gps embedded-linux gprs

I am running a project on cubieboard and it is fine enough. But current project require a same configuration with embedded GPRS(with sim card holder) and GSM module. If I implement it with USB 3G d...