BUG: 'Unnamed' != unnamed column in CSV
State: closed

False criterion was causing errors when specified headers appeared to capture
a seemingly unnamed row, just because they had the string "Unnamed" in it.

Setup:

~~~python
from pandas import read_csv
from pandas.compat import StringIO

data = "Unnamed,NotUnnamed\n0,1\n2,3\n4,5"
read_csv(StringIO(data), header=[0, 1])
~~~

Previously, this would error:

~~~python
...
ValueError : Passed header=[0,1] are too many rows for this multi_index of columns
~~~

Now, it nicely returns a `DataFrame`:

~~~python
  Unnamed NotUnnamed
        0          1
0       2          3
1       4          5
~~~

Leverages the patch used in #23484 of `self.unnamed_cols`.

Labels:
name: Bug
name: IO CSV
description: read_csv, to_csv

Comments:
Hello @gfyoung! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/io/parsers.py`](https://github.com/gfyoung/pandas/blob/ec41e07614638df50dfab43860f939d07a63499b/pandas/io/parsers.py) !

 - There are no PEP8 issues in the file [`pandas/tests/io/parser/header.py`](https://github.com/gfyoung/pandas/blob/ec41e07614638df50dfab43860f939d07a63499b/pandas/tests/io/parser/header.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23687?src=pr&el=h1) Report
> Merging [#23687](https://codecov.io/gh/pandas-dev/pandas/pull/23687?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a23f90142352b6427916292b2b9faa7bb61d07bc?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #23687      +/-   ##
==========================================
- Coverage   92.25%   92.25%   -0.01%     
==========================================
  Files         161      161              
  Lines       51383    51381       -2     
==========================================
- Hits        47404    47402       -2     
  Misses       3979     3979
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.64% <100%> (-0.01%)` | :arrow_down: |
| #single | `42.32% <0%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23687?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/parsers.py](https://codecov.io/gh/pandas-dev/pandas/pull/23687/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhcnNlcnMucHk=) | `95.54% <100%> (-0.01%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23687?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/23687?src=pr&el=footer). Last update [a23f901...ff68dbd](https://codecov.io/gh/pandas-dev/pandas/pull/23687?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@jreback : Address the comment, and all is still green.  PTAL.
conflict in the whatsnew, can you merge master
@jreback : Rebased my changes, and all is green.  PTAL.
@jreback : Addressed all comments, all is still green.  PTAL.
thanks!
I'm getting bunch of these "unnamed ..." where my column is empty. Is this related to the same bug?
ex:

Unnamed: 1_level_0 | **Baseline Features** | Unnamed: 3_level_0 | Unnamed: 4_level_0 | Unnamed: 5_level_0 | Unnamed: 6_level_0 | Unnamed: 7_level_0
-- | -- | -- | -- | -- | -- | --



@SamLevinSE : I don't believe so.  However, if you are welcome to open a new issue to provide more details, as it could still be a problem with `pandas` (can't tell from this).
@gfyoung What if I give you some more Information? could you please check these two screenshots and let me know if I need to create a new bug/issue or if I'm doing something wrong?
![image](https://user-images.githubusercontent.com/37846034/75490109-d1acc400-59b3-11ea-98e5-6514c3bf6a3f.png)

![image](https://user-images.githubusercontent.com/37846034/75490154-ea1cde80-59b3-11ea-9e59-27a572a1055b.png)
Thank you!

This looks expected as far as I can see.