BUG: ensuring that np.asarray() simple handles data as objects and doesn't…
State: closed

… try to do smart things (GH22160)

- [x] closes #22160
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22161?src=pr&el=h1) Report
> Merging [#22161](https://codecov.io/gh/pandas-dev/pandas/pull/22161?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/475e391eaa0c85c4615ad6da5f81dee9b890635b?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/22161/graphs/tree.svg?width=650&height=150&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/22161?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #22161   +/-   ##
=======================================
  Coverage   92.08%   92.08%           
=======================================
  Files         169      169           
  Lines       50704    50704           
=======================================
  Hits        46691    46691           
  Misses       4013     4013
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.49% <100%> (ø)` | :arrow_up: |
| #single | `42.33% <0%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22161?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/algorithms.py](https://codecov.io/gh/pandas-dev/pandas/pull/22161/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWxnb3JpdGhtcy5weQ==) | `94.69% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22161?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22161?src=pr&el=footer). Last update [475e391...ab06c38](https://codecov.io/gh/pandas-dev/pandas/pull/22161?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Hello @realead! Thanks for updating the PR.





Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on August 10, 2018 at 09:50 Hours UTC
For asv continuous -f 1.1 upstream/master HEAD -b ^series_methods -b ^algorithms the result was:

>  BENCHMARKS NOT SIGNIFICANTLY CHANGED.

can you rebase and run perf tests on algos. I find ever small changes sometimes can really impact perf here.
There were no performance changes:

`asv continuous -f 1.01 upstream/master HEAD -b ^series_methods -b ^algorithms -b ^categorial`

<details>

```
· Creating environments
· Discovering benchmarks
·· Uninstalling from conda-py3.6-Cython-matplotlib-numexpr-numpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
·· Installing into conda-py3.6-Cython-matplotlib-numexpr-numpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt..
· Running 60 total benchmarks (2 commits * 1 environments * 30 benchmarks)
[  0.00%] · For pandas commit hash f11b14a6:
[  0.00%] ·· Building for conda-py3.6-Cython-matplotlib-numexpr-numpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt...
[  0.00%] ·· Benchmarking conda-py3.6-Cython-matplotlib-numexpr-numpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
[  0.00%] ··· Running benchmarks.........................
[  0.00%] ··· Setting up algorithms.py:95
[  0.00%] ··· Running benchmarks.........
[  1.67%] ··· algorithms.Duplicated.time_duplicated_float           16.1±1ms;...
[  3.33%] ··· algorithms.Duplicated.time_duplicated_int           9.85±0.3ms;...
[  5.00%] ··· algorithms.Duplicated.time_duplicated_string        10.6±0.2μs;...
[  6.67%] ··· ...icatedUniqueIndex.time_duplicated_unique_int         31.1±0.1μs
[  8.33%] ··· algorithms.Factorize.time_factorize_float             60.3±3ms;...
[ 10.00%] ··· algorithms.Factorize.time_factorize_int               20.0±3ms;...
[ 11.67%] ··· algorithms.Factorize.time_factorize_string           143±0.5ms;...
[ 13.33%] ··· algorithms.Match.time_match_string                         368±4μs
[ 15.00%] ··· series_methods.Clip.time_clip                            121±0.5μs
[ 16.67%] ··· series_methods.Dir.time_dir_strings                    1.97±0.03ms
[ 18.33%] ··· series_methods.Dropna.time_dropna                  2.72±0.04ms;...
[ 20.00%] ··· series_methods.IsIn.time_isin                      1.56±0.01ms;...
[ 21.67%] ··· ...ForObjects.time_isin_long_series_long_values         3.30±0.1ms
[ 23.33%] ··· ...cts.time_isin_long_series_long_values_floats         5.94±0.1ms
[ 25.00%] ··· ...orObjects.time_isin_long_series_short_values        2.03±0.02ms
[ 26.67%] ··· series_methods.IsInForObjects.time_isin_nans               636±6μs
[ 28.33%] ··· ...orObjects.time_isin_short_series_long_values        1.10±0.03ms
[ 30.00%] ··· series_methods.Map.time_map                           979±20μs;...
[ 31.67%] ··· series_methods.NSort.time_nlargest                 2.78±0.05ms;...
[ 33.33%] ··· series_methods.NSort.time_nsmallest                2.31±0.05ms;...
[ 35.00%] ··· ...s_methods.SeriesConstructor.time_constructor        157±1μs;...
[ 36.67%] ··· ...SeriesGetattr.time_series_datetimeindex_repr        3.11±0.03μs
[ 38.33%] ··· series_methods.ValueCounts.time_value_counts        2.20±0.3ms;...
[ 40.00%] ··· algorithms.Hashing.time_frame                           21.2±0.3ms
[ 41.67%] ··· algorithms.Hashing.time_series_categorical              5.42±0.1ms
[ 43.33%] ··· algorithms.Hashing.time_series_dates                   3.23±0.06ms
[ 45.00%] ··· algorithms.Hashing.time_series_float                   3.29±0.03ms
[ 46.67%] ··· algorithms.Hashing.time_series_int                     3.34±0.04ms
[ 48.33%] ··· algorithms.Hashing.time_series_string                   13.8±0.5ms
[ 50.00%] ··· algorithms.Hashing.time_series_timedeltas              3.29±0.03ms
[ 50.00%] · For pandas commit hash 475e391e:
[ 50.00%] ·· Building for conda-py3.6-Cython-matplotlib-numexpr-numpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt...
[ 50.00%] ·· Benchmarking conda-py3.6-Cython-matplotlib-numexpr-numpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
[ 50.00%] ··· Running benchmarks.........................
[ 50.00%] ··· Setting up algorithms.py:95
[ 50.00%] ··· Running benchmarks.........
[ 51.67%] ··· algorithms.Duplicated.time_duplicated_float         14.8±0.6ms;...
[ 53.33%] ··· algorithms.Duplicated.time_duplicated_int           10.7±0.8ms;...
[ 55.00%] ··· algorithms.Duplicated.time_duplicated_string        10.5±0.2μs;...
[ 56.67%] ··· ...icatedUniqueIndex.time_duplicated_unique_int         30.8±0.4μs
[ 58.33%] ··· algorithms.Factorize.time_factorize_float             58.8±3ms;...
[ 60.00%] ··· algorithms.Factorize.time_factorize_int               21.5±2ms;...
[ 61.67%] ··· algorithms.Factorize.time_factorize_string             148±5ms;...
[ 63.33%] ··· algorithms.Match.time_match_string                         363±2μs
[ 65.00%] ··· series_methods.Clip.time_clip                              118±1μs
[ 66.67%] ··· series_methods.Dir.time_dir_strings                    1.94±0.02ms
[ 68.33%] ··· series_methods.Dropna.time_dropna                  2.77±0.06ms;...
[ 70.00%] ··· series_methods.IsIn.time_isin                      1.56±0.02ms;...
[ 71.67%] ··· ...ForObjects.time_isin_long_series_long_values        3.29±0.08ms
[ 73.33%] ··· ...cts.time_isin_long_series_long_values_floats        5.89±0.09ms
[ 75.00%] ··· ...orObjects.time_isin_long_series_short_values        2.07±0.03ms
[ 76.67%] ··· series_methods.IsInForObjects.time_isin_nans             668±200μs
[ 78.33%] ··· ...orObjects.time_isin_short_series_long_values         1.36±0.8ms
[ 80.00%] ··· series_methods.Map.time_map                        1.02±0.02ms;...
[ 81.67%] ··· series_methods.NSort.time_nlargest                 2.84±0.06ms;...
[ 83.33%] ··· series_methods.NSort.time_nsmallest                2.40±0.09ms;...
[ 85.00%] ··· ...s_methods.SeriesConstructor.time_constructor        157±2μs;...
[ 86.67%] ··· ...SeriesGetattr.time_series_datetimeindex_repr         3.17±0.2μs
[ 88.33%] ··· series_methods.ValueCounts.time_value_counts       2.19±0.04ms;...
[ 90.00%] ··· algorithms.Hashing.time_frame                           21.1±0.6ms
[ 91.67%] ··· algorithms.Hashing.time_series_categorical             5.02±0.02ms
[ 93.33%] ··· algorithms.Hashing.time_series_dates                   3.18±0.01ms
[ 95.00%] ··· algorithms.Hashing.time_series_float                   3.23±0.06ms
[ 96.67%] ··· algorithms.Hashing.time_series_int                     3.38±0.03ms
[ 98.33%] ··· algorithms.Hashing.time_series_string                   13.9±0.4ms
[100.00%] ··· algorithms.Hashing.time_series_timedeltas              3.25±0.07ms
```

</details>

```
**BENCHMARKS NOT SIGNIFICANTLY CHANGED.**
```
@realead ok with this, can you remove the whatsnew note. ping on green.
Close/Open to trigger CI-run
thanks @realead