Skip to content

Commit 9d679dd

Browse files
author
KrishnaSai2020
committed
doctest fix for pandas-dev#42670
1 parent 1930934 commit 9d679dd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pandas/io/stata.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,14 @@
171171
>>> df = pd.read_stata('animals.dta')
172172
173173
Read a Stata dta file in 10,000 line chunks:
174-
>>> filename_df = pd.DataFrame(np.random.randint(0,10, size=(10,000,1)))
175-
>>> filename_df.to_stata('filename.dta)
174+
>>>values = np.random.randint(0,10, size=(20_000,1), dtype="uint8")
175+
>>>df = pd.DataFrame(values, columns=["i"])
176+
>>>df.to_stata('filename.dta')
177+
176178
>>> itr = pd.read_stata('filename.dta', chunksize=10000)
177179
>>> for chunk in itr:
178-
... pass # do_something(chunk)
180+
... # Operate on a single chunk
181+
...chunk.mean()
179182
180183
>>> import os
181184
>>> os.remove("./filename.dta")

0 commit comments

Comments
 (0)