# Python usage

**URL:** https://openturns.discourse.group/c/python/9.md

[Latest](https://openturns.discourse.group/latest.md) · [Categories](https://openturns.discourse.group/categories.md) · [Tags](https://openturns.discourse.group/tags.md)

---

## [About the Python usage category](https://openturns.discourse.group/t/about-the-python-usage-category/21)

<div class="topic-metadata">

**Author:** [@schueller](https://openturns.discourse.group/u/schueller)\
**Replies:** 0

</div>

Get help using openturns from its Python module

---

## [Question about parallel computation in OpenTURNS Pareto frontier optimization](https://openturns.discourse.group/t/question-about-parallel-computation-in-openturns-pareto-frontier-optimization/427)

<div class="topic-metadata">

**Author:** [@XavierFaure](https://openturns.discourse.group/u/XavierFaure)\
**Replies:** 6\
**Last updated:** [July 6, 2026, 8:35am UTC](https://openturns.discourse.group/t/question-about-parallel-computation-in-openturns-pareto-frontier-optimization/427 "2026-07-06T08:35:38Z")

</div>

Dear all, I’m using OpenTURNS to compute the Pareto frontier of some problems with two objective (cost) functions. I’ve managed to use it as intended, but I’m struggling with the computational burden. Currently, all run…

---

## [Kent distribution](https://openturns.discourse.group/t/kent-distribution/434)

<div class="topic-metadata">

**Author:** [@titims](https://openturns.discourse.group/u/titims)\
**Replies:** 3\
**Last updated:** [June 15, 2026, 9:10pm UTC](https://openturns.discourse.group/t/kent-distribution/434 "2026-06-15T21:10:48Z")

</div>

Hi all at OT, I need to implement the Kent Distribution Kent distribution - Wikipedia, more precisely a method to sample from it. Is there a “standard” way to achieve this in OT, meaning using existent Python class that…

---

## [Parameter estimation with Metropolis-Hastings calling external code](https://openturns.discourse.group/t/parameter-estimation-with-metropolis-hastings-calling-external-code/421)

<div class="topic-metadata">

**Author:** [@FoxTango](https://openturns.discourse.group/u/FoxTango)\
**Replies:** 2\
**Last updated:** [November 6, 2025, 7:57am UTC](https://openturns.discourse.group/t/parameter-estimation-with-metropolis-hastings-calling-external-code/421 "2025-11-06T07:57:23Z")

</div>

Hello there, I am currently trying to perform a parameter calibration on a 8-parameter model. The model is computed by a an external software (EMTP) and can be called through Python. As someone familiar with bayesian m…

---

## [Convergence of FORM analysis](https://openturns.discourse.group/t/convergence-of-form-analysis/419)

<div class="topic-metadata">

**Author:** [@EZancato](https://openturns.discourse.group/u/EZancato)\
**Replies:** 1\
**Last updated:** [November 5, 2025, 7:57pm UTC](https://openturns.discourse.group/t/convergence-of-form-analysis/419 "2025-11-05T19:57:23Z")

</div>

Hi everyone! I am new to this forum, but I hope someone has some ideas about my current problem. I am a PhD student working on reliability assessment of deteriorating structures. Sadly I cannot (at least yet) share my en…

---

## [Define and optimize the kriging mean term as a deterministic function dependent on space.](https://openturns.discourse.group/t/define-and-optimize-the-kriging-mean-term-as-a-deterministic-function-dependent-on-space/425)

<div class="topic-metadata">

**Author:** [@Clement](https://openturns.discourse.group/u/Clement)\
**Replies:** 1\
**Last updated:** [September 30, 2025, 7:16pm UTC](https://openturns.discourse.group/t/define-and-optimize-the-kriging-mean-term-as-a-deterministic-function-dependent-on-space/425 "2025-09-30T19:16:52Z")

</div>

Hello, I am currently trying to build a kriging model, but I am having difficulty defining the mean term as a function dependent on space. Here is a brief description of what I can do and what I want to do. Kriging is …

---

## [Normalization of the input sample in KrigingAlgorithm in OT1.16](https://openturns.discourse.group/t/normalization-of-the-input-sample-in-krigingalgorithm-in-ot1-16/101)

<div class="topic-metadata">

**Author:** [@MichaelBaudin](https://openturns.discourse.group/u/MichaelBaudin)\
**Replies:** 10\
**Last updated:** [June 24, 2025, 8:37am UTC](https://openturns.discourse.group/t/normalization-of-the-input-sample-in-krigingalgorithm-in-ot1-16/101 "2025-06-24T08:37:50Z")

</div>

Hi ! After a discussion with colleagues on the features of OT 1.16, I mentioned the important fact that the normalization of the inputs has been dropped: That might have been overlooked by some users, and this is why…

---

## [Sobol' indices with acceptance-rejection sampling](https://openturns.discourse.group/t/sobol-indices-with-acceptance-rejection-sampling/414)

<div class="topic-metadata">

**Author:** [@lsala](https://openturns.discourse.group/u/lsala)\
**Replies:** 2\
**Last updated:** [June 23, 2025, 2:47pm UTC](https://openturns.discourse.group/t/sobol-indices-with-acceptance-rejection-sampling/414 "2025-06-23T14:47:21Z")

</div>

Hi everyone, I’d like to compute Sobol’ indices in a setting where not all input samples are valid, due to feasibility or constraint criteria. I see two possible scenarios and would appreciate your advice on whether eit…

---

## [The hyperbolic enumeration function can be slow when q = 1](https://openturns.discourse.group/t/the-hyperbolic-enumeration-function-can-be-slow-when-q-1/277)

<div class="topic-metadata">

**Author:** [@MichaelBaudin](https://openturns.discourse.group/u/MichaelBaudin)\
**Replies:** 0\
**Last updated:** [March 26, 2023, 4:17pm UTC](https://openturns.discourse.group/t/the-hyperbolic-enumeration-function-can-be-slow-when-q-1/277 "2023-03-26T16:17:10Z")

</div>

Hi! I created a polynomial chaos expansion of a function in relatively large dimension using regression and the LARS selection method. This may require to use the hyperbolic enumeration function. It appears, however, th…

---

## [Can an OpenTURNS PythonFunction transmit exceptions from the Python function?](https://openturns.discourse.group/t/can-an-openturns-pythonfunction-transmit-exceptions-from-the-python-function/408)

<div class="topic-metadata">

**Author:** [@MerlinKeller](https://openturns.discourse.group/u/MerlinKeller)\
**Replies:** 4\
**Last updated:** [March 13, 2025, 2:32pm UTC](https://openturns.discourse.group/t/can-an-openturns-pythonfunction-transmit-exceptions-from-the-python-function/408 "2025-03-13T14:32:16Z")

</div>

Hi, I ran recently in a problem using an OpenTURNS PythonFunction, which I reproduce here in a simplified form: I created the following PythonFunction import openturns as ot import numpy as np def myfunc(x): retu…

---

## [Is it possible to correlate two distributions in a BayesDistribution?](https://openturns.discourse.group/t/is-it-possible-to-correlate-two-distributions-in-a-bayesdistribution/398)

<div class="topic-metadata">

**Author:** [@al2543](https://openturns.discourse.group/u/al2543)\
**Replies:** 4\
**Last updated:** [February 11, 2025, 3:53pm UTC](https://openturns.discourse.group/t/is-it-possible-to-correlate-two-distributions-in-a-bayesdistribution/398 "2025-02-11T15:53:20Z")

</div>

Hi there, I am exploring the use of BayesDistribution within OpenTURNS to model the dependency between two variables. My goal is to capture the correlation between these variables, and I’m curious if OpenTURNS allows fo…

---

## [Otagrum computeConditionalCDF](https://openturns.discourse.group/t/otagrum-computeconditionalcdf/405)

<div class="topic-metadata">

**Author:** [@Paul](https://openturns.discourse.group/u/Paul)\
**Replies:** 1\
**Last updated:** [January 3, 2025, 4:17pm UTC](https://openturns.discourse.group/t/otagrum-computeconditionalcdf/405 "2025-01-03T16:17:24Z")

</div>

Hi, I’m not an expert in statistics, but I am using OTAgrum for my master thesis. My task is to combine Bayesian Networks with copulas. I trained the network with my data (10.000 x 5) → 5 Nodes and sampling and compari…

---

## [Memory issues for MCMC in high dimension](https://openturns.discourse.group/t/memory-issues-for-mcmc-in-high-dimension/403)

<div class="topic-metadata">

**Author:** [@MerlinKeller](https://openturns.discourse.group/u/MerlinKeller)\
**Replies:** 1\
**Last updated:** [December 18, 2024, 1:21pm UTC](https://openturns.discourse.group/t/memory-issues-for-mcmc-in-high-dimension/403 "2024-12-18T13:21:16Z")

</div>

Hi to all Open Turners ! I have been trying to perform Bayesian calibration with a high dimensional parameter (several thousand) using the MCMC classes but ran in what seems to be a memory overflow problem, which causes…

---

## [Conditional Sampling with Distinct Distributions Based on Sampled Values](https://openturns.discourse.group/t/conditional-sampling-with-distinct-distributions-based-on-sampled-values/400)

<div class="topic-metadata">

**Author:** [@al2543](https://openturns.discourse.group/u/al2543)\
**Replies:** 2\
**Last updated:** [December 2, 2024, 7:20pm UTC](https://openturns.discourse.group/t/conditional-sampling-with-distinct-distributions-based-on-sampled-values/400 "2024-12-02T19:20:09Z")

</div>

Hello :slight\_smile: I am currently working on a problem where the distribution applied to a variable depends on the value sampled from another variable. Specifically, I need to sample from one distribution and then, ba…

---

## [PCE design matrix and coefficient fit](https://openturns.discourse.group/t/pce-design-matrix-and-coefficient-fit/265)

<div class="topic-metadata">

**Author:** [@dlouk](https://openturns.discourse.group/u/dlouk)\
**Replies:** 6\
**Last updated:** [November 22, 2024, 2:42pm UTC](https://openturns.discourse.group/t/pce-design-matrix-and-coefficient-fit/265 "2024-11-22T14:42:53Z")

</div>

Greetings, I am trying to reproduce the results of the example “Create a polynomial chaos for the Ishigami function: a quick start guide to polynomial chaos” (Create a polynomial chaos for the Ishigami function: a quick…

---

## [MCMC proposal distribution error](https://openturns.discourse.group/t/mcmc-proposal-distribution-error/388)

<div class="topic-metadata">

**Author:** [@EdgarJaber](https://openturns.discourse.group/u/EdgarJaber)\
**Replies:** 2\
**Last updated:** [October 24, 2024, 8:14am UTC](https://openturns.discourse.group/t/mcmc-proposal-distribution-error/388 "2024-10-24T08:14:18Z")

</div>

Hello, I am trying to implement an MCMC Random-walk Metropolis-Hastings calibration procedure that includes gaussian model discrepancy. I’ve already worked with the RandomWalkMetropolisHastings class before without any t…

---

## [Customize the copula](https://openturns.discourse.group/t/customize-the-copula/392)

<div class="topic-metadata">

**Author:** [@TingdiRen](https://openturns.discourse.group/u/TingdiRen)\
**Replies:** 1\
**Last updated:** [October 17, 2024, 7:52am UTC](https://openturns.discourse.group/t/customize-the-copula/392 "2024-10-17T07:52:11Z")

</div>

I wonder if openturns supports customizing a copula, just like customizing a probability distribution. For example, a copula like C(u,v;\\theta) = uv + \\theta \[u(u-1) (2u-1)\]\[v(v-1)(2v-1)\]. This copula is a useful examp…

---

## [Orthonormalise the cosine sine functions w.r.t a non uniform measure](https://openturns.discourse.group/t/orthonormalise-the-cosine-sine-functions-w-r-t-a-non-uniform-measure/383)

<div class="topic-metadata">

**Author:** [@denisw](https://openturns.discourse.group/u/denisw)\
**Replies:** 3\
**Last updated:** [October 6, 2024, 8:31pm UTC](https://openturns.discourse.group/t/orthonormalise-the-cosine-sine-functions-w-r-t-a-non-uniform-measure/383 "2024-10-06T20:31:17Z")

</div>

I wouls like to know if there is any means in OpenTURNS to build on orthonormal sequence of functions from the usual cosine,sine functions when the scalar product is not w.r.t the uniform measure on \[-\\pi,\\pi\] (for insta…

---

## [Computation time](https://openturns.discourse.group/t/computation-time/385)

<div class="topic-metadata">

**Author:** [@asoubki](https://openturns.discourse.group/u/asoubki)\
**Replies:** 4\
**Last updated:** [October 9, 2024, 9:59am UTC](https://openturns.discourse.group/t/computation-time/385 "2024-10-09T09:59:26Z")

</div>

Hi Everyone, I am new to OpenTURNS and I am wondering if it is possible to optimize this code ? The objective is to generate a sample over multiple variables. Thanks in advance import numpy as np import pandas as pd …

---

## [RBDFAST in OpenTurns?](https://openturns.discourse.group/t/rbdfast-in-openturns/380)

<div class="topic-metadata">

**Author:** [@xavfa](https://openturns.discourse.group/u/xavfa)\
**Replies:** 1\
**Last updated:** [September 25, 2024, 12:48pm UTC](https://openturns.discourse.group/t/rbdfast-in-openturns/380 "2024-09-25T12:48:03Z")

</div>

Hi to all, I’d like to use OpenTurns for some of its very attractive function (copula’s generation), but I’d also like to perform RBDFAST analysis. for whom who would’nt know, It consists in a more efficient way of per…

---

## [Piecewise Transformation of Distribution](https://openturns.discourse.group/t/piecewise-transformation-of-distribution/365)

<div class="topic-metadata">

**Author:** [@TingdiRen](https://openturns.discourse.group/u/TingdiRen)\
**Replies:** 2\
**Last updated:** [June 1, 2024, 2:58am UTC](https://openturns.discourse.group/t/piecewise-transformation-of-distribution/365 "2024-06-01T02:58:24Z")

</div>

Can we use openturns to apply a piecewise transform to a distribution? e.g. X\\sim \\operatorname{Uniform}(0,1) with transform: m(X) = \\begin{cases} 5X & \\textrm{ if } 0 \< X \\leq 0.9; \\\\ 0.9 \\times X + 3.69 & \\textrm{ …

---

## [Calculate Sobol without model](https://openturns.discourse.group/t/calculate-sobol-without-model/370)

<div class="topic-metadata">

**Author:** [@Piniata](https://openturns.discourse.group/u/Piniata)\
**Replies:** 1\
**Last updated:** [June 18, 2024, 6:30pm UTC](https://openturns.discourse.group/t/calculate-sobol-without-model/370 "2024-06-18T18:30:07Z")

</div>

Hi there, In the past 3 weeks I ran a quite huge model in Matlab in a Monte Carlo simulation. I use Python for analyzing the outputs. One part of the analysis is the calculation of the Sobol’ indices of first and total…

---

## [Correlation coefficient in Nataf transform](https://openturns.discourse.group/t/correlation-coefficient-in-nataf-transform/359)

<div class="topic-metadata">

**Author:** [@yexiang1992](https://openturns.discourse.group/u/yexiang1992)\
**Replies:** 1\
**Last updated:** [May 16, 2024, 6:26am UTC](https://openturns.discourse.group/t/correlation-coefficient-in-nataf-transform/359 "2024-05-16T06:26:36Z")

</div>

Dear developer, hello. I have a question to ask. I have a correlation between two arbitrary distributions ρ\_x. How can I get the correlation between standard normal distributions ρ\_z through Nataf transformation in Ope…

---

## [Multivariate distribution with combined relationship](https://openturns.discourse.group/t/multivariate-distribution-with-combined-relationship/339)

<div class="topic-metadata">

**Author:** [@asoubki](https://openturns.discourse.group/u/asoubki)\
**Replies:** 7\
**Last updated:** [April 4, 2024, 3:46pm UTC](https://openturns.discourse.group/t/multivariate-distribution-with-combined-relationship/339 "2024-04-04T15:46:22Z")

</div>

Hi, I am new in OpenTURNS and i am trying to create a multivariate distribution to generate a sample of 4 variables : A, B, C and D. The 2 first (A & B) are independent, but the 2 last one are linked between each other…

---

## [Exceptions in a PythonFunction](https://openturns.discourse.group/t/exceptions-in-a-pythonfunction/322)

<div class="topic-metadata">

**Author:** [@MichaelBaudin](https://openturns.discourse.group/u/MichaelBaudin)\
**Replies:** 3\
**Last updated:** [February 5, 2024, 4:28pm UTC](https://openturns.discourse.group/t/exceptions-in-a-pythonfunction/322 "2024-02-05T16:28:22Z")

</div>

Hi! I want to see what happens when we build a surrogate model while ignoring some of the observations which lead to failures in the model evaluation. This can be emulated by considering a toy model and raising an excep…

---

## [Empirical Bernstein copula on a weighted sample?](https://openturns.discourse.group/t/empirical-bernstein-copula-on-a-weighted-sample/334)

<div class="topic-metadata">

**Author:** [@efekhari27](https://openturns.discourse.group/u/efekhari27)\
**Replies:** 3\
**Last updated:** [December 5, 2023, 11:34am UTC](https://openturns.discourse.group/t/empirical-bernstein-copula-on-a-weighted-sample/334 "2023-12-05T11:34:48Z")

</div>

Hi everyone, I was wondering if there is a way in OpenTURNS to fit an empirical Bernstein copula (EBC) using a weighted sample. Let us consider two samples \\mathbf{X}\_{0, n}, \\mathbf{X}\_{1, n} (each in \\mathbb{R}^d, wi…

---

## [Why does the LHS class exist?](https://openturns.discourse.group/t/why-does-the-lhs-class-exist/309)

<div class="topic-metadata">

**Author:** [@MichaelBaudin](https://openturns.discourse.group/u/MichaelBaudin)\
**Replies:** 8\
**Last updated:** [November 20, 2023, 10:59am UTC](https://openturns.discourse.group/t/why-does-the-lhs-class-exist/309 "2023-11-20T10:59:01Z")

</div>

Hi ! The LHS class estimates a probability using a Latin Hypercube Design. On the other hand, the ProbabilitySimulationAlgorithm can use a Latin Hypercube Design to estimate a probability, but can use other WeightedExp…

---

## [Computing Conditional Quantiles](https://openturns.discourse.group/t/computing-conditional-quantiles/326)

<div class="topic-metadata">

**Author:** [@denisw](https://openturns.discourse.group/u/denisw)\
**Replies:** 3\
**Last updated:** [November 2, 2023, 5:54pm UTC](https://openturns.discourse.group/t/computing-conditional-quantiles/326 "2023-11-02T17:54:58Z")

</div>

The method computeConditionalQuantile of a distribution seams only to deal with the last component. What is the trick to get the conditional quantile of say X2 of a 3 dim distribution X1,X2,X3 ie. the conditional quantil…

---

## [SubsetSampling intermediary quantiles estimation](https://openturns.discourse.group/t/subsetsampling-intermediary-quantiles-estimation/264)

<div class="topic-metadata">

**Author:** [@efekhari27](https://openturns.discourse.group/u/efekhari27)\
**Replies:** 4\
**Last updated:** [October 30, 2023, 3:16pm UTC](https://openturns.discourse.group/t/subsetsampling-intermediary-quantiles-estimation/264 "2023-10-30T15:16:30Z")

</div>

Hi everyone, I recently started using the OpenTURNS implementation of the Subset sampling algorithm to estimate rare event probabilities. As described in the documentation example, I tried to isolate the different subse…

---

## [KernelSmoothing Warning](https://openturns.discourse.group/t/kernelsmoothing-warning/229)

<div class="topic-metadata">

**Author:** [@WinterSpark](https://openturns.discourse.group/u/WinterSpark)\
**Replies:** 5\
**Last updated:** [September 1, 2023, 3:32pm UTC](https://openturns.discourse.group/t/kernelsmoothing-warning/229 "2023-09-01T15:32:11Z")

</div>

Hello, I allow myself to ask a question in this forum because i want to use the Kernel Smoothing method in order to build a generic PDF for my experimental data i used this statement to create the distribution: loaded\_…

[Next page](https://openturns.discourse.group/c/python/9.md?page=1)
