Skip to content

Commit

Permalink
Merge pull request #75 from ocefpaf/multiple_csv_to_pandas
Browse files Browse the repository at this point in the history
Allow for multiple CSV responses in to_pandas
  • Loading branch information
ocefpaf authored Mar 6, 2019
2 parents 4958abd + 21da666 commit d238291
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.4.0

- Allow for multiple `csv`s responses in `.to_pandas`.

## 0.3.0

- Cache `_check_url_response` and `get_var_by_attr` returns
Expand Down
5 changes: 3 additions & 2 deletions erddapy/erddapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,14 @@ def to_pandas(self, **kw):
Accepts any `pandas.read_csv` keyword arguments.
This method uses the .csvp [1] response for simplicity,
This method uses the .csvp [1] response as the default for simplicity,
please check ERDDAP's documentation for the other csv options available.
[1] Download a ISO-8859-1 .csv file with line 1: name (units). Times are ISO 8601 strings.
"""
url = self.get_download_url(response="csvp")
response = kw.pop("response", "csvp")
url = self.get_download_url(response=response)
return pd.read_csv(
urlopen(url, params=self.params, **self.requests_kwargs), **kw
)
Expand Down

0 comments on commit d238291

Please sign in to comment.