date-histogram

Python: Plot month-wise normalised histogram

删除回忆录丶 提交于 2019-12-08 06:24:10
问题 I have a CSV file with data that look like this: Time Pressure 1/1/2017 0:00 5.8253 ... ... 3/1/2017 0:10 4.2785 4/1/2017 0:20 5.20041 5/1/2017 0:30 4.40774 6/1/2017 0:40 4.03228 7/1/2017 0:50 5.011924 12/1/2017 1:00 3.9309888 I want to make a month-wise histogram (NORMALIZED) on the pressure data and finally write the plots into PDF. I understand that I need to use Groupby and Numpy.hist option,but I'm not sure how to use them. (I'm a newbie to Python). Please help! CODE 1: n = len(df) // 5

Elasticsearch average over date histogram buckets

喜欢而已 提交于 2019-12-07 03:28:51
问题 I've got a bunch of documents indexed in ElasticSearch, and I need to get the following data: For each month, get the average number of documents per working day of the month (or if impossible, use 20 days as the default). I already aggregated my data into months buckets using the date histogram aggregation. I tried to nest a stats bucket, but this aggregations uses data extracted from the document's field, not from the parent bucket. Here is my query so far: { "query": { "match_all": {} },