Skip to content

Update df.to_stata() docstring #19818

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 2 commits into from
Feb 22, 2018
Merged
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
12 changes: 10 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ def to_stata(self, fname, convert_dates=None, write_index=True,
time_stamp : datetime
A datetime to use as file creation date. Default is the current
time.
dataset_label : str
data_label : str
A label for the data set. Must be 80 characters or smaller.
variable_labels : dict
Dictionary containing columns as keys and variable labels as
Expand All @@ -1635,10 +1635,18 @@ def to_stata(self, fname, convert_dates=None, write_index=True,

Examples
--------
>>> data.to_stata('./data_file.dta')

Or with dates

>>> data.to_stata('./date_data_file.dta', {2 : 'tw'})

Alternatively you can create an instance of the StataWriter class

>>> writer = StataWriter('./data_file.dta', data)
>>> writer.write_file()

Or with dates
With dates:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure you need this line anymore in fact.


>>> writer = StataWriter('./date_data_file.dta', data, {2 : 'tw'})
>>> writer.write_file()
Expand Down