|
9 | 9 | import numpy as np |
10 | 10 |
|
11 | 11 | import pandas |
| 12 | +import pandas as pd |
12 | 13 | from pandas import (Series, DataFrame, Panel, MultiIndex, Categorical, bdate_range, |
13 | 14 | date_range, Index, DatetimeIndex, isnull) |
14 | 15 |
|
|
33 | 34 | from pandas import compat |
34 | 35 | from pandas.compat import range, lrange, u |
35 | 36 | from pandas.util.testing import assert_produces_warning |
| 37 | +from numpy.testing.decorators import slow |
36 | 38 |
|
37 | 39 | try: |
38 | 40 | import tables |
@@ -1497,107 +1499,6 @@ def col(t,column): |
1497 | 1499 | store.put('f2', df) |
1498 | 1500 | self.assertRaises(TypeError, store.create_table_index, 'f2') |
1499 | 1501 |
|
1500 | | - def test_big_table_frame(self): |
1501 | | - raise nose.SkipTest('no big table frame') |
1502 | | - |
1503 | | - # create and write a big table |
1504 | | - df = DataFrame(np.random.randn(2000 * 100, 100), index=range( |
1505 | | - 2000 * 100), columns=['E%03d' % i for i in range(100)]) |
1506 | | - for x in range(20): |
1507 | | - df['String%03d' % x] = 'string%03d' % x |
1508 | | - |
1509 | | - import time |
1510 | | - x = time.time() |
1511 | | - with ensure_clean_store(self.path,mode='w') as store: |
1512 | | - store.append('df', df) |
1513 | | - rows = store.root.df.table.nrows |
1514 | | - recons = store.select('df') |
1515 | | - assert isinstance(recons, DataFrame) |
1516 | | - |
1517 | | - com.pprint_thing("\nbig_table frame [%s] -> %5.2f" % (rows, time.time() - x)) |
1518 | | - |
1519 | | - def test_big_table2_frame(self): |
1520 | | - # this is a really big table: 1m rows x 60 float columns, 20 string, 20 datetime |
1521 | | - # columns |
1522 | | - raise nose.SkipTest('no big table2 frame') |
1523 | | - |
1524 | | - # create and write a big table |
1525 | | - com.pprint_thing("\nbig_table2 start") |
1526 | | - import time |
1527 | | - start_time = time.time() |
1528 | | - df = DataFrame(np.random.randn(1000 * 1000, 60), index=range(int( |
1529 | | - 1000 * 1000)), columns=['E%03d' % i for i in range(60)]) |
1530 | | - for x in range(20): |
1531 | | - df['String%03d' % x] = 'string%03d' % x |
1532 | | - for x in range(20): |
1533 | | - df['datetime%03d' % x] = datetime.datetime(2001, 1, 2, 0, 0) |
1534 | | - |
1535 | | - com.pprint_thing("\nbig_table2 frame (creation of df) [rows->%s] -> %5.2f" |
1536 | | - % (len(df.index), time.time() - start_time)) |
1537 | | - |
1538 | | - def f(chunksize): |
1539 | | - with ensure_clean_store(self.path,mode='w') as store: |
1540 | | - store.append('df', df, chunksize=chunksize) |
1541 | | - r = store.root.df.table.nrows |
1542 | | - return r |
1543 | | - |
1544 | | - for c in [10000, 50000, 250000]: |
1545 | | - start_time = time.time() |
1546 | | - com.pprint_thing("big_table2 frame [chunk->%s]" % c) |
1547 | | - rows = f(c) |
1548 | | - com.pprint_thing("big_table2 frame [rows->%s,chunk->%s] -> %5.2f" |
1549 | | - % (rows, c, time.time() - start_time)) |
1550 | | - |
1551 | | - def test_big_put_frame(self): |
1552 | | - raise nose.SkipTest('no big put frame') |
1553 | | - |
1554 | | - com.pprint_thing("\nbig_put start") |
1555 | | - import time |
1556 | | - start_time = time.time() |
1557 | | - df = DataFrame(np.random.randn(1000 * 1000, 60), index=range(int( |
1558 | | - 1000 * 1000)), columns=['E%03d' % i for i in range(60)]) |
1559 | | - for x in range(20): |
1560 | | - df['String%03d' % x] = 'string%03d' % x |
1561 | | - for x in range(20): |
1562 | | - df['datetime%03d' % x] = datetime.datetime(2001, 1, 2, 0, 0) |
1563 | | - |
1564 | | - com.pprint_thing("\nbig_put frame (creation of df) [rows->%s] -> %5.2f" |
1565 | | - % (len(df.index), time.time() - start_time)) |
1566 | | - |
1567 | | - with ensure_clean_store(self.path, mode='w') as store: |
1568 | | - start_time = time.time() |
1569 | | - store = HDFStore(self.path, mode='w') |
1570 | | - store.put('df', df) |
1571 | | - |
1572 | | - com.pprint_thing(df.get_dtype_counts()) |
1573 | | - com.pprint_thing("big_put frame [shape->%s] -> %5.2f" |
1574 | | - % (df.shape, time.time() - start_time)) |
1575 | | - |
1576 | | - def test_big_table_panel(self): |
1577 | | - raise nose.SkipTest('no big table panel') |
1578 | | - |
1579 | | - # create and write a big table |
1580 | | - wp = Panel( |
1581 | | - np.random.randn(20, 1000, 1000), items=['Item%03d' % i for i in range(20)], |
1582 | | - major_axis=date_range('1/1/2000', periods=1000), minor_axis=['E%03d' % i for i in range(1000)]) |
1583 | | - |
1584 | | - wp.ix[:, 100:200, 300:400] = np.nan |
1585 | | - |
1586 | | - for x in range(100): |
1587 | | - wp['String%03d'] = 'string%03d' % x |
1588 | | - |
1589 | | - import time |
1590 | | - x = time.time() |
1591 | | - |
1592 | | - |
1593 | | - with ensure_clean_store(self.path, mode='w') as store: |
1594 | | - store.append('wp', wp) |
1595 | | - rows = store.root.wp.table.nrows |
1596 | | - recons = store.select('wp') |
1597 | | - assert isinstance(recons, Panel) |
1598 | | - |
1599 | | - com.pprint_thing("\nbig_table panel [%s] -> %5.2f" % (rows, time.time() - x)) |
1600 | | - |
1601 | 1502 | def test_append_diff_item_order(self): |
1602 | 1503 |
|
1603 | 1504 | wp = tm.makePanel() |
@@ -4436,7 +4337,7 @@ def do_copy(f = None, new_f = None, keys = None, propindexes = True, **kwargs): |
4436 | 4337 | safe_remove(self.path) |
4437 | 4338 |
|
4438 | 4339 | def test_legacy_table_write(self): |
4439 | | - raise nose.SkipTest("skipping for now") |
| 4340 | + raise nose.SkipTest("cannot write legacy tables") |
4440 | 4341 |
|
4441 | 4342 | store = HDFStore(tm.get_data_path('legacy_hdf/legacy_table_%s.h5' % pandas.__version__), 'a') |
4442 | 4343 |
|
|
0 commit comments