BUG: Fix problem with SparseDataFrame not persisting to csv
State: closed

- [x] closes #19384
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: IO CSV
description: read_csv, to_csv
name: Sparse
description: Sparse Data Type

Comments:
Hello @hexgnu! Thanks for updating the PR.





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

##### Comment last updated on February 01, 2018 at 13:26 Hours UTC
K updated thanks @jreback 
@hexgnu do the tests you've written pass for you locally?
oi sorry, should pass now.


Still one lint failure: https://travis-ci.org/pandas-dev/pandas/jobs/335405859#L3035

I'm looking into the (unrelated) S3 failures later this morning.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19441?src=pr&el=h1) Report
> Merging [#19441](https://codecov.io/gh/pandas-dev/pandas/pull/19441?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/238499ab0a48a0ad4a2011e2ce1c6a02c86124eb?src=pr&el=desc) will **increase** coverage by `0.05%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #19441      +/-   ##
==========================================
+ Coverage   91.62%   91.67%   +0.05%     
==========================================
  Files         150      148       -2     
  Lines       48724    48553     -171     
==========================================
- Hits        44642    44513     -129     
+ Misses       4082     4040      -42
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.04% <100%> (+0.05%)` | :arrow_up: |
| #single | `41.72% <100%> (-0.03%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19441?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/internals.py](https://codecov.io/gh/pandas-dev/pandas/pull/19441/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzLnB5) | `95.47% <100%> (ø)` | :arrow_up: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/19441/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `65.22% <0%> (-1.74%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/19441/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.42% <0%> (-0.16%)` | :arrow_down: |
| [pandas/core/indexes/multi.py](https://codecov.io/gh/pandas-dev/pandas/pull/19441/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9tdWx0aS5weQ==) | `95.06% <0%> (-0.09%)` | :arrow_down: |
| [pandas/io/parsers.py](https://codecov.io/gh/pandas-dev/pandas/pull/19441/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhcnNlcnMucHk=) | `95.49% <0%> (ø)` | :arrow_up: |
| [pandas/core/resample.py](https://codecov.io/gh/pandas-dev/pandas/pull/19441/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzYW1wbGUucHk=) | `96.43% <0%> (ø)` | :arrow_up: |
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/19441/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `82.41% <0%> (ø)` | :arrow_up: |
| [pandas/io/formats/format.py](https://codecov.io/gh/pandas-dev/pandas/pull/19441/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvZm9ybWF0LnB5) | `96.24% <0%> (ø)` | :arrow_up: |
| [pandas/core/dtypes/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/19441/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2dlbmVyaWMucHk=) | `100% <0%> (ø)` | :arrow_up: |
| ... and [10 more](https://codecov.io/gh/pandas-dev/pandas/pull/19441/diff?src=pr&el=tree-more) | |

------

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

Ok for real this time it passed @jreback @TomAugspurger thanks 😄 
a lint error.ping when pushed and green.
great. ping on green.
Thanks @hexgnu!