Skip to content

Commit

Permalink
CLN: Add annotations for stata
Browse files Browse the repository at this point in the history
Add type annotations in Stata
General clean up
Fix one small bug using in rather than ==
  • Loading branch information
bashtage committed Jan 16, 2020
1 parent 074bd9f commit 48a9ad9
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 225 deletions.
22 changes: 12 additions & 10 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
labeling information
"""
import collections
import datetime
from collections import abc
from io import StringIO
import itertools
Expand All @@ -18,6 +19,7 @@
IO,
TYPE_CHECKING,
Any,
Dict,
FrozenSet,
Hashable,
Iterable,
Expand Down Expand Up @@ -1851,16 +1853,16 @@ def _from_arrays(cls, arrays, columns, index, dtype=None) -> "DataFrame":
@deprecate_kwarg(old_arg_name="fname", new_arg_name="path")
def to_stata(
self,
path,
convert_dates=None,
write_index=True,
byteorder=None,
time_stamp=None,
data_label=None,
variable_labels=None,
version=114,
convert_strl=None,
):
path: FilePathOrBuffer,
convert_dates: Optional[Dict[Hashable, str]] = None,
write_index: bool = True,
byteorder: Optional[str] = None,
time_stamp: Optional[datetime.datetime] = None,
data_label: Optional[str] = None,
variable_labels: Optional[Dict[Hashable, str]] = None,
version: Optional[int] = 114,
convert_strl: Optional[Sequence[Hashable]] = None,
) -> None:
"""
Export DataFrame object to Stata dta format.
Expand Down
7 changes: 3 additions & 4 deletions pandas/io/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,9 @@ def get_filepath_or_buffer(
Returns
-------
tuple of ({a filepath_ or buffer or S3File instance},
encoding, str,
compression, str,
should_close, bool)
Tuple[FilePathOrBuffer, str, str, bool]
Tuple containing the filepath or buffer, the encoding, the compression
and should_close.
"""
filepath_or_buffer = stringify_path(filepath_or_buffer)

Expand Down
Loading

0 comments on commit 48a9ad9

Please sign in to comment.