I convert json to Pandas dataframe and would like to call the value of "c".
>>> quote
{u'c': 89.77, u'h': 90.51, u'l': 89.32, u'o': 90.09, u'pc': 90.29, u't': 1591778794}
>>> quote = pd.DataFrame(quote.items())
>>> quote
0 1
0 c 8.977000e+01
1 h 9.051000e+01
2 l 8.932000e+01
3 o 9.009000e+01
4 pc 9.029000e+01
5 t 1.591779e+09
I want the data for c. I currently used quote.iloc[0][1] but it is not robust.
What is the robust and elegant way to get the data for "c"?
quote[quote['0'] == 'c']should probably work. This way you can get the sub-dataframe where the value of column '0' is 'c' (regardless of its position).quote[quote[0] == 'c']?