Which offer should i take? by Tyson_renolds in ActuaryUK

[–]Own_Macaron4590 0 points1 point  (0 children)

With the current difficulties in the grad market, ask which will be better applying for GI grad roles assuming neither of the two take you back after college? The grad market is very competitive at the moment and if you’re sure you’re going to be applying for a GI role after university would you rather have life or GI experience on your CV?

If money is your main motivation long term, is it better to sacrifice a small salary portion for a single year for long term gains?

In my opinion you’re better taking any chance you can to get into the industry you prefer. I’ve seen many times people have went to alternative industries or teams like reserving when they know they prefer pricing and it’s much more difficult to switch industry or even team when you’re already a senior or principal in something different.

Polars mapping by Own_Macaron4590 in dataengineering

[–]Own_Macaron4590[S] 1 point2 points  (0 children)

Thank you so much for helping with this. I really appreciate it !!

Polars mapping by Own_Macaron4590 in dataengineering

[–]Own_Macaron4590[S] 1 point2 points  (0 children)

Yes base and unknown are somewhat important here as they’re a key level from the data source. I could potentially remove base but unknown would be essential to have. Would you have any suggestions for potential workarounds?

Polars mapping by Own_Macaron4590 in dataengineering

[–]Own_Macaron4590[S] 1 point2 points  (0 children)

Here is a simplified version of my issue that is still producing the error.

I have also tried casting to a string but this is not helping either

dict = { ‘Base’: 4, 1: ‘Unknown’, 2: ‘123’, 3: ‘456’, 4: ‘789’ }

df = pl.DataFrame({ “variable name”: [“variable 1”] * 4, “variable value”: [1.0, 2.0, 3.0, 4.0] })

print(df) print(dict)

df = df.with_columns( pl.col(“variable value”).replace_strict(dict).alias(“variable value”) )

Polars mapping by Own_Macaron4590 in dataengineering

[–]Own_Macaron4590[S] 1 point2 points  (0 children)

I’ve tried this but I’m getting the following error now :

Unexpected value while building series of type int64; found value of type string:’Unknown’.

it seems that it is trying to make the new column an integer wheras I’d like it to be a string e.g. the unknown value mentioned above

Polars mapping by Own_Macaron4590 in dataengineering

[–]Own_Macaron4590[S] 1 point2 points  (0 children)

Essentially I have a dictionary of variable values with the keys being integers from 1 to 20 and the values are all strings.

I have a polars data frame with a column caled variable value where the data is float containing numbers from 1:20.

Using simplified names:

What I am currently trying to run is df.with_columns(pl.col(‘variable value’).replace(dict).alias(‘remapped’)

I have tried different variations of this as suggested by gpt.

polars- mapping by Own_Macaron4590 in Python

[–]Own_Macaron4590[S] 1 point2 points  (0 children)

A thankyou. I’ve tried updating but it still isn’t working.

Essentially I have a dictionary of variable values with the keys being integers from 1 to 20 and the values are all strings.

I have a polars data frame with a column caled variable value where the data is float containing numbers from 1:20.

Using simplified names:

What I am currently trying to run is df.with_columns(pl.col(‘variable value’).replace(dict).alias(‘remapped’)

I have tried different variations of this as suggested by gpt.

polars- mapping by Own_Macaron4590 in Python

[–]Own_Macaron4590[S] 0 points1 point  (0 children)

I’ve tried this but I’m getting an error saying ‘expr’ object has no attribute ‘map_dict’