ENH: Raise ParserWarning when length of names does not match length of data
- [x] closes #21768
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

@gfyoung 

Raising ParserWarning now. Could change to FutureWarning, if we would like to deprecate for 2.0

As long as we are only raising a ParserWarning I am inclined to raise for trailing commas too.
can you merge master.

I think this might be too noisy (in the real world) to raise on a trailing command as this is a common thing to write for csv formats. Merged master, so we should avoid raising the warning when one set of trailing commas is given? > Merged master, so we should avoid raising the warning when one set of trailing commas is given?

yeah i think so This should do the trick. One set of trailing commas is allowed can you merge master.

cc @gfyoung  Merged This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. @jreback Open point here:

Should we raise always when having more separators than in the header column or is one more ok? i think we might break things but can u show an example of what u mean Ok to summarize: raise means warn

The following should definitely not raise:
```
stream = StringIO("""
one,two,three
foo,bar,baz
""")
pd.read_csv(stream, index_col=False)
```

Header lenght equals data length, so everything is fine.
The following should raise:
```
stream = StringIO("""
one,two,three
foo,bar,baz,bam
""")
pd.read_csv(stream, index_col=False)
```
The data length is greater than the header length, so we lose data through the reading process. 

The open point is, if the following should raise:

```
stream = StringIO("""
one,two,three
foo,bar,baz,
""")
pd.read_csv(stream, index_col=False)
```

One trailing comma, so you could argue, that no data loss occurs. @jreback mentioned above, that this case should not raise, which makes the detection a bit harder. this looks reasonable.

any comments @pandas-dev/pandas-core  @phofl can you rebase and some questions above I think I have adressed all comments @phofl can you resolve conflicts.  resolved conflicts, @jreback ready to merge? thanks @phofl  @meeseeksdev backport 1.3.x Something went wrong ... Please have  a look at my logs.