pandas fetches specific row and column data

pandas fetches specific row and column data


Similar to numpy usage, but not the same,

    data = pd.read_csv('train.csv',encoding='big5')
    data = data.iloc[1:, 4:]

The one on the left 1:represents fetching the first line to the last line.
The ``4:``` on the right means to take out the fourth to the last column.

So ilocis the key. emm

Guess you like

Origin blog.csdn.net/qq_32507417/article/details/111330987