简体   繁体   中英

Time Series Analysis

I have a dataset that has been recorded periodical for quantities of items sold. this dataset contains the following columns: Item ID, Date(2015-01-01, 2022-12-01), Quantities of items sold. how do I split the dataset by which item id's have less or equal to 12 data points historically as I am trying to forecast item sales for the next 6 months. In Python

grouped_data = df.groupby('item_id').apply(lambda x: x[x['date'].count() <= 12])

I have been able to this by just applying this code: Good_data = p[p['Create month/year']>48].index.values Good_data.shape. This filters our Data to get only the item indexes that has datapoints greater than 4 years, and looking at the shape of the list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM