Let we have following Panel:
companies = ["GOOG", "YHOO", "AMZN", "MSFT", "AAPL"]
p = data.DataReader(name = companies, data_source="google", start = "2013-01-01", end = "2017-02-22")
I want to extract values of "Low", "MSFT" for two dates "2013-01-02" and "2013-01-08". I use several options and some of them work, some not. Here are those methods:
- Using .ix[] method
p.ix["Low", [0,4], "MSFT"] and the result is:
Date
2013-01-02    27.15
2013-01-08    26.46
Name: MSFT, dtype: float64
So it works, no problem at all.
- Using .iloc[] method
p.iloc[2, [0,4], 3] and it also works.
Date
2013-01-02    27.15
2013-01-08    26.46
Name: MSFT, dtype: float64
- Using .ix[] method again but in different way
p.ix["Low", ["2013-01-02", "2013-01-08"], "MSFT"] and it returns weird result as:
Date
2013-01-02   NaN
2013-01-08   NaN
Name: MSFT, dtype: float64
- Using .loc[] method
p.loc["Low", ["2013-01-02", "2013-01-08"], "MSFT"] and this time an error raised 
KeyError: "None of [['2013-01-02', '2013-01-08']] are in the [index]"
1 and 2 are the ones that work, and it is pretty straightforward. However, I don't understand the reason of getting NaN values in 3rd method and an error in 4th method.
 
     
    