Rainfall based Crop Insurance Payout calculation - Python

56 views
Skip to first unread message

SreeHarsha

unread,
Jan 22, 2021, 2:23:42 AM1/22/21
to datameet

Dear All,

My friend Naveen who volunteers along with various Farmers Movements and organisations, has come across a road block while trying to do some calculations w.r.t Crop Insurance Payout. This year in state of telangana, the government has not implemented the PMFBY policy and due to heavy rains many farmers have lost a lot of crops and are in severe losses. So we are trying to simulate what would have been the payout the farmers would have received in case PMFBY was in place.

He has written the code in Python for calculating the same.
Below is short description of the issue he needs help with:

"I am analysing daily rainfall data to calculate Insurance payout for farmers in case of excess rainfall coverage. policy covers if the "Consecutive 3 day cumulative rainfall" is greater than 50mm between 1st-Oct and 31st-Oct. I was able to write the code in Python to find the matching criteria. But when it rains continuously then the result has overlapping dates which is not acceptable payout. Need help in calculating best payout option in case of overlapping dates."
I have attached the attachments also for further understanding.

He has also summarised the issue in this stack overflow thread.


Request people to share their thoughts and suggestions.

Regards
Sreeharsha

code.txt
Daily Rainfall sample data.png
this result has overlapping dates.png

Pratap Vardhan

unread,
Jan 22, 2021, 10:41:48 AM1/22/21
to datameet
Hi Sreeharsha -- Could you also add expected result (dataframe) to the SO question? Avoid images if you can, you're more likely to get answers from the community if it's easy to replicate the problem. Also see https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples

Sreeharsha Thanneeru

unread,
Jan 22, 2021, 11:24:34 AM1/22/21
to datameet, Pratap Vardhan, naveen ramisetty
Hi Pratap,

Thanks a lot for the quick reply. I have reached out to Naveen on this and also tagging him in this email.

Regards,
Sreeharsha


☒Regards
Sreeharsha


--
Datameet is a community of Data Science enthusiasts in India. Know more about us by visiting http://datameet.org
---
You received this message because you are subscribed to a topic in the Google Groups "datameet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/datameet/gcTettEhyPg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to datameet+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/datameet/02b45536-c9b8-483c-bbd7-a8df4d4da7aen%40googlegroups.com.

Sarabjeet Matharu

unread,
Jan 23, 2021, 11:26:44 PM1/23/21
to data...@googlegroups.com, Pratap Vardhan, naveen ramisetty
Hi Sreeharsha,

In case the issue is still open, can you clarify what the evaluation rule is ?

From what I can gather, it looks like the following:

1. Evaluate dataframe to find set of three or more consecutive days of rainfall > 50mm
2. In case there are 3 days of consecutive rainfall, calculate output basis 3 days of assessment. In case there are (say) 7 consecutive days of rainfall, calculate output basis 7 days of assessment. 

The current bug seems to be that instead of a single assessment of 7 days, the code assesses 4x3 consecutive days of rainfall. 

Is this correct?

Regards, 
Sarabjeet

You received this message because you are subscribed to the Google Groups "datameet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datameet+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/datameet/eb43de80309a56e102bb744eec344061d29c2d98%40hey.com.
Reply all
Reply to author
Forward
0 new messages