# Multiple dimensional sampling with first element string

**URL:** <https://discourse.julialang.org/t/multiple-dimensional-sampling-with-first-element-string/58863>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump, flux\
**Created:** [April 8, 2021, 5:44pm UTC](https://discourse.julialang.org/t/multiple-dimensional-sampling-with-first-element-string/58863 "2021-04-08T17:44:28Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [April 8, 2021, 6:59pm UTC](https://discourse.julialang.org/t/multiple-dimensional-sampling-with-first-element-string/58863/10 "2021-04-08T18:59:25Z")

</div>

I’m trying to condense your problem into a minimal working example (MWE), see here [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) for how to structure questions that are easy to understand.

It is not certain that I can help, but I can help to simplify your question, at least.

So most of your code plays no part here. I reduced your example to this:

```julia
using Surrogates
x_train = sample(10, ["s1", 1], ["s4", 10], SobolSample())

```

This gives an error:

```julia
ERROR: MethodError: no method matching +(::String, ::Int64)

```

But you are saying that this is no longer a problem, and your code now fails at the next line:

> [@GraceMabele](#):
>
> `y_train = g.(x_train);`

instead?

How did you get the `x_train`?

---

_[View the full topic](https://discourse.julialang.org/t/multiple-dimensional-sampling-with-first-element-string/58863)._
