| 606 | "file", ["stata6_113", "stata6_114", "stata6_115", "stata6_117"] |
| 607 | ) |
| 608 | def test_read_write_reread_dta15(self, file, datapath): |
| 609 | expected = self.read_csv(datapath("io", "data", "stata", "stata6.csv")) |
| 610 | expected["byte_"] = expected["byte_"].astype(np.int8) |
| 611 | expected["int_"] = expected["int_"].astype(np.int16) |
| 612 | expected["long_"] = expected["long_"].astype(np.int32) |
| 613 | expected["float_"] = expected["float_"].astype(np.float32) |
| 614 | expected["double_"] = expected["double_"].astype(np.float64) |
| 615 | |
| 616 | # TODO(GH#55564): directly cast to M8[s] |
| 617 | arr = expected["date_td"].astype("Period[D]")._values.asfreq("s", how="S") |
| 618 | expected["date_td"] = arr.view("M8[s]") |
| 619 | |
| 620 | file = datapath("io", "data", "stata", f"{file}.dta") |
| 621 | parsed = self.read_dta(file) |
| 622 | |
| 623 | tm.assert_frame_equal(expected, parsed) |
| 624 | |
| 625 | @pytest.mark.parametrize("version", [114, 117, 118, 119, None]) |
| 626 | def test_timestamp_and_label(self, version, temp_file): |