I have a pandas dataframe with all the IBM prices (close, open, high, low) in it since 1962.
I would like to make a numpy array out of it with only closing prices.
I know you can use numpy.asarray
but that command will keep all of the values (close, open, high, low). Does anyone know how to do the conversion and only keep close?
Asked
Active
Viewed 21 times
0

RedBirdHasFlown
- 48
- 3
-
3`df['close'].values` or `df['close'].to_numpy()`? – Anurag Dabas Aug 09 '21 at 11:00
-
I don't meant o be harsh, but this can be looked up in the docs in less time than it took to write your question. By the way;```df.loc[:, 'column_name_that_i_want'].to_numpy()``` – jrbergen Aug 09 '21 at 11:01