# Is there a package with a function that gives cartesian product of two or more sequences?

**URL:** https://discourse.julialang.org/t/is-there-a-package-with-a-function-that-gives-cartesian-product-of-two-or-more-sequences/63030
**Category:** General Usage
**Tags:** question
**Created:** [June 16, 2021, 4:23pm UTC](https://discourse.julialang.org/t/is-there-a-package-with-a-function-that-gives-cartesian-product-of-two-or-more-sequences/63030 "2021-06-16T16:23:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![curious](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/curious/32/7629_2.png) [@curious](https://discourse.julialang.org/u/curious)
#### Post date: [June 16, 2021, 4:23pm UTC](https://discourse.julialang.org/t/is-there-a-package-with-a-function-that-gives-cartesian-product-of-two-or-more-sequences/63030/1 "2021-06-16T16:23:38Z")

</div>

Package IterTools used to have a `product` function to create a cartesian product of two or more sequences. Version 1.3.0 of IterTools still has this function, but it appears to be deprecated. Asking for help in the repl returns this

```julia
# 1 method for generic function "product":
  [1] product(xss...) in IterTools at deprecated.jl:70

```

Also, the documentation on the website ([Introduction · IterTools](https://juliacollections.github.io/IterTools.jl/release-1.3/)) does not include any information on the `product` function.

Which is the recommended package today to calculate cartesian product of two or more sequences?

Thank you

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [June 16, 2021, 4:27pm UTC](https://discourse.julialang.org/t/is-there-a-package-with-a-function-that-gives-cartesian-product-of-two-or-more-sequences/63030/2 "2021-06-16T16:27:45Z")

</div>

> [@curious](#):
>
> Which is the recommended package today to calculate cartesian product of two or more sequences?

Use the (built-in) `Iterators.product` function.

---

<div class="post-metadata">

### Author: ![curious](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/curious/32/7629_2.png) [@curious](https://discourse.julialang.org/u/curious)
#### Post date: [June 16, 2021, 4:31pm UTC](https://discourse.julialang.org/t/is-there-a-package-with-a-function-that-gives-cartesian-product-of-two-or-more-sequences/63030/3 "2021-06-16T16:31:33Z")

</div>

This is great. Thank you so much!  
Surprisingly Googling did not help much in this regard.
