Fixes SparseSeries initiated with dictionary raising AttributeError
State: closed

-  [x] closes #16905
 - [x] tests added / passed
 - [x] whatsnew entry


Labels:
name: Bug
name: Sparse
description: Sparse Data Type

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





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

##### Comment last updated on July 17, 2017 at 14:18 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=h1) Report
> Merging [#16960](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/96168ef698ac8bbccba251258ee66958359b11bf?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #16960      +/-   ##
==========================================
- Coverage   90.98%   90.96%   -0.02%     
==========================================
  Files         161      161              
  Lines       49288    49288              
==========================================
- Hits        44846    44837       -9     
- Misses       4442     4451       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.74% <100%> (ø)` | :arrow_up: |
| #single | `40.2% <100%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/sparse/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL3Nlcmllcy5weQ==) | `95.07% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.76% <0%> (-0.1%)` | :arrow_down: |

------

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

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

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

```diff
@@            Coverage Diff             @@
##           master   #16960      +/-   ##
==========================================
- Coverage   90.98%   90.97%   -0.02%     
==========================================
  Files         161      161              
  Lines       49288    49292       +4     
==========================================
- Hits        44846    44844       -2     
- Misses       4442     4448       +6
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.74% <100%> (ø)` | :arrow_up: |
| #single | `40.19% <100%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/sparse/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL3Nlcmllcy5weQ==) | `95.06% <100%> (-0.02%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.76% <0%> (-0.1%)` | :arrow_down: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `94.89% <0%> (ø)` | :arrow_up: |
| [pandas/core/dtypes/cast.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2Nhc3QucHk=) | `86.89% <0%> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `92.29% <0%> (ø)` | :arrow_up: |
| [pandas/core/config\_init.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29uZmlnX2luaXQucHk=) | `96% <0%> (+0.03%)` | :arrow_up: |
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `82.72% <0%> (+0.2%)` | :arrow_up: |
| [pandas/plotting/\_timeseries.py](https://codecov.io/gh/pandas-dev/pandas/pull/16960?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL190aW1lc2VyaWVzLnB5) | `60.73% <0%> (+0.52%)` | :arrow_up: |

------

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

@metllord : Ping when green, and we will merge this!
@jreback if you have anything else to add here.  Otherwise, LGTM!
this duplicates #16906 
thanks @metllord