# Parallelising loops using ray Core

**URL:** <https://discuss.ray.io/t/parallelising-loops-using-ray-core/12379>\
**Category:** Ray Core\
**Created:** [October 9, 2023, 10:08am UTC](https://discuss.ray.io/t/parallelising-loops-using-ray-core/12379 "2023-10-09T10:08:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abi\_Vignesh](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/abi_vignesh/32/5165_2.png) [@Abi\_Vignesh](https://discuss.ray.io/u/Abi_Vignesh)\
**Post date:** [October 9, 2023, 10:08am UTC](https://discuss.ray.io/t/parallelising-loops-using-ray-core/12379/1 "2023-10-09T10:08:59Z")

</div>

Hi, I have a Linear Solver algorithm that sets constraints and solves it. My use case is that, I have ~3000 rows (call it as a group) and 18 years (time series). I take a particular year and then for that year, I solve for the 3000 groups. So I have something like,

```auto
for year in self.year_list:
  df_filtered= grouped_df[grouped_df['year'] == year].reset_index(0, drop=True)
  group_list = list(df_filtered['group'].unique())
  for group in group_list:
     df_solution, df_impossible = solve(df_filtered, group, year)

```

I’m new to Ray and I’d like to know if I can use Ray to parallelise this process. Thanks in advance

---

<div class="post-metadata">

**Author:** ![yic](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yic/32/437_2.png) [@yic](https://discuss.ray.io/u/yic)\
**Post date:** [October 12, 2023, 4:58pm UTC](https://discuss.ray.io/t/parallelising-loops-using-ray-core/12379/2 "2023-10-12T16:58:51Z")

</div>

You can either try ray.data or just mark the solve function remote.
