this is my dataframe:

```
col1 col2
0 12.13 13.13
1 100.133 12.19994
2 11.16664 140.13
3 9.13 2.13
4 3.23 10.13
```

Now i want the column value which has the maximum decimal point length.

```
**OUTPUT:**
maximum_de_point
**COL1** 11.16664
**COL2** 12.19994
```

Something like this should work

```
import pandas as pd
import numpy as np
col1 = [
12.13,
100.133,
11.16664,
9.13,
3.23
]
col2 = [
13.13,
12.19994,
140.13,
2.13,
10.13
]
df = pd.DataFrame(np.array([col1, col2]).T, columns=['col1','col2'])
# decimal lengths of col1
len1 = df['col1'].astype('str').apply(lambda a: len(a.split('.')[1]))
# decimal lengths of col2
len2 = df['col2'].astype('str').apply(lambda a: len(a.split('.')[1]))
# get value at that index
col1_max = df['col1'][len1[len1 == max(len1)].index].tolist()[0]
col2_max = df['col2'][len2[len2 == max(len2)].index].tolist()[0]
```

One option is splitting the values with `str.split`

, taking the `str.len`

of the decimal part and finding the `idxmax`

of each column. Then `lookup`

with the resulting values:

```
df_ixmax = df.astype(str).apply(lambda x: x.str.split('.').str[1].str.len()).idxmax(0)
df_ixmax[:] =df.lookup(*df_ixmax.reset_index().values[:,::-1].T)
df_ixmax
col1 11.16664
col2 12.19994
dtype: float64
```

Or we could also use `decimal.Decimal`

, which enables to obtain a count of the decimal places through the returned named tuple by `as_tuple()`

, and then index the dataframe similarly to above from the result:

```
from decimal import Decimal
ix = [[Decimal(str(x)).as_tuple().exponent for x in col] for col in df.values.T]
max_vals = df.values[np.array(ix).argmin(1), np.arange(df.shape[1])]
pd.Series(max_vals, index=df.columns)
col1 11.16664
col2 12.19994
dtype: float64
```