Maximum and minimum value of C types integers from Python

According to: [Python 3 docs]: Numeric Types – int, float, complex: Integers have unlimited precision. Translated to code: >>> i = 10 ** 100 >>> i 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 >>> len(str(i)) 101 >>> i.bit_length() 333 On the other hand, each C type has a fixed size (depending on platform / architecture), as clearly shown in [CPPReference]: Fundamental … Read more

Which maximum does Python pick in the case of a tie?

It picks the first element it sees. See the documentation for max(): If multiple items are maximal, the function returns the first one encountered. This is consistent with other sort-stability preserving tools such as sorted(iterable, key=keyfunc, reverse=True)[0] and heapq.nlargest(1, iterable, key=keyfunc). In the source code this is implemented in ./Python/bltinmodule.c by builtin_max, which wraps the … Read more

min for each row in a data frame

You can use apply to go through each row apply(df, 1, FUN = min) Where 1 means to apply FUN to each row of df, 2 would mean to apply FUN to columns. To remove missing values, use: apply(df, 1, FUN = min, na.rm = TRUE)