# Is there a way to select the type of indices Ti with sprand()?

**URL:** https://discourse.julialang.org/t/is-there-a-way-to-select-the-type-of-indices-ti-with-sprand/127259
**Category:** General Usage
**Tags:** sparsearrays
**Created:** [March 22, 2025, 11:34am UTC](https://discourse.julialang.org/t/is-there-a-way-to-select-the-type-of-indices-ti-with-sprand/127259 "2025-03-22T11:34:19Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![AntoineBut](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/antoinebut/32/213352_2.png) [@AntoineBut](https://discourse.julialang.org/u/AntoineBut)
#### Post date: [March 22, 2025, 12:15pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-select-the-type-of-indices-ti-with-sprand/127259/2 "2025-03-22T12:15:21Z")

</div>

I could probably use the `similar()` function as posted 3 hours ago [here](https://discourse.julialang.org/t/why-sprand-does-not-accept-a-distribution-arg/127255/4). Thanks @gdalle.

I am still wondering wether a `sprand()` method taking two types in parameters would be useful though 🤔

---

_[View the full topic](https://discourse.julialang.org/t/is-there-a-way-to-select-the-type-of-indices-ti-with-sprand/127259)._
