Andrei Eremchuk
Andrei Eremchuk

Reputation: 155

How to fetch metadata from pandas DataMatrix

I try to use LINCS data(to computing combination of compound by machine learning), but occasionally they formatting in awkward pandas DataFrame (why not simple matrix?). I already learn how fetch other data (gctoo.data_df.iloc[9]) but i need fetch metadata and i am stack at this. I do this

nomy_gctoo.col_metadata_df

And get this

Empty DataFrame
Columns: []
Index: [REP.A001_A375_24H_X1_B22:A03, REP.A001_A375_24H_X1_B22:A04, REP.A001_A375_24H_X1_B22:A05, REP.A001_A375_24H_X1_B22:A06, REP.A001_A375_24H_X1_B22:A07, REP.A001_A375_24H_X1_B22:A08, REP.A001_A375_24H_X1_B22:A08, ...]

How i can get array of index names?

Upvotes: 1

Views: 163

Answers (1)

jezrael
jezrael

Reputation: 863166

Try .index:

arr = nomy_gctoo.col_metadata_df.index

L = nomy_gctoo.col_metadata_df.index.tolist()

Upvotes: 2

Related Questions