0

I have Series where the index and column name are stocked. I want to print only the index and column from Series and not whole dataframe.

Series
0       wkeans
1     wContour
2    wDarkBand
3     wContour

Dataframe
     wContour  wDarkBand  wkeans
0   92.000000        0.0    94.0
1   90.000000       88.0    84.0
2   84.000000       86.0    84.0
3   84.000000        0.0   102.0

I want to have :

enter image description here

I.e. :

94.0
90.0
86.0
84.0

dfW.loc[myseries], dfW.loc[s.index, s.values] do not work, any suggestion ?

Thanks

Viktoriia
  • 85
  • 1
  • 2
  • 10
  • Your desired output has no index. Yet your question suggests you want index & values. Can you please clarify? – jpp May 11 '18 at 16:44
  • I add some colors, hope that it is clearer, I want to print only values of dataframes – Viktoriia May 14 '18 at 10:41
  • Sorry, still not clear how you got the yellow highlighting for 94/90/86/84 output. – jpp May 14 '18 at 13:22
  • It is just to explanation what I want, I did it with paint. And I want to achieve it with pandas. – Viktoriia May 14 '18 at 15:42
  • So what's your **logic** to extract the yellow values? Just random. By row index & column name? This is still unclear. – jpp May 14 '18 at 15:44
  • 1
    Using the linked `DataFrame.lookup` method, you could use `df.lookup(df.index, s)`. – DSM May 14 '18 at 15:58
  • No, it is not random, they are taken from Series, did you get that ? – Viktoriia May 18 '18 at 15:08

0 Answers0