Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(24)  |  Call(18)  |  Derive(0)  |  Import(6)

src/a/s/astropy-0.3.1/astropy/io/ascii/tests/test_fixedwidth.py   astropy(Download)
 
from ... import ascii as asciitable
from .common import (assert_equal, assert_almost_equal,
                     setup_function, teardown_function)
 
    dat = reader.read(table)
    assert_equal(dat.colnames, ['Col1', 'Col2'])
    assert_almost_equal(dat[1][0], 2.4)
    assert_equal(dat[0][1], '"hello"')
    assert_equal(dat[1][1], "'s worlds")
    dat = reader.read(table)
    assert_equal(dat.colnames, ['name1', 'name2'])
    assert_almost_equal(dat[1][0], 2.4)
 
 
    dat = reader.read(table)
    assert_equal(dat.colnames, ['name1', 'name3'])
    assert_almost_equal(dat[1][0], 2.4)
    assert_equal(dat[0][1], 3)
 
    dat = reader.read(table)
    assert_equal(dat.colnames, ['Col1', 'Col2'])
    assert_almost_equal(dat[1][0], 2.4)
    assert_equal(dat[0][1], '"hel')
    assert_equal(dat[1][1], "df's wo")

src/a/s/astropy-0.3.1/astropy/io/ascii/tests/test_read_unicode.py   astropy(Download)
from ....table import Table
 
from .common import (raises, assert_equal, assert_almost_equal,
                     assert_true, setup_function, teardown_function)
 
    assert_equal(data.dtype.names, testfile['cols'])
    assert_equal(len(data), testfile['nrows'])
    assert_almost_equal(data.field('zabs1.nh')[2], 0.0839710433091)
    assert_almost_equal(data.field('p1.gamma')[2], 1.25997502704)
    assert_almost_equal(data.field('p1.ampl')[2], 0.000696444029148)
    assert_equal(data.field('statname')[2], 'chi2modvar')
    assert_almost_equal(data.field('statval')[2], 497.56468441)

src/a/s/astropy-0.3.1/astropy/io/ascii/tests/test_read.py   astropy(Download)
from ....table import Table
 
from .common import (raises, assert_equal, assert_almost_equal,
                     assert_true, setup_function, teardown_function)
 
    assert_equal(data.dtype.names, testfile['cols'])
    assert_equal(len(data), testfile['nrows'])
    assert_almost_equal(data.field('zabs1.nh')[2], 0.0839710433091)
    assert_almost_equal(data.field('p1.gamma')[2], 1.25997502704)
    assert_almost_equal(data.field('p1.ampl')[2], 0.000696444029148)
    assert_equal(data.field('statname')[2], 'chi2modvar')
    assert_almost_equal(data.field('statval')[2], 497.56468441)

src/a/s/astropy-0.3.1/astropy/io/ascii/tests/test_cds_header_from_readme.py   astropy(Download)
# Licensed under a 3-clause BSD style license - see LICENSE.rst
 
from ....tests.helper import pytest
from ... import ascii as asciitable
from .common import (assert_equal, assert_almost_equal, has_isnan,
        table = read_table(readme, data)
        assert_equal(len(table), 18)
        assert_almost_equal(table['Lambda'][-1], 6479.32)
        assert_equal(table['Fnu'][-1], '0.285937')
 

src/p/a/pandas-0.13.1/pandas/stats/tests/test_fama_macbeth.py   pandas(Download)
from pandas import DataFrame, Panel
from pandas.stats.api import fama_macbeth
from .common import assert_almost_equal, BaseTest
 
from pandas.compat import range
 
            reference = fama_macbeth(y=y2, x=x2, **kwds)
            assert_almost_equal(reference._stats, result._stats[:, i])
 
        static = fama_macbeth(y=y2, x=x2, **kwds)

src/p/a/pandas-HEAD/pandas/stats/tests/test_fama_macbeth.py   pandas(Download)
from pandas import DataFrame, Panel
from pandas.stats.api import fama_macbeth
from .common import assert_almost_equal, BaseTest
 
from pandas.compat import range
 
            reference = fama_macbeth(y=y2, x=x2, **kwds)
            assert_almost_equal(reference._stats, result._stats[:, i])
 
        static = fama_macbeth(y=y2, x=x2, **kwds)