Skip to content

DOC: Fixed outdated doc-string, added missing default values, added missing optional parameters for some io classes #11098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions pandas/io/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,17 @@ def DataReader(name, data_source=None, start=None, end=None,
name : str or list of strs
the name of the dataset. Some data sources (yahoo, google, fred) will
accept a list of names.
data_source: str
data_source: str, default: None
the data source ("yahoo", "google", "fred", or "ff")
start : {datetime, None}
start : datetime, default: None
left boundary for range (defaults to 1/1/2010)
end : {datetime, None}
end : datetime, default: None
right boundary for range (defaults to today)
retry_count : int, default 3
Number of times to retry query request.
pause : numeric, default 0.001
Time, in seconds, to pause between consecutive queries of chunks. If
single value given for symbol, represents the pause between retries.

Examples
----------
Expand Down Expand Up @@ -398,28 +403,28 @@ def get_data_yahoo(symbols=None, start=None, end=None, retry_count=3,

Parameters
----------
symbols : string, array-like object (list, tuple, Series), or DataFrame
symbols : string, array-like object (list, tuple, Series), or DataFrame, default: None
Single stock symbol (ticker), array-like object of symbols or
DataFrame with index containing stock symbols.
DataFrame with index containing stock symbols
start : string, (defaults to '1/1/2010')
Starting date, timestamp. Parses many different kind of date
representations (e.g., 'JAN-01-2010', '1/1/10', 'Jan, 1, 1980')
end : string, (defaults to today)
Ending date, timestamp. Same format as starting date.
retry_count : int, default 3
retry_count : int, default: 3
Number of times to retry query request.
pause : int, default 0
pause : numeric, default: 0.001
Time, in seconds, to pause between consecutive queries of chunks. If
single value given for symbol, represents the pause between retries.
adjust_price : bool, default False
adjust_price : bool, default: False
If True, adjusts all prices in hist_data ('Open', 'High', 'Low',
'Close') based on 'Adj Close' price. Adds 'Adj_Ratio' column and drops
'Adj Close'.
ret_index : bool, default False
ret_index : bool, default: False
If True, includes a simple return index 'Ret_Index' in hist_data.
chunksize : int, default 25
chunksize : int, default: 25
Number of symbols to download consecutively before intiating pause.
interval : string, default 'd'
interval : string, default: 'd'
Time interval code, valid values are 'd' for daily, 'w' for weekly,
'm' for monthly and 'v' for dividend.

Expand Down Expand Up @@ -451,13 +456,15 @@ def get_data_google(symbols=None, start=None, end=None, retry_count=3,
representations (e.g., 'JAN-01-2010', '1/1/10', 'Jan, 1, 1980')
end : string, (defaults to today)
Ending date, timestamp. Same format as starting date.
retry_count : int, default 3
retry_count : int, default: 3
Number of times to retry query request.
pause : int, default 0
pause : numeric, default: 0.001
Time, in seconds, to pause between consecutive queries of chunks. If
single value given for symbol, represents the pause between retries.
chunksize : int, default 25
chunksize : int, default: 25
Number of symbols to download consecutively before intiating pause.
ret_index : bool, default: False
If True, includes a simple return index 'Ret_Index' in hist_data.

Returns
-------
Expand Down Expand Up @@ -903,10 +910,10 @@ def get_near_stock_price(self, above_below=2, call=True, put=False,
The number of strike prices above and below the stock price that
should be taken

call : bool
call : bool, default: True
Tells the function whether or not it should be using calls

put : bool
put : bool, default: False
Tells the function weather or not it should be using puts

month : number, int, optional(default=None)
Expand Down
49 changes: 24 additions & 25 deletions pandas/io/ga.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
dimensions : list of str
Un-prefixed dimension variable names
start_date : str/date/datetime
end_date : str/date/datetime, optional
Defaults to today
segment : list of str, optional
filters : list of str, optional
end_date : str/date/datetime, optional, default is None but internally set as today
segment : list of str, optional, default: None
filters : list of str, optional, default: None
start_index : int, default 1
max_results : int, default 10000
If >10000, must specify chunksize or ValueError will be raised"""
Expand All @@ -58,21 +57,21 @@
Sort output by index or list of columns
chunksize : int, optional
If max_results >10000, specifies the number of rows per iteration
index_col : str/list of str/dict, optional
index_col : str/list of str/dict, optional, default: None
If unspecified then dimension variables are set as index
parse_dates : bool/list/dict, default True
keep_date_col : boolean, default False
date_parser : optional
na_values : optional
converters : optional
parse_dates : bool/list/dict, default: True
keep_date_col : boolean, default: False
date_parser : optional, default: None
na_values : optional, default: None
converters : optional, default: None
dayfirst : bool, default False
Informs date parsing
account_name : str, optional
account_id : str, optional
property_name : str, optional
property_id : str, optional
profile_name : str, optional
profile_id : str, optional
account_name : str, optional, default: None
account_id : str, optional, default: None
property_name : str, optional, default: None
property_id : str, optional, default: None
profile_name : str, optional, default: None
profile_id : str, optional, default: None
%%(extras)s
Returns
-------
Expand Down Expand Up @@ -192,8 +191,8 @@ def get_account(self, name=None, id=None, **kwargs):

Parameters
----------
name : str, optional
id : str, optional
name : str, optional, default: None
id : str, optional, default: None
"""
accounts = self.service.management().accounts().list().execute()
return _get_match(accounts, name, id, **kwargs)
Expand All @@ -205,9 +204,9 @@ def get_web_property(self, account_id=None, name=None, id=None, **kwargs):

Parameters
----------
account_id : str, optional
name : str, optional
id : str, optional
account_id : str, optional, default: None
name : str, optional, default: None
id : str, optional, default: None
"""
prop_store = self.service.management().webproperties()
kwds = {}
Expand All @@ -225,10 +224,10 @@ def get_profile(self, account_id=None, web_property_id=None, name=None,

Parameters
----------
account_id : str, optional
web_property_id : str, optional
name : str, optional
id : str, optional
account_id : str, optional, default: None
web_property_id : str, optional, default: None
name : str, optional, default: None
id : str, optional, default: None
"""
profile_store = self.service.management().profiles()
kwds = {}
Expand Down
12 changes: 7 additions & 5 deletions pandas/io/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ def read_json(path_or_buf=None, orient=None, typ='frame', dtype=True,

Parameters
----------
filepath_or_buffer : a valid JSON string or file-like
path_or_buf : a valid JSON string or file-like, default: None
The string could be a URL. Valid URL schemes include http, ftp, s3, and
file. For file URLs, a host is expected. For instance, a local file
could be ``file://localhost/path/to/table.json``

orient
orient

* `Series`

Expand Down Expand Up @@ -162,13 +162,13 @@ def read_json(path_or_buf=None, orient=None, typ='frame', dtype=True,

* it is ``'date'``

keep_default_dates : boolean, default True.
keep_default_dates : boolean, default True
If parsing dates, then parse the default datelike columns
numpy : boolean, default False
Direct decoding to numpy arrays. Supports numeric data only, but
non-numeric column and index labels are supported. Note also that the
JSON ordering MUST be the same for each term if numpy=True.
precise_float : boolean, default False.
precise_float : boolean, default False
Set to enable usage of higher precision (strtod) function when
decoding string to double values. Default (False) is to use fast but
less precise builtin functionality
Expand Down Expand Up @@ -582,6 +582,8 @@ def nested_to_record(ds, prefix="", level=0):
Parameters
----------
ds : dict or list of dicts
prefix: the prefix, optional, default: ""
level: the number of levels in the jason string, optional, default: 0

Returns
-------
Expand Down Expand Up @@ -646,7 +648,7 @@ def json_normalize(data, record_path=None, meta=None,
record_path : string or list of strings, default None
Path in each object to list of records. If not passed, data will be
assumed to be an array of records
meta : list of paths (string or list of strings)
meta : list of paths (string or list of strings), default None
Fields to use as metadata for each record in resulting table
record_prefix : string, default None
If True, prefix records with dotted (?) path, e.g. foo.bar.field if
Expand Down