How to set up sigma for multiple batches of data?

Segmentation error is wild. Can you provide a fully reproducible snippet (as simplified as possible) to play with?