MCPcopy
hub / github.com/pandas-dev/pandas / test_read_dta3

Method test_read_dta3

pandas/tests/io/test_stata.py:231–241  ·  view source on GitHub ↗
(self, file, datapath)

Source from the content-addressed store, hash-verified

229 "file", ["stata3_113", "stata3_114", "stata3_115", "stata3_117"]
230 )
231 def test_read_dta3(self, file, datapath):
232 file = datapath("io", "data", "stata", f"{file}.dta")
233 parsed = self.read_dta(file)
234
235 # match stata here
236 expected = self.read_csv(datapath("io", "data", "stata", "stata3.csv"))
237 expected = expected.astype(np.float32)
238 expected["year"] = expected["year"].astype(np.int16)
239 expected["quarter"] = expected["quarter"].astype(np.int8)
240
241 tm.assert_frame_equal(parsed, expected)
242
243 @pytest.mark.parametrize("version", [110, 111, 113, 114, 115, 117])
244 def test_read_dta4(self, version, datapath):

Callers

nothing calls this directly

Calls 4

read_dtaMethod · 0.95
read_csvMethod · 0.95
datapathFunction · 0.85
astypeMethod · 0.45

Tested by

no test coverage detected