Question : df.groupby('col_a')['time_stamp'].idxmin() is not working if time_stamp is of  type object
#### Code Sample, a copy-pastable example if possible

```python
Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 11:27:44) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> pd.__version__
'0.23.4'
>>> data = {'time_stamp': ['2015-05-01 18:47:05.069', '2014-05-01 18:47:05.069', '2014-05-01 18:47:05.119', '2014-05-02 18:47:05.230',],
...         'col_a': [25., 34., 25, 34]}
>>> df = pd.DataFrame(data, columns = ['time_stamp', 'col_a',])
>>> df.dtypes
time_stamp     object
col_a         float64
dtype: object
>>> df.groupby('col_a')['time_stamp'].min()
col_a
25.0    2014-05-01 18:47:05.119
34.0    2014-05-01 18:47:05.069
Name: time_stamp, dtype: object
>>> df.groupby('col_a')['time_stamp'].idxmin()
Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 918, in apply
    result = self._python_apply_general(f)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 936, in _python_apply_general
    self.axis)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 2273, in apply
    res = f(group)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 820, in curried_with_axis
    return f(x, *args, **kwargs_with_axis)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\series.py", line 1715, in idxmin
    i = nanops.nanargmin(com._values_from_object(self), skipna=skipna)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\nanops.py", line 74, in _f
    raise TypeError(msg.format(name=f.__name__.replace('nan', '')))
TypeError: reduction operation 'argmin' not allowed for this dtype

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 835, in wrapper
    return self.apply(curried_with_axis)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 3469, in apply
    return super(SeriesGroupBy, self).apply(func, *args, **kwargs)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 930, in apply
    return self._python_apply_general(f)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 936, in _python_apply_general
    self.axis)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 2273, in apply
    res = f(group)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 820, in curried_with_axis
    return f(x, *args, **kwargs_with_axis)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\series.py", line 1715, in idxmin
    i = nanops.nanargmin(com._values_from_object(self), skipna=skipna)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\nanops.py", line 74, in _f
    raise TypeError(msg.format(name=f.__name__.replace('nan', '')))
TypeError: reduction operation 'argmin' not allowed for this dtype

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 918, in apply
    result = self._python_apply_general(f)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 936, in _python_apply_general
    self.axis)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 2273, in apply
    res = f(group)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 823, in curried
    return f(x, *args, **kwargs)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\series.py", line 1715, in idxmin
    i = nanops.nanargmin(com._values_from_object(self), skipna=skipna)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\nanops.py", line 74, in _f
    raise TypeError(msg.format(name=f.__name__.replace('nan', '')))
TypeError: reduction operation 'argmin' not allowed for this dtype

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 838, in wrapper
    return self.apply(curried)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 3469, in apply
    return super(SeriesGroupBy, self).apply(func, *args, **kwargs)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 930, in apply
    return self._python_apply_general(f)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 936, in _python_apply_general
    self.axis)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 2273, in apply
    res = f(group)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 823, in curried
    return f(x, *args, **kwargs)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\series.py", line 1715, in idxmin
    i = nanops.nanargmin(com._values_from_object(self), skipna=skipna)
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\nanops.py", line 74, in _f
    raise TypeError(msg.format(name=f.__name__.replace('nan', '')))
TypeError: reduction operation 'argmin' not allowed for this dtype

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 848, in wrapper
    return self._aggregate_item_by_item(name,
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 765, in __getattr__
    (type(self).__name__, attr))
AttributeError: 'SeriesGroupBy' object has no attribute '_aggregate_item_by_item'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Anaconda3\envs\env_nlp_arag\lib\site-packages\pandas\core\groupby\groupby.py", line 851, in wrapper
    raise ValueError
ValueError
>>> df[df['time_stamp'].isin(df.groupby('col_a')['time_stamp'].min())]
                time_stamp  col_a
1  2014-05-01 18:47:05.069   34.0
2  2014-05-01 18:47:05.119   25.0
>>> df['time_stamp'] = pd.to_datetime(df['time_stamp'], format="%Y-%m-%d %H:%M:%S.%f")
>>> df.dtypes
time_stamp    datetime64[ns]
col_a                float64
dtype: object
>>> df.groupby('col_a')['time_stamp'].min()
col_a
25.0   2014-05-01 18:47:05.119
34.0   2014-05-01 18:47:05.069
Name: time_stamp, dtype: datetime64[ns]
>>> df.groupby('col_a')['time_stamp'].idxmin()
col_a
25.0    2
34.0    1
Name: time_stamp, dtype: int64
```
#### Problem description

[this should explain **why** the current behaviour is a problem and why the expected output is a better solution.]

 df.groupby('col_a')['time_stamp'].idxmin() is not working if time_stamp is of type object while it is not problem to get the min(): df.groupby('col_a')['time_stamp'].min()

casting 'time_stamp' as datetime solve the issue. The other options is to get indices using another method. Is this expected ?

**Note**: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!

**Note**: Many problems can be resolved by simply upgrading `pandas` to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if `master` addresses this issue, but that is not necessary.

For documentation-related issues, you can check the latest versions of the docs on `master` here:

https://pandas-docs.github.io/pandas-docs-travis/

If the issue has not been resolved there, go ahead and file it in the issue tracker.

#### Expected Output

#### Output of ``pd.show_versions()``

<details>

[paste the output of ``pd.show_versions()`` here below this line]
>>> pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 3.6.6.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 142 Stepping 9, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pandas: 0.23.4
pytest: 3.6.2
pip: 18.0
setuptools: 40.4.3
Cython: 0.28.3
numpy: 1.14.5
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 7.0.1
sphinx: None
patsy: 0.5.1
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.1
openpyxl: 2.5.3
xlrd: 1.1.0
xlwt: None
xlsxwriter: None
lxml: 3.8.0
bs4: None
html5lib: 1.0.1
sqlalchemy: 1.2.8
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
</details>
