More stock manipulations - Python Programming for Finance p.4 problem with ohlc()

by: Pui4o, 7 years ago


Hello dear people,

I have question regarding the 4th video from the finance tutorials. It is about the following two lines:


df_ohlc=df['Adj Close'].resample('10D').ohlc()
df_volume=df['Volume'].resample('10D').sum()


for the        df _ohlc         I get the following error: 'Series' object has no attribute 'ohlc'.
On the other hand       df_volume      works fine. I wonder if you guys know how to fix the    ohlc   line. ( I am using Python 2.7 )




You must be logged in to post. Please login or register an account.



I reckon pandas needs updating, I'm getting same error and also on P3 and .rolling attrib, for me just got to work out how to update from 0.17 to 0.19 on linux mint......

Update - have tried on another PC with Pandas 0.19 and it works, note manual says should work with Pandas 0.18 on-wards

-jasonrobert 7 years ago
Last edited 7 years ago

You must be logged in to post. Please login or register an account.


Hi ,I updated pandas to 0.22 but it is still showing the same error,please help

-psachdev42 6 years ago

You must be logged in to post. Please login or register an account.