Skip to content

Commit

Permalink
DOC: Improve _infer_compression docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Dec 15, 2016
1 parent 49e3137 commit a7960f6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pandas/io/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,23 +247,26 @@ def file_path_to_url(path):

def _infer_compression(filepath_or_buffer, compression):
"""
Get file handle for given path/buffer and mode.
Get the compression method for filepath_or_buffer. If compression='infer',
the inferred compression method is returned. Otherwise, the input
compression method is returned unchanged, unless it's invalid, in which case
an error is raised.
Parameters
----------
filepath_or_buf :
a path (str) or buffer
compression : str, or None
compression : str or None
the compression method including None for no compression and 'infer'
Returns
-------
string compression method, None
string or None :
compression method
Raises
------
ValueError on invalid compression specified
If compression='infer', infer compression. If compression
"""

# No compression has been explicitly specified
Expand Down

0 comments on commit a7960f6

Please sign in to comment.