Help on Time Series problem - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Homework (https://python-forum.io/forum-9.html) +--- Thread: Help on Time Series problem (/thread-24677.html) |
Help on Time Series problem - Kishore_Bill - Feb-27-2020 I need guidance on the time series problem below. I tried to do on my own as mentioned below but it is not working. I want to know how can I update the line ‘close_AA=’ import pandas as pd dataFrame = pd.read_csv('dow_jones_index.data',parse_dates=["date"], index_col="date") dataFrame.head() closeTS = dataFrame[(dataFrame.stock == 'AA')].close.str.replace('$',' ').astype(float) #Using the data filtered in the above step list all the closing price from jan to march assign the resulting series to variable 'close_AA' ###Start code here ### tried with ps.series(closeTS) but it is not working close_AA = print (close_AA)###End code(approx 1 line) close_AA.to_csv("output.txt") Question on upsample/downsample - Kishore_Bill - Feb-27-2020 I need help on the below upsample/downsample time series problem and I'm not certain how to complete it. I have a given a try but no luck. import pandas as pd dataFrame = pd.read_csv('dow_jones_index.data',parse_dates=["date"], index_col="date") dataFrame.head() closeTS = dataFrame[(dataFrame.stock == 'AA')].close.str.replace('$',' ').astype(float) ###Upsample the data filtered in the above step month wise and fill the max value of closing price for each month ###return the samples of down sampled data to variable 'upsample' ###Start code here ### tried upsample=closeTS but it is not working upsample = print(upsample) ###End code(approx 1 line) upsample.to_csv("output.txt") |