I’m trying to calculate the ratio between first max. and the first min. value of g[r] .
I did a coordination analysis(for calculating RDF) and then using a python script modifier implemented max() and min() function.
But the problem with this is, it’s not finding the 1st max. and 1min. value. For min. it takes 0. Also if there is two-particle type in the system then it can not take value for rdf.y and return nan.

So, is there any possible way to do it in Ovito by using python modifier.

yes, that is the expected behavior of the numpy.max() and numpy.min() functions, please refer to the numpy documentation https://numpy.org/doc/stable/.

Concerning the shape of rdf.y : Please note that when you activate the option “Compute partial RDFs” within the Coordination Analysis modifier settings, data.tables[‘coordination-rdf’].y will be a numpy array of shape (n, X), where n is the number of bins and X is the number of possible particle type pair-combinations. If your system consists of 2 particle types, you will thus get three columns, i.e. for the 1-1, 1-2 and 2-2 type pair interactions, and you can access them like this: