Python pandas.io.common.CParserError() Examples

The following are 6 code examples of pandas.io.common.CParserError(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pandas.io.common , or try the search function .
Example #1
Source File: test_errors.py    From vnpy_crypto with MIT License 6 votes vote down vote up
def test_error_rename():
    # see gh-12665
    from pandas.errors import ParserError
    from pandas.io.common import CParserError

    try:
        raise CParserError()
    except ParserError:
        pass

    try:
        raise ParserError()
    except CParserError:
        pass

    with catch_warnings(record=True):
        try:
            raise ParserError()
        except pd.parser.CParserError:
            pass 
Example #2
Source File: backend.py    From beat with GNU General Public License v3.0 6 votes vote down vote up
def _load_df(self):
        if self._df is None:
            try:
                self._df = pd.read_csv(self.filename)
            except pd.errors.EmptyDataError:
                logger.warning(
                    'Trace %s is empty and needs to be resampled!' %
                    self.filename)
                os.remove(self.filename)
                self.corrupted_flag = True
            except CParserError:
                logger.warning(
                    'Trace %s has wrong size!' % self.filename)
                self.corrupted_flag = True
                os.remove(self.filename)

            if len(self.flat_names) == 0 and not self.corrupted_flag:
                self.flat_names, self.var_shapes = extract_variables_from_df(
                    self._df)
                self.varnames = list(self.var_shapes.keys()) 
Example #3
Source File: test_errors.py    From elasticintel with GNU General Public License v3.0 6 votes vote down vote up
def test_error_rename():
    # see gh-12665
    from pandas.errors import ParserError
    from pandas.io.common import CParserError

    try:
        raise CParserError()
    except ParserError:
        pass

    try:
        raise ParserError()
    except CParserError:
        pass

    with catch_warnings(record=True):
        try:
            raise ParserError()
        except pd.parser.CParserError:
            pass 
Example #4
Source File: test_errors.py    From twitter-stock-recommendation with MIT License 6 votes vote down vote up
def test_error_rename():
    # see gh-12665
    from pandas.errors import ParserError
    from pandas.io.common import CParserError

    try:
        raise CParserError()
    except ParserError:
        pass

    try:
        raise ParserError()
    except CParserError:
        pass

    with catch_warnings(record=True):
        try:
            raise ParserError()
        except pd.parser.CParserError:
            pass 
Example #5
Source File: test_errors.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_error_rename():
    # see gh-12665
    from pandas.errors import ParserError
    from pandas.io.common import CParserError

    try:
        raise CParserError()
    except ParserError:
        pass

    try:
        raise ParserError()
    except CParserError:
        pass 
Example #6
Source File: test_errors.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_error_rename():
    # see gh-12665
    from pandas.errors import ParserError
    from pandas.io.common import CParserError

    try:
        raise CParserError()
    except ParserError:
        pass

    try:
        raise ParserError()
    except CParserError:
        pass