<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/polars-helps-coping-with-black-swan-events-at-la-mobili-re-qv4wqhv5j" -->

---
title: Polars helps coping with black swan events at La Mobilière
description: La Mobilière, a Swiss insurance cooperative, rewrote its actuarial simulation engine using Polars instead of pandas to model catastrophic risk years for Swiss...
canonical: https://daily.dev/posts/polars-helps-coping-with-black-swan-events-at-la-mobili-re-qv4wqhv5j
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Polars helps coping with black swan events at La Mobilière | daily.dev
og:description: La Mobilière, a Swiss insurance cooperative, rewrote its actuarial simulation engine using Polars instead of pandas to model catastrophic risk years for Swiss...
og:url: https://daily.dev/posts/polars-helps-coping-with-black-swan-events-at-la-mobili-re-qv4wqhv5j
og:image: https://api.daily.dev/og/posts/QV4WQhv5j.png
og:image:alt: Polars helps coping with black swan events at La Mobilière
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Polars helps coping with black swan events at La Mobilière

**[Polars Blog](https://daily.dev/sources/polars)** · 5 min read · 0 upvotes · 0 comments

## Summary

La Mobilière, a Swiss insurance cooperative, rewrote its actuarial simulation engine using Polars instead of pandas to model catastrophic risk years for Swiss Solvency Test compliance. The migration let them run simulations at much greater scale (100M+ row DataFrames at 1 million simulation years) since Polars uses all CPU cores, unlike pandas' single-core execution. The team reports 5-10x faster runtimes, simpler code for tail-risk calculations like TVaR (using Polars' filter-within-groupby), and better use of cloud compute resources.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://pola.rs/posts/case-mobiliere>

## Questions this post answers

### Why is Polars faster than pandas for large-scale simulations on a single machine?

Polars natively utilizes all CPU cores on a machine, while pandas primarily runs on a single core. This means scaling pandas workloads to larger cloud instances mostly increases compute costs without a proportional speedup, whereas Polars can take real advantage of multi-core cloud hardware, delivering reported speedups of 5-10x in production risk modeling.

_Comparing pandas and Polars for scaling data pipelines is easier with real case studies on daily.dev._

### How do you calculate tail value at risk (TVaR) within a group_by using Polars?

You can filter within an aggregation expression directly, for example using pl.col("Loss").filter(pl.col("Loss") > pl.col("Loss").quantile(0.99)).mean() inside a group_by().agg() call. This computes the mean of the worst 1% of losses per group in a single step, unlike pandas which requires a double groupby, a custom function, and a join to combine results.

_Developers refining risk or analytics queries can track Polars expression patterns like this on daily.dev._

## Similar posts on daily.dev

- [Should AI Developers Make the Switch from Polars to Pandas?](https://daily.dev/posts/should-ai-developers-make-the-switch-from-polars-to-pandas--3mrkktnhr) · Towards Data Science · 0 upvotes · 0 comments
- [Pandas Should Go Extinct](https://daily.dev/posts/pandas-should-go-extinct-1jqzeauiq) · Lobsters · 0 upvotes · 0 comments
- [How to Use the Polars Library in Python for Data Analysis](https://daily.dev/posts/how-to-use-the-polars-library-in-python-for-data-analysis-stzxazhnq) · freeCodeCamp · 3 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#fintech](https://daily.dev/tags/fintech), [#data-engineering](https://daily.dev/tags/data-engineering), [#pandas](https://daily.dev/tags/pandas), [#polars](https://daily.dev/tags/polars)

[View this post on daily.dev](https://daily.dev/posts/polars-helps-coping-with-black-swan-events-at-la-mobili-re-qv4wqhv5j)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Polars helps coping with black swan events at La Mobilière","url":"https://daily.dev/posts/polars-helps-coping-with-black-swan-events-at-la-mobili-re-qv4wqhv5j","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/polars-helps-coping-with-black-swan-events-at-la-mobili-re-qv4wqhv5j"},"datePublished":"2026-08-16T08:53:15.835Z","dateModified":"2026-08-16T08:54:45.372Z","description":"La Mobilière, a Swiss insurance cooperative, rewrote its actuarial simulation engine using Polars instead of pandas to model catastrophic risk years for Swiss...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5434e7bec80a8efdf8c46b2f6f76f432?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5434e7bec80a8efdf8c46b2f6f76f432?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Polars Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Polars Blog","logo":"https://media.daily.dev/image/upload/s--xo60W3UW--/c_limit,w_256/f_auto,q_auto/v1786870390/logos/polars?_a=BAMAMicg0","url":"https://daily.dev/sources/polars"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/polars-helps-coping-with-black-swan-events-at-la-mobili-re-qv4wqhv5j","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,fintech,data-engineering,pandas,polars","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Polars Blog","item":"https://daily.dev/sources/polars"},{"@type":"ListItem","position":3,"name":"Polars helps coping with black swan events at La Mobilière"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/polars-helps-coping-with-black-swan-events-at-la-mobili-re-qv4wqhv5j#faq","mainEntity":[{"@type":"Question","name":"Why is Polars faster than pandas for large-scale simulations on a single machine?","acceptedAnswer":{"@type":"Answer","text":"Polars natively utilizes all CPU cores on a machine, while pandas primarily runs on a single core. This means scaling pandas workloads to larger cloud instances mostly increases compute costs without a proportional speedup, whereas Polars can take real advantage of multi-core cloud hardware, delivering reported speedups of 5-10x in production risk modeling. Comparing pandas and Polars for scaling data pipelines is easier with real case studies on daily.dev."}},{"@type":"Question","name":"How do you calculate tail value at risk (TVaR) within a group_by using Polars?","acceptedAnswer":{"@type":"Answer","text":"You can filter within an aggregation expression directly, for example using pl.col(\"Loss\").filter(pl.col(\"Loss\") > pl.col(\"Loss\").quantile(0.99)).mean() inside a group_by().agg() call. This computes the mean of the worst 1% of losses per group in a single step, unlike pandas which requires a double groupby, a custom function, and a join to combine results. Developers refining risk or analytics queries can track Polars expression patterns like this on daily.dev."}}]}
```

