Skip to content

Commit 613983b

Browse files
kylebarronharisbal
authored and
harisbal
committed
Update df.to_stata() docstring (pandas-dev#19818)
1 parent ab48369 commit 613983b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/core/frame.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ def to_stata(self, fname, convert_dates=None, write_index=True,
16121612
time_stamp : datetime
16131613
A datetime to use as file creation date. Default is the current
16141614
time.
1615-
dataset_label : str
1615+
data_label : str
16161616
A label for the data set. Must be 80 characters or smaller.
16171617
variable_labels : dict
16181618
Dictionary containing columns as keys and variable labels as
@@ -1635,10 +1635,18 @@ def to_stata(self, fname, convert_dates=None, write_index=True,
16351635
16361636
Examples
16371637
--------
1638+
>>> data.to_stata('./data_file.dta')
1639+
1640+
Or with dates
1641+
1642+
>>> data.to_stata('./date_data_file.dta', {2 : 'tw'})
1643+
1644+
Alternatively you can create an instance of the StataWriter class
1645+
16381646
>>> writer = StataWriter('./data_file.dta', data)
16391647
>>> writer.write_file()
16401648
1641-
Or with dates
1649+
With dates:
16421650
16431651
>>> writer = StataWriter('./date_data_file.dta', data, {2 : 'tw'})
16441652
>>> writer.write_file()

0 commit comments

Comments
 (0)