Please format your code using </>
icon as explained in this guide and not the citation button. It will make your post more readable.
Or use markdown style like:
```
CODE
```
Please edit your post.
You can use delete by query feature but I don't know how you call it from python.
Easier may be to do that in Kibana Dev Console.