The end goal of this question is to plot X and Y for a graph using a dataframe.
I have a dataframe like so:
Open High Low Close Volume stock symbol
Date
2000-10-19 1.37 1.42 1.24 1.35 373590000 AAPL
2000-10-20 1.36 1.46 1.35 1.39 195836200 AAPL
2000-10-23 1.39 1.49 1.39 1.46 129851400 AAPL
2000-10-24 1.48 1.49 1.34 1.35 192711400 AAPL
2000-10-25 1.36 1.37 1.30 1.32 163448600 AAPL
2000-10-26 1.34 1.42 1.25 1.32 178110800 AAPL
2000-10-27 1.35 1.37 1.28 1.33 181242600 AAPL
2000-10-30 1.37 1.42 1.34 1.38 152558000 AAPL
And I am trying to plot Date vs. Open. I know there is a way to simply plot, but I will be applying this concept to larger dataframes and would like to know how to do it "long-hand".
What I've tried:
print(some_DF['Open'])
Result:
Date
2000-10-19 1.37
2000-10-20 1.36
2000-10-23 1.39
2000-10-24 1.48
2000-10-25 1.36
2000-10-26 1.34
Problem:
Date seems to be my index, but the column header 'Open' Does not appear.
Question:
How do i print the above Dataframe while having 'Open' as my header. Then making some value x=Date's column and some value y = 'Open's values?
"Expected Code to work":
Im thinking something like
print([some_DF['Open'] headers = 'date','open')
x = some_DF['Date'] #So that this becomes first column of dataframe
y = some_DF['Open'] #So that this becomes second column of dataframe
print(some_DF[['Open']])?[[]]is doing?