diff --git a/ci/install.sh b/ci/install.sh index 8d9ab3aac3374..cd897cf7313c2 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -75,6 +75,8 @@ if ( ! $VENV_FILE_AVAILABLE ); then pip install $PIP_ARGS xlrd>=0.9.0 pip install $PIP_ARGS 'http://downloads.sourceforge.net/project/pytseries/scikits.timeseries/0.91.3/scikits.timeseries-0.91.3.tar.gz?r=' pip install $PIP_ARGS patsy + pip install $PIP_ARGS lxml + pip install $PIP_ARGS beautifulsoup4 # fool statsmodels into thinking pandas was already installed # so it won't refuse to install itself. We want it in the zipped venv diff --git a/doc/source/api.rst b/doc/source/api.rst index eb65e6087c66c..ca95a739ed661 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -50,6 +50,13 @@ File IO read_csv ExcelFile.parse +.. currentmodule:: pandas.io.html + +.. autosummary:: + :toctree: generated/ + + read_html + HDFStore: PyTables (HDF5) ~~~~~~~~~~~~~~~~~~~~~~~~~ .. currentmodule:: pandas.io.pytables diff --git a/doc/source/install.rst b/doc/source/install.rst index 742acff04148e..9d14d1b11c6b1 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -99,6 +99,12 @@ Optional Dependencies * `openpyxl `__, `xlrd/xlwt `__ * openpyxl version 1.6.1 or higher * Needed for Excel I/O + * `lxml `__, or `Beautiful Soup 4 `__: for reading HTML tables + * The differences between lxml and Beautiful Soup 4 are mostly speed (lxml + is faster), however sometimes Beautiful Soup returns what you might + intuitively expect. Both backends are implemented, so try them both to + see which one you like. They should return very similar results. + * Note that lxml requires Cython to build successfully .. note:: diff --git a/pandas/__init__.py b/pandas/__init__.py index 3c06db57a54ae..bf5bcc81bc21e 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -33,6 +33,7 @@ read_fwf, to_clipboard, ExcelFile, ExcelWriter) from pandas.io.pytables import HDFStore, Term, get_store, read_hdf +from pandas.io.html import read_html from pandas.util.testing import debug from pandas.tools.describe import value_range diff --git a/pandas/io/html.py b/pandas/io/html.py new file mode 100644 index 0000000000000..c29d16db8132b --- /dev/null +++ b/pandas/io/html.py @@ -0,0 +1,701 @@ +""":mod:`pandas.io.html` is a module containing functionality for dealing with +HTML IO. + +""" + +import os +import re +import numbers +import urllib2 +import contextlib +import collections +import urlparse + +try: + from importlib import import_module +except ImportError: + import_module = __import__ + +from pandas import DataFrame, MultiIndex +from pandas.io.parsers import _is_url + + +############# +# READ HTML # +############# +_RE_WHITESPACE = re.compile(r'([\r\n]+|\s{2,})') + + +def _remove_whitespace(s, regex=_RE_WHITESPACE): + """Replace extra whitespace inside of a string with a single space. + + Parameters + ---------- + s : str or unicode + The string from which to remove extra whitespace. + + regex : regex + The regular expression to use to remove extra whitespace. + + Returns + ------- + subd : str or unicode + `s` with all extra whitespace replaced with a single space. + """ + return regex.sub(' ', s.strip()) + + +def _get_skiprows_iter(skiprows): + """Get an iterator given an integer, slice or container. + + Parameters + ---------- + skiprows : int, slice, container + The iterator to use to skip rows; can also be a slice. + + Raises + ------ + TypeError + * If `skiprows` is not a slice, integer, or Container + + Raises + ------ + TypeError + * If `skiprows` is not a slice, integer, or Container + + Returns + ------- + it : iterable + A proper iterator to use to skip rows of a DataFrame. + """ + if isinstance(skiprows, slice): + return range(skiprows.start or 0, skiprows.stop, skiprows.step or 1) + elif isinstance(skiprows, numbers.Integral): + return range(skiprows) + elif isinstance(skiprows, collections.Container): + return skiprows + else: + raise TypeError('{0} is not a valid type for skipping' + ' rows'.format(type(skiprows))) + + def _parse_columns(self, row): + return row.xpath('.//td|.//th') + + +class _HtmlFrameParser(object): + """Base class for parsers that parse HTML into DataFrames. + + Parameters + ---------- + io : str or file-like + This can be either a string of raw HTML, a valid URL using the HTTP, + FTP, or FILE protocols or a file-like object. + + match : str or regex + The text to match in the document. + + attrs : dict + List of HTML element attributes to match. + + Attributes + ---------- + io : str or file-like + raw HTML, URL, or file-like object + + match : regex + The text to match in the raw HTML + + attrs : dict-like + A dictionary of valid table attributes to use to search for table + elements. + + Notes + ----- + To subclass this class effectively you must override the following methods: + * :func:`_build_doc` + * :func:`_text_getter` + * :func:`_parse_columns` + * :func:`_parse_table` + * :func:`_parse_rows` + See each method's respective documentation for details on their + functionality. + """ + def __init__(self, io, match, attrs): + self.io = io + self.match = match + self.attrs = attrs + + def parse_rows(self): + """Return a list of list of each table's rows. + + Returns + ------- + row_list : list of list of node-like + A list of each table's rows, which are DOM nodes (usually elements). + """ + tables = self._parse_tables(self._build_doc(), self.match, self.attrs) + assert tables, 'No tables found' + return (self._parse_rows(table) for table in tables) + + def parse_raw_data(self): + """Return a list of the raw data from each table. + + Returns + ------- + data : list of list of lists of str or unicode + Each table's data is contained in a list of lists of str or + unicode. + """ + return [self._parse_raw_data(rows, self._text_getter, + self._parse_columns) + for rows in self.parse_rows()] + + def _parse_raw_data(self, rows, text_getter, column_finder): + """Parse the raw data into a list of lists. + + Parameters + ---------- + rows : iterable of node-like + A list of row elements. + + text_getter : callable + A callable that gets the text from an individual node. This must be + defined by subclasses. + + column_finder : callable + A callable that takes a row node as input and returns a list of the + column node in that row. This must be defined by subclasses. + + Raises + ------ + AssertionError + * If `text_getter` is not callable + * If `column_finder` is not callable + + Returns + ------- + data : list of list of strings + """ + # callable is back in Python 3.2 + assert callable(text_getter), '"text_getter" must be callable' + assert callable(column_finder), '"column_finder" must be callable' + + data = [] + + for row in rows: + if _remove_whitespace(text_getter(row)): + col = [] + + for el in column_finder(row): + t = _remove_whitespace(text_getter(el)) + + if t: + col.append(t) + data.append(col) + + return data + + def _text_getter(self, obj): + """Return the text of an individual DOM node. + + Parameters + ---------- + obj : node-like + A DOM node. + + Returns + ------- + text : str or unicode + The text from an individual DOM node. + """ + raise NotImplementedError + + def _parse_columns(self, obj): + """Return the column elements from a row element. + + Parameters + ---------- + obj : node-like + + Returns + ------- + columns : list of node-like + These are the elements of each row, i.e., the columns. + """ + raise NotImplementedError + + def _parse_tables(self, doc, match, attrs): + """Return all tables from the parsed DOM. + + Parameters + ---------- + doc : tree-like + The DOM from which to parse the table element. + + match : str or regular expression + The text to search for in the DOM tree. + + attrs : dict + A dictionary of table attributes that can be used to disambiguate + mutliple tables on a page. + + Raises + ------ + AssertionError + * If `match` does not match any text in the document. + + Returns + ------- + tables : list of node-like + A list of
or +
elements to be parsed into raw data. + """ + raise NotImplementedError + + def _parse_rows(self, table): + """Return the list of row elements from the parsed table element. + + Parameters + ---------- + table : node-like + A table element that contains row elements. + + Returns + ------- + rows : list of node-like + A list row elements of a table, usually or
elements. + """ + raise NotImplementedError + + def _build_doc(self): + """Return a tree-like object that can be used to iterate over the DOM. + + Returns + ------- + obj : tree-like + """ + raise NotImplementedError + + +class _BeautifulSoupFrameParser(_HtmlFrameParser): + """HTML to DataFrame parser that uses BeautifulSoup under the hood. + + See Also + -------- + pandas.io.html._HtmlFrameParser + pandas.io.html._LxmlFrameParser + + Notes + ----- + Documentation strings for this class are in the base class + :class:`pandas.io.html._HtmlFrameParser`. + """ + def __init__(self, *args, **kwargs): + super(_BeautifulSoupFrameParser, self).__init__(*args, **kwargs) + + def _text_getter(self, obj): + return obj.text + + def _parse_columns(self, row): + return row.find_all(('td', 'th')) + + def _parse_rows(self, table): + return table.find_all(('tr', 'thead', 'tfoot')) + + def _parse_tables(self, doc, match, attrs): + tables = doc.find_all('table', attrs=attrs) + assert tables, 'No tables found' + + tables = [table for table in tables + if table.find(text=match) is not None] + assert tables, "No tables found matching '{0}'".format(match.pattern) + return tables + + def _build_doc(self): + if _is_url(self.io): + try: + with contextlib.closing(urllib2.urlopen(self.io)) as url: + raw_text = url.read() + except urllib2.URLError: + raise ValueError('Invalid URL: "{0}"'.format(self.io)) + elif hasattr(self.io, 'read'): + raw_text = self.io.read() + elif os.path.isfile(self.io): + with open(self.io) as f: + raw_text = f.read() + elif isinstance(self.io, basestring): + raw_text = self.io + else: + raise ValueError("Cannot read object of" + " type '{0}'".format(type(self.io))) + assert raw_text, 'No text parsed from document' + + from bs4 import BeautifulSoup, SoupStrainer + strainer = SoupStrainer('table') + return BeautifulSoup(raw_text, parse_only=strainer) + + +def _build_node_xpath_expr(attrs): + """Build an xpath expression to simulate bs4's ability to pass in kwargs to + search for attributes when using the lxml parser. + + Parameters + ---------- + attrs : dict + A dict of HTML attributes. These are NOT checked for validity. + + Returns + ------- + expr : unicode + An XPath expression that checks for the given HTML attributes. + """ + # give class attribute as class_ because class is a python keyword + if 'class_' in attrs: + attrs['class'] = attrs.pop('class_') + + s = (u"@{k}='{v}'".format(k=k, v=v) for k, v in attrs.iteritems()) + return u'[{0}]'.format(' and '.join(s)) + + +_re_namespace = {'re': 'http://exslt.org/regular-expressions'} + + +class _LxmlFrameParser(_HtmlFrameParser): + """HTML to DataFrame parser that uses lxml under the hood. + + Warning + ------- + This parser can only handle HTTP, FTP, and FILE urls. + + See Also + -------- + _HtmlFrameParser + _BeautifulSoupFrameParser + + Notes + ----- + Documentation strings for this class are in the base class + :class:`_HtmlFrameParser`. + """ + def __init__(self, *args, **kwargs): + super(_LxmlFrameParser, self).__init__(*args, **kwargs) + + def _text_getter(self, obj): + return obj.text_content() + + def _parse_columns(self, row): + return row.xpath('.//td|.//th') + + def _parse_rows(self, table): + return table.xpath('(.//tr|.//thead|.//tfoot)[normalize-space()]') + + def _parse_tables(self, doc, match, kwargs): + pattern = match.pattern + + # check all descendants for the given pattern + check_all_expr = u'//*' + if pattern: + check_all_expr += u"[re:test(text(), '{0}')]".format(pattern) + + # go up the tree until we find a table + check_table_expr = '/ancestor::table' + xpath_expr = check_all_expr + check_table_expr + + # if any table attributes were given build an xpath expression to + # search for them + if kwargs: + xpath_expr += _build_node_xpath_expr(kwargs) + tables = doc.xpath(xpath_expr, namespaces=_re_namespace) + assert tables, "No tables found matching regex '{0}'".format(pattern) + return tables + + def _build_doc(self): + """ + Raises + ------ + IOError + * If a valid URL is detected, but for some reason cannot be parsed. + This is probably due to a faulty or non-existent internet + connection. + ValueError + * If a URL that lxml cannot parse is passed. + + See Also + -------- + pandas.io.html._HtmlFrameParser._build_doc + """ + from lxml.html import parse, fromstring + + try: + # try to parse the input in the simplest way + return parse(self.io) + except (UnicodeDecodeError, IOError): + # something went wrong, check for not-a-url because it's probably a + # huge string blob + if not _is_url(self.io): + return fromstring(self.io) + elif urlparse.urlparse(self.io).scheme not in ('http', 'ftp', + 'file'): + raise ValueError('"{0}" does not have a valid URL' + ' protocol'.format(self.io)) + else: + raise IOError('"{0}" is a valid URL, so you probably are not' + ' properly connected to the' + ' internet'.format(self.io)) + + +def _data_to_frame(data, header, index_col, infer_types, skiprows): + """Parse a BeautifulSoup table into a DataFrame. + + Parameters + ---------- + data : list of lists of str or unicode + The raw data to be placed into a DataFrame. This is a list of lists of + strings or unicode. If it helps, it can be thought of as a matrix of + strings instead. + + header : int or None + An integer indicating the row to use for the column header or None + indicating no header will be used. + + index_col : int or None + An integer indicating the column to use for the index or None + indicating no column will be used. + + infer_types : bool + Whether to convert numbers and dates. + + skiprows : collections.Container or int or slice + Iterable used to skip rows. + + Returns + ------- + df : DataFrame + A DataFrame containing the data from `data` + + Raises + ------ + ValueError + * If `skiprows` is not found in the rows of the parsed DataFrame. + + Raises + ------ + ValueError + * If `skiprows` is not found in the rows of the parsed DataFrame. + + See Also + -------- + read_html + + Notes + ----- + The `data` parameter is guaranteed not to be a list of empty lists. + """ + df = DataFrame(data) + + if skiprows is not None: + it = _get_skiprows_iter(skiprows) + + try: + df = df.drop(it) + except ValueError: + raise ValueError('Labels {0} not found when trying to skip' + ' rows'.format(it)) + + if header is not None: + header_rows = df.iloc[header] + + if header_rows.ndim == 2: + names = header_rows.index + df.columns = MultiIndex.from_arrays(header_rows.values, + names=names) + else: + df.columns = header_rows + + df = df.drop(df.index[header]) + + # convert to numbers/dates where possible + # must be sequential since dates trump numbers if both args are given + if infer_types: + df = df.convert_objects(convert_numeric=True) + df = df.convert_objects(convert_dates='coerce') + + if index_col is not None: + cols = df.columns[index_col] + + try: + cols = cols.tolist() + except AttributeError: + pass + + # drop by default + df.set_index(cols, inplace=True) + + return df + + +_possible_parsers = {'lxml': _LxmlFrameParser, + 'bs4': _BeautifulSoupFrameParser} + + +def read_html(io, match='.+', flavor='bs4', header=None, index_col=None, + skiprows=None, infer_types=True, attrs=None): + r"""Read an HTML table into a DataFrame. + + Parameters + ---------- + io : str or file-like + A string or file like object that can be either a url, a file-like + object, or a raw string containing HTML. Note that lxml only accepts + the http, ftp and file url protocols. + + match : str or regex, optional + The set of tables containing text matching this regex or string will be + returned. Unless the HTML is extremely simple you will probably need to + pass a non-empty string here. Defaults to '.+' (match any non-empty + string). The default value will return all tables contained on a page. + This value is converted to a regular expression so that there is + consistent behavior between Beautiful Soup and lxml. + + flavor : str, {'lxml', 'bs4'} + The parsing engine to use under the hood. lxml is faster and bs4 + (Beautiful Soup 4) is better at parsing nested tags, which are not + uncommon when parsing tables. Defaults to 'bs4'. + + header : int or array-like or None, optional + The row (or rows for a MultiIndex) to use to make the columns headers. + Note that this row will be removed from the data. Defaults to None. + + index_col : int or array-like or None, optional + The column to use to make the index. Note that this column will be + removed from the data. Defaults to None. + + skiprows : int or collections.Container or slice or None, optional + If an integer is given then skip this many rows after parsing the + column header. If a sequence of integers is given skip those specific + rows (0-based). Defaults to None, i.e., no rows are skipped. Note that + + .. code-block:: python + + skiprows == 0 + + yields the same result as + + .. code-block:: python + + skiprows is None + + If `skiprows` is a positive integer, say :math:`n`, then + it is treated as "skip :math:`n` rows", *not* as "skip the + :math:`n^\textrm{th}` row". + + infer_types : bool, optional + Whether to convert numeric types and date-appearing strings to numbers + and dates, respectively. Defaults to True. + + attrs : dict or None, optional + This is a dictionary of attributes that you can pass to use to identify + the table in the HTML. These are not checked for validity before being + passed to lxml or Beautiful Soup. However, these attributes must be + valid HTML table attributes to work correctly. Defaults to None. For + example, + + .. code-block:: python + + attrs = {'id': 'table'} + + is a valid attribute dictionary because the 'id' HTML tag attribute is + a valid HTML attribute for *any* HTML tag as per `this document + `__. + + .. code-block:: python + + attrs = {'asdf': 'table'} + + is *not* a valid attribute dictionary because 'asdf' is not a valid + HTML attribute even if it is a valid XML attribute. Valid HTML 4.01 + table attributes can be found `here + `__. A + working draft of the HTML 5 spec can be found `here + `__. It contains the + latest information on table attributes for the modern web. + + Returns + ------- + dfs : list of DataFrames + A list of DataFrames, each of which is the parsed data from each of the + tables on the page. + + Notes + ----- + There's as little cleaning of the data as possible due to the heterogeneity + and general disorder of HTML on the web. + + Expect some cleanup after you call this function. For example, + you might need to pass `infer_types=False` and perform manual conversion if + the column names are converted to NaN when you pass the `header=0` + argument. We try to assume as little as possible about the structure of the + table and push the idiosyncrasies of the HTML contained in the table to + you, the user. + + This function only searches for elements and only for and
+ rows and elements within those rows. This could be extended by + subclassing one of the parser classes contained in :mod:`pandas.io.html`. + + Similar to :func:`read_csv` the `header` argument is applied **after** + `skiprows` is applied. + + This function will *always* return a list of :class:`DataFrame` *or* + it will fail, e.g., it will *not* return an empty list. + + Examples + -------- + Parse a table from a list of failed banks from the FDIC: + + >>> from pandas import read_html, DataFrame + >>> url = 'http://www.fdic.gov/bank/individual/failed/banklist.html' + >>> dfs = read_html(url, match='Florida', attrs={'id': 'table'}) + >>> assert dfs # will not be empty if the call to read_html doesn't fail + >>> assert isinstance(dfs, list) # read_html returns a list of DataFrames + >>> assert all(map(lambda x: isinstance(x, DataFrame), dfs)) + + Parse some spam infomation from the USDA: + + >>> url = ('http://ndb.nal.usda.gov/ndb/foods/show/1732?fg=&man=&' + ... 'lfacet=&format=&count=&max=25&offset=&sort=&qlookup=spam') + >>> dfs = read_html(url, match='Water', header=0) + >>> assert dfs + >>> assert isinstance(dfs, list) + >>> assert all(map(lambda x: isinstance(x, DataFrame), dfs)) + + You can pass nothing to the `match` argument: + + >>> url = 'http://www.fdic.gov/bank/individual/failed/banklist.html' + >>> dfs = read_html(url) + >>> print(len(dfs)) # this will most likely be greater than 1 + + Try a different parser: + + >>> url = 'http://www.fdic.gov/bank/individual/failed/banklist.html' + >>> dfs = read_html(url, 'Florida', flavor='lxml', attrs={'id': 'table'}) + >>> assert dfs + >>> assert isinstance(dfs, list) + >>> assert all(map(lambda x: isinstance(x, DataFrame), dfs)) + """ + # annoying type check here because we don't want to spend time parsing HTML + # only to end up failing because of an invalid value of skiprows + if isinstance(skiprows, numbers.Integral): + assert skiprows >= 0, ('cannot skip rows starting from the end of the ' + 'data (you passed a negative value)') + + valid_backends = _possible_parsers.keys() + assert flavor in valid_backends, ("'{0}' is not a valid backend, the valid" + " backends are " + "{1}".format(flavor, valid_backends)) + parser = _possible_parsers[flavor] + + # bonus: re.compile is idempotent under function iteration so you can pass + # a compiled regex to it and it will return itself + p = parser(io, re.compile(match), attrs) + return [_data_to_frame(data, header, index_col, infer_types, skiprows) + for data in p.parse_raw_data()] diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index 89f892daf9389..161e7a521b997 100644 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -4,7 +4,7 @@ from StringIO import StringIO import re from itertools import izip -from urlparse import urlparse +import urlparse import csv import numpy as np @@ -166,14 +166,26 @@ class DateConversionError(Exception): """ % (_parser_params % _fwf_widths) +_VALID_URLS = set(urlparse.uses_relative + urlparse.uses_netloc + + urlparse.uses_params) +_VALID_URLS.discard('') + + def _is_url(url): + """Check to see if a URL has a valid protocol. + + Parameters + ---------- + url : str or unicode + + Returns + ------- + isurl : bool + If `url` has a valid protocol return True otherwise False. """ - Very naive check to see if url is an http(s), ftp, or file location. - """ - parsed_url = urlparse(url) - if parsed_url.scheme in ['http', 'file', 'ftp', 'https']: - return True - else: + try: + return urlparse.urlparse(url).scheme in _VALID_URLS + except: return False diff --git a/pandas/io/tests/data/failed_banklist.html b/pandas/io/tests/data/failed_banklist.html new file mode 100644 index 0000000000000..ea2a5c27996bf --- /dev/null +++ b/pandas/io/tests/data/failed_banklist.html @@ -0,0 +1,5314 @@ + + + + + + FDIC: Failed Bank List + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +

+ + + + + + + + Home > Industry + Analysis > Failed Banks > Failed + Bank List
+ + + +


+ + + + + + + + + + + + + + +

+
+ + + + + + + + + + + + + + + + +
+ + + Failed + Bank List +
+ + +
+ + + + + +
+
The FDIC is often appointed as receiver for failed banks. This page contains useful information for the customers and vendors of these banks. This includes information on the acquiring bank (if applicable), how your accounts and loans are affected, and how vendors can file claims against the receivership. + Failed Financial Institution Contact Search + displays point of contact information related to failed banks.

+ + This list includes banks which have failed since October 1, 2000. To search for banks that failed prior to those on this page, visit this link: Failures and Assistance Transactions +

+ + + Failed Bank List - CSV file (Updated on Mondays. Also opens in Excel - Excel + Help) +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bank Name

City

State

CERT #

Acquiring Institution

Closing Date

Updated Date

Chipola Community BankMariannaFL58034First Federal Bank of FloridaApril 19, 2013April 23, 2013
Heritage Bank of North FloridaOrange ParkFL26680FirstAtlantic BankApril 19, 2013April 23, 2013
First Federal BankLexingtonKY29594Your Community BankApril 19, 2013April 23, 2013
Gold Canyon BankGold CanyonAZ58066First Scottsdale Bank, +National AssociationApril 5, 2013April 9, 2013
Frontier BankLaGrangeGA16431HeritageBank of the SouthMarch 8, 2013March 26, 2013
Covenant BankChicagoIL22476Liberty Bank and Trust CompanyFebruary 15, 2013March 4, 2013
1st Regents BankAndoverMN57157First Minnesota BankJanuary 18, 2013February 28, 2013
Westside Community BankUniversity PlaceWA33997Sunwest BankJanuary 11, 2013January 24, 2013
Community Bank of the OzarksSunrise BeachMO27331Bank of SullivanDecember 14, 2012January 24, 2013
Hometown Community BankBraseltonGA57928CertusBank, National AssociationNovember 16, 2012January 24, 2013
Citizens First National BankPrincetonIL3731Heartland Bank and Trust CompanyNovember 2, 2012January 24, 2013
Heritage Bank of FloridaLutzFL35009Centennial BankNovember 2, 2012January 24, 2013
NOVA BankBerwynPA27148No AcquirerOctober 26, 2012January 24, 2013
Excel BankSedaliaMO19189Simmons First National BankOctober 19, 2012January 24, 2013
First East Side Savings BankTamaracFL28144Stearns Bank N.A.October 19, 2012January 24, 2013
GulfSouth Private BankDestinFL58073SmartBankOctober 19, 2012January 24, 2013
First United BankCreteIL20685Old Plank Trail Community Bank, National AssociationSeptember 28, 2012November 15, 2012
Truman BankSt. LouisMO27316Simmons First National BankSeptember 14, 2012December 17, 2012
First Commercial BankBloomingtonMN35246Republic Bank & Trust CompanySeptember 7, 2012December 17, 2012
Waukegan Savings BankWaukeganIL28243 First Midwest BankAugust 3, 2012October 11, 2012
Jasper Banking CompanyJasperGA16240Stearns Bank N.A.July 27, 2012December 17, 2012
Second Federal Savings and Loan Association of ChicagoChicagoIL27986Hinsdale Bank & Trust CompanyJuly 20, 2012January 14, 2013
Heartland BankLeawoodKS1361Metcalf BankJuly 20, 2012December 17, 2012
First Cherokee State BankWoodstockGA32711Community & Southern BankJuly 20, 2012October 31, 2012
Georgia Trust BankBufordGA57847Community & Southern BankJuly 20, 2012December 17, 2012
The Royal Palm Bank of FloridaNaplesFL57096First National Bank of the Gulf CoastJuly 20, 2012January 7, 2013
Glasgow Savings BankGlasgowMO1056 Regional Missouri BankJuly 13, 2012October 11, 2012
Montgomery Bank & TrustAileyGA19498 Ameris BankJuly 6, 2012October 31, 2012
The Farmers Bank of LynchburgLynchburgTN1690Clayton Bank and TrustJune 15, 2012October 31, 2012
Security Exchange BankMariettaGA35299Fidelity BankJune 15, 2012October 10, 2012
Putnam State BankPalatkaFL27405Harbor Community BankJune 15, 2012October 10, 2012
Waccamaw BankWhitevilleNC34515First Community BankJune 8, 2012November 8, 2012
Farmers' and Traders' State BankShabbonaIL9257First State BankJune 8, 2012October 10, 2012
Carolina Federal Savings BankCharlestonSC35372Bank of North CarolinaJune 8, 2012October 31, 2012
First Capital BankKingfisherOK416F & M BankJune 8, 2012October 10, 2012
Alabama Trust Bank, National AssociationSylacaugaAL35224Southern States BankMay 18, 2012October 31, 2012
Security Bank, National AssociationNorth LauderdaleFL23156Banesco USAMay 4, 2012October 31, 2012
Palm Desert National BankPalm DesertCA23632Pacific Premier BankApril 27, 2012August 31, 2012
Plantation Federal BankPawleys IslandSC32503First Federal BankApril 27, 2012October 31, 2012
Inter Savings Bank, fsb D/B/A InterBank, fsbMaple GroveMN31495Great Southern BankApril 27, 2012October 17, 2012
HarVest Bank of MarylandGaithersburgMD57766SonabankApril 27, 2012October 17, 2012
Bank of the Eastern ShoreCambridgeMD26759No AcquirerApril 27, 2012October 17, 2012
Fort Lee Federal Savings Bank, FSBFort LeeNJ35527Alma BankApril 20, 2012August 31, 2012
Fidelity BankDearbornMI33883The Huntington National BankMarch 30, 2012August 9, 2012
Premier BankWilmetteIL35419International Bank of ChicagoMarch 23, 2012October 17, 2012
Covenant Bank & TrustRock SpringGA58068Stearns Bank, N.A.March 23, 2012October 31, 2012
New City Bank ChicagoIL57597No AcquirerMarch 9, 2012October 29, 2012
Global Commerce BankDoravilleGA34046Metro City BankMarch 2, 2012October 31, 2012
Home Savings of AmericaLittle FallsMN29178No AcquirerFebruary 24, 2012December 17, 2012
Central Bank of GeorgiaEllavilleGA5687Ameris BankFebruary 24, 2012August 9, 2012
SCB BankShelbyvilleIN29761First Merchants Bank, National AssociationFebruary 10, 2012March 25, 2013
Charter National Bank and TrustHoffman EstatesIL23187Barrington Bank & Trust +Company, National AssociationFebruary 10, 2012March 25, 2013
BankEastKnoxvilleTN19869U.S.Bank National Association January 27, 2012March 8, 2013
Patriot Bank MinnesotaForest LakeMN34823First Resource BankJanuary 27, 2012September 12, 2012
Tennessee Commerce Bank +FranklinTN35296Republic Bank & Trust CompanyJanuary 27, 2012November 20, 2012
First Guaranty Bank and Trust Company of JacksonvilleJacksonvilleFL16579CenterState Bank of Florida, N.A.January 27, 2012September 12, 2012
American Eagle Savings BankBoothwynPA31581Capital Bank, N.A.January 20, 2012January 25, 2013
The First State BankStockbridgeGA19252Hamilton State BankJanuary 20, 2012January 25, 2013
Central Florida State BankBelleviewFL57186CenterState Bank of Florida, N.A.January 20, 2012January 25, 2013
Western National BankPhoenixAZ57917 Washington FederalDecember 16, 2011August 13, 2012
Premier Community Bank of the Emerald CoastCrestviewFL58343 Summit BankDecember 16, 2011September 12, 2012
Central Progressive BankLacombeLA19657 First NBC BankNovember 18, 2011August 13, 2012
Polk County BankJohnstonIA14194Grinnell State BankNovember 18, 2011August 15, 2012
Community Bank of RockmartRockmartGA57860Century Bank of GeorgiaNovember 10, 2011August 13, 2012
SunFirst BankSaint GeorgeUT57087Cache Valley BankNovember 4, 2011November 16, 2012
Mid City Bank, Inc.OmahaNE19397Premier BankNovember 4, 2011August 15, 2012
All American BankDes PlainesIL57759International Bank of ChicagoOctober 28, 2011August 15, 2012
Community Banks of ColoradoGreenwood VillageCO21132Bank Midwest, N.A.October 21, 2011January 2, 2013
Community Capital BankJonesboroGA57036State Bank and Trust CompanyOctober 21, 2011November 8, 2012
Decatur First BankDecaturGA34392Fidelity BankOctober 21, 2011November 8, 2012
Old Harbor BankClearwaterFL575371st United BankOctober 21, 2011November 8, 2012
Country BankAledoIL35395Blackhawk Bank & TrustOctober 14, 2011August 15, 2012
First State BankCranfordNJ58046Northfield BankOctober 14, 2011November 8, 2012
Blue Ridge Savings Bank, Inc.AshevilleNC32347Bank of North CarolinaOctober 14, 2011November 8, 2012
Piedmont Community BankGrayGA57256State Bank and Trust CompanyOctober 14, 2011January 22, 2013
Sun Security BankEllingtonMO20115 Great Southern Bank October 7, 2011November 7, 2012
The RiverBankWyomingMN10216 Central Bank October 7, 2011November 7, 2012
First International BankPlanoTX33513 American First National Bank September 30, 2011October 9, 2012
Citizens Bank of Northern CaliforniaNevada CityCA33983 Tri Counties BankSeptember 23, 2011October 9, 2012
Bank of the CommonwealthNorfolkVA20408Southern Bank and Trust CompanySeptember 23, 2011October 9, 2012
The First National Bank of FloridaMiltonFL25155CharterBankSeptember 9, 2011September 6, 2012
CreekSide BankWoodstockGA58226Georgia Commerce BankSeptember 2, 2011September 6, 2012
Patriot Bank of GeorgiaCummingGA58273Georgia Commerce BankSeptember 2, 2011November 2, 2012
First Choice BankGenevaIL57212Inland Bank & TrustAugust 19, 2011August 15, 2012
First Southern National BankStatesboroGA57239Heritage Bank of the SouthAugust 19, 2011November 2, 2012
Lydian Private BankPalm BeachFL35356Sabadell United Bank, N.A.August 19, 2011November 2, 2012
Public Savings BankHuntingdon ValleyPA34130Capital Bank, N.A.August 18, 2011August 15, 2012
The First National Bank of OlatheOlatheKS4744Enterprise Bank & TrustAugust 12, 2011August 23, 2012
Bank of WhitmanColfaxWA22528Columbia State BankAugust 5, 2011August 16, 2012
Bank of ShorewoodShorewoodIL22637Heartland Bank and Trust CompanyAugust 5, 2011August 16, 2012
Integra Bank National AssociationEvansvilleIN4392Old National BankJuly 29, 2011August 16, 2012
BankMeridian, N.A.ColumbiaSC58222SCBT National AssociationJuly 29, 2011November 2, 2012
Virginia Business BankRichmondVA58283Xenith BankJuly 29, 2011October 9, 2012
Bank of ChoiceGreeleyCO2994Bank Midwest, N.A.July 22, 2011September 12, 2012
LandMark Bank of FloridaSarasotaFL35244American Momentum BankJuly 22, 2011November 2, 2012
Southshore Community BankApollo BeachFL58056American Momentum BankJuly 22, 2011November 2, 2012
Summit BankPrescott AZ57442 The Foothills BankJuly 15, 2011August 16, 2012
First Peoples BankPort St. Lucie FL34870 Premier American Bank, N.A.July 15, 2011November 2, 2012
High Trust BankStockbridge GA19554 Ameris BankJuly 15, 2011November 2, 2012
One Georgia BankAtlanta GA58238 Ameris BankJuly 15, 2011November 2, 2012
Signature BankWindsor CO57835 Points West Community BankJuly 8, 2011October 26, 2012
Colorado Capital BankCastle Rock CO34522First-Citizens Bank & Trust CompanyJuly 8, 2011January 15, 2013
First Chicago Bank & TrustChicagoIL27935Northbrook Bank & Trust CompanyJuly 8, 2011September 9, 2012
Mountain Heritage BankClaytonGA57593First American Bank and Trust CompanyJune 24, 2011November 2, 2012
First Commercial Bank of Tampa BayTampaFL27583Stonegate BankJune 17, 2011November 2, 2012
McIntosh State BankJacksonGA19237Hamilton State BankJune 17, 2011November 2, 2012
Atlantic Bank and Trust + CharlestonSC58420First Citizens Bank and Trust Company, Inc.June 3, 2011October 31, 2012
First Heritage BankSnohomishWA23626Columbia State BankMay 27, 2011January 28, 2013
Summit BankBurlingtonWA513Columbia State BankMay 20, 2011January 22, 2013
First Georgia Banking CompanyFranklinGA57647CertusBank, National AssociationMay 20, 2011November 13, 2012
Atlantic Southern BankMaconGA57213CertusBank, National AssociationMay 20, 2011October 31, 2012
Coastal BankCocoa BeachFL34898Florida Community Bank, a division of Premier American Bank, N.A.May 6, 2011November 30, 2012
Community Central BankMount ClemensMI34234Talmer Bank & TrustApril 29, 2011August 16, 2012
The Park Avenue BankValdostaGA19797Bank of the OzarksApril 29, 2011November 30, 2012
First Choice Community BankDallasGA58539Bank of the OzarksApril 29, 2011January 22, 2013
Cortez Community BankBrooksvilleFL57625Florida Community Bank, a division of Premier American Bank, N.A. + April 29, 2011November 30, 2012
First National Bank of Central FloridaWinter ParkFL26297Florida Community Bank, a division of Premier American Bank, N.A.April 29, 2011November 30, 2012
Heritage Banking GroupCarthageMS14273Trustmark National BankApril 15, 2011November 30, 2012
Rosemount National BankRosemountMN24099Central BankApril 15, 2011August 16, 2012
Superior BankBirminghamAL17750Superior Bank, National AssociationApril 15, 2011November 30, 2012
Nexity BankBirminghamAL19794AloStar Bank of CommerceApril 15, 2011September 4, 2012
New Horizons BankEast EllijayGA57705Citizens South BankApril 15, 2011August 16, 2012
Bartow County BankCartersvilleGA21495Hamilton State BankApril 15, 2011January 22, 2013
Nevada Commerce BankLas VegasNV35418City National BankApril 8, 2011September 9, 2012
Western Springs National Bank and TrustWestern SpringsIL10086Heartland Bank and Trust CompanyApril 8, 2011January 22, 2013
The Bank of CommerceWood DaleIL34292Advantage National Bank GroupMarch 25, 2011January 22, 2013
Legacy BankMilwaukeeWI34818Seaway Bank and Trust CompanyMarch 11, 2011September 12, 2012
First National Bank of DavisDavisOK4077The Pauls Valley National BankMarch 11, 2011August 20, 2012
Valley Community BankSt. CharlesIL34187First State BankFebruary 25, 2011September 12, 2012
San Luis Trust Bank, FSB San Luis ObispoCA34783First California BankFebruary 18, 2011August 20, 2012
Charter Oak BankNapaCA57855Bank of MarinFebruary 18, 2011September 12, 2012
Citizens Bank of EffinghamSpringfieldGA34601Heritage Bank of the SouthFebruary 18, 2011November 2, 2012
Habersham BankClarkesvilleGA151SCBT National AssociationFebruary 18, 2011November 2, 2012
Canyon National BankPalm SpringsCA34692Pacific Premier BankFebruary 11, 2011September 12, 2012
Badger State BankCassvilleWI13272Royal Bank February 11, 2011September 12, 2012
Peoples State BankHamtramckMI14939First Michigan BankFebruary 11, 2011January 22, 2013
Sunshine State Community BankPort OrangeFL35478Premier American Bank, N.A.February 11, 2011November 2, 2012
Community First Bank ChicagoChicagoIL57948Northbrook Bank & Trust CompanyFebruary 4, 2011August 20, 2012
North Georgia BankWatkinsvilleGA35242BankSouthFebruary 4, 2011November 2, 2012
American Trust BankRoswellGA57432Renasant BankFebruary 4, 2011October 31, 2012
First Community BankTaosNM12261U.S. Bank, N.A.January 28, 2011September 12, 2012
FirsTier BankLouisvilleCO57646No AcquirerJanuary 28, 2011September 12, 2012
Evergreen State BankStoughtonWI5328McFarland State BankJanuary 28, 2011September 12, 2012
The First State BankCamargoOK2303Bank 7January 28, 2011September 12, 2012
United Western BankDenverCO31293First-Citizens Bank & Trust CompanyJanuary 21, 2011September 12, 2012
The Bank of AshevilleAshevilleNC34516First BankJanuary 21, 2011November 2, 2012
CommunitySouth Bank & TrustEasleySC57868CertusBank, National AssociationJanuary 21, 2011November 2, 2012
Enterprise Banking CompanyMcDonoughGA19758No AcquirerJanuary 21, 2011November 2, 2012
Oglethorpe BankBrunswickGA57440Bank of the Ozarks January 14, 2011November 2, 2012
Legacy BankScottsdaleAZ57820Enterprise Bank & Trust January 7, 2011September 12, 2012
First Commercial Bank of FloridaOrlandoFL34965First Southern BankJanuary 7, 2011November 2, 2012
Community National BankLino LakesMN23306Farmers & Merchants Savings BankDecember 17, 2010August 20, 2012
First Southern Bank BatesvilleAR58052Southern BankDecember 17, 2010August 20, 2012
United Americas Bank, N.A.AtlantaGA35065State Bank and Trust CompanyDecember 17, 2010November 2, 2012
Appalachian Community Bank, FSB McCaysvilleGA58495Peoples Bank of East TennesseeDecember 17, 2010October 31, 2012
Chestatee State BankDawsonvilleGA34578Bank of the OzarksDecember 17, 2010November 2, 2012
The Bank of Miami,N.A.Coral GablesFL190401st United Bank December 17, 2010November 2, 2012
Earthstar BankSouthamptonPA35561Polonia BankDecember 10, 2010August 20, 2012
Paramount BankFarmington HillsMI34673Level One BankDecember 10, 2010August 20, 2012
First Banking CenterBurlingtonWI5287First Michigan BankNovember 19, 2010August 20, 2012
Allegiance Bank of North AmericaBala CynwydPA35078VIST BankNovember 19, 2010August 20, 2012
Gulf State Community BankCarrabelleFL20340Centennial BankNovember 19, 2010November 2, 2012
Copper Star BankScottsdaleAZ35463Stearns Bank, N.A.November 12, 2010August 20, 2012
Darby Bank & Trust Co.VidaliaGA14580Ameris BankNovember 12, 2010January 15, 2013
Tifton Banking CompanyTiftonGA57831Ameris BankNovember 12, 2010November 2, 2012
First Vietnamese American Bank
+ In Vietnamese
WestminsterCA57885Grandpoint BankNovember 5, 2010September 12, 2012
Pierce Commercial BankTacomaWA34411Heritage BankNovember 5, 2010August 20, 2012
Western Commercial BankWoodland HillsCA58087First California BankNovember 5, 2010September 12, 2012
K BankRandallstownMD31263Manufacturers and Traders Trust Company (M&T Bank)November 5, 2010August 20, 2012
First Arizona Savings, A FSBScottsdaleAZ32582No AcquirerOctober 22, 2010August 20, 2012
Hillcrest BankOverland ParkKS22173Hillcrest Bank, N.A.October 22, 2010August 20, 2012
First Suburban National BankMaywoodIL16089Seaway Bank and Trust CompanyOctober 22, 2010August 20, 2012
The First National Bank of BarnesvilleBarnesvilleGA2119United BankOctober 22, 2010November 2, 2012
The Gordon BankGordonGA33904Morris BankOctober 22, 2010November 2, 2012
Progress Bank of FloridaTampaFL32251Bay Cities BankOctober 22, 2010November 2, 2012
First Bank of JacksonvilleJacksonvilleFL27573Ameris BankOctober 22, 2010November 2, 2012
Premier BankJefferson CityMO34016Providence BankOctober 15, 2010August 20, 2012
WestBridge Bank and Trust CompanyChesterfieldMO58205Midland States BankOctober 15, 2010August 20, 2012
Security Savings Bank, F.S.B.OlatheKS30898Simmons First National BankOctober 15, 2010August 20, 2012
Shoreline BankShorelineWA35250GBC International BankOctober 1, 2010August 20, 2012
Wakulla BankCrawfordville FL 21777Centennial BankOctober 1, 2010November 2, 2012
North County BankArlington WA 35053Whidbey Island BankSeptember 24, 2010August 20, 2012
Haven Trust Bank FloridaPonte Vedra Beach FL 58308First Southern BankSeptember 24, 2010November 5, 2012
Maritime Savings BankWest Allis WI 28612North Shore Bank, FSBSeptember 17, 2010August 20, 2012
Bramble Savings BankMilford OH 27808Foundation BankSeptember 17, 2010August 20, 2012
The Peoples BankWinder GA 182Community & Southern BankSeptember 17, 2010November 5, 2012
First Commerce Community BankDouglasville GA 57448Community & Southern BankSeptember 17, 2010January 15, 2013
Bank of Ellijay Ellijay GA 58197Community & Southern BankSeptember 17, 2010January 15, 2013
ISN BankCherry Hill NJ 57107Customers BankSeptember 17, 2010August 22, 2012
Horizon BankBradenton FL 35061Bank of the OzarksSeptember 10, 2010November 5, 2012
Sonoma Valley BankSonoma CA 27259Westamerica BankAugust 20, 2010September 12, 2012
Los Padres BankSolvang CA32165Pacific Western BankAugust 20, 2010September 12, 2012
Butte Community BankChico CA 33219Rabobank, N.A.August 20, 2010September 12, 2012
Pacific State BankStockton CA 27090Rabobank, N.A.August 20, 2010September 12, 2012
ShoreBankChicago IL15640Urban Partnership BankAugust 20, 2010September 12, 2012
Imperial Savings and Loan AssociationMartinsvilleVA31623River Community Bank, N.A.August 20, 2010August 24, 2012
Independent National BankOcalaFL27344CenterState Bank of Florida, N.A.August 20, 2010November 5, 2012
Community National Bank at BartowBartowFL25266CenterState Bank of Florida, N.A.August 20, 2010November 5, 2012
Palos Bank and Trust CompanyPalos HeightsIL17599First Midwest BankAugust 13, 2010August 22, 2012
Ravenswood BankChicagoIL34231Northbrook Bank & Trust CompanyAugust 6, 2010August 22, 2012
LibertyBankEugeneOR31964Home Federal BankJuly 30, 2010August 22, 2012
The Cowlitz BankLongviewWA22643Heritage BankJuly 30, 2010August 22, 2012
Coastal Community BankPanama City BeachFL9619Centennial BankJuly 30, 2010November 5, 2012
Bayside Savings BankPort Saint JoeFL57669Centennial BankJuly 30, 2010November 5, 2012
Northwest Bank & TrustAcworthGA57658State Bank and Trust CompanyJuly 30, 2010November 5, 2012
Home Valley Bank Cave JunctionOR23181South Valley Bank & TrustJuly 23, 2010September 12, 2012
SouthwestUSA Bank Las VegasNV35434Plaza BankJuly 23, 2010August 22, 2012
Community Security Bank New PragueMN34486RoundbankJuly 23, 2010September 12, 2012
Thunder Bank Sylvan GroveKS10506The Bennington State BankJuly 23, 2010September 13, 2012
Williamsburg First National Bank KingstreeSC17837First Citizens Bank and Trust Company, Inc.July 23, 2010November 5, 2012
Crescent Bank and Trust Company JasperGA27559Renasant BankJuly 23, 2010November 5, 2012
Sterling Bank LantanaFL32536IBERIABANKJuly 23, 2010November 5, 2012
Mainstreet Savings Bank, FSBHastingsMI28136Commercial BankJuly 16, 2010September 13, 2012
Olde Cypress Community BankClewistonFL28864CenterState Bank of Florida, N.A.July 16, 2010November 5, 2012
Turnberry BankAventuraFL32280NAFH National BankJuly 16, 2010November 5, 2012
Metro Bank of Dade CountyMiamiFL25172NAFH National BankJuly 16, 2010November 5, 2012
First National Bank of the SouthSpartanburgSC35383NAFH National BankJuly 16, 2010November 5, 2012
Woodlands BankBlufftonSC32571Bank of the OzarksJuly 16, 2010November 5, 2012
Home National BankBlackwellOK11636RCB BankJuly 9, 2010December 10, 2012
USA BankPort ChesterNY58072New Century BankJuly 9, 2010September 14, 2012
Ideal Federal Savings BankBaltimoreMD32456No AcquirerJuly 9, 2010September 14, 2012
Bay National BankBaltimoreMD35462Bay Bank, FSBJuly 9, 2010January 15, 2013
High Desert State BankAlbuquerqueNM35279First American BankJune 25, 2010September 14, 2012
First National BankSavannahGA34152The Savannah Bank, N.A.June 25, 2010November 5, 2012
Peninsula BankEnglewoodFL26563Premier American Bank, N.A.June 25, 2010November 5, 2012
Nevada Security BankRenoNV57110Umpqua BankJune 18, 2010August 23, 2012
Washington First International BankSeattleWA32955East West BankJune 11, 2010September 14, 2012
TierOne BankLincolnNE29341Great Western BankJune 4, 2010September 14, 2012
Arcola Homestead Savings BankArcolaIL31813No AcquirerJune 4, 2010September 14, 2012
First National BankRosedale MS15814The Jefferson BankJune 4, 2010November 5, 2012
Sun West BankLas Vegas NV34785City National BankMay 28, 2010September 14, 2012
Granite Community Bank, NAGranite Bay CA57315Tri Counties BankMay 28, 2010September 14, 2012
Bank of Florida - TampaTampaFL57814EverBankMay 28, 2010November 5, 2012
Bank of Florida - SouthwestNaples FL35106EverBankMay 28, 2010November 5, 2012
Bank of Florida - SoutheastFort Lauderdale FL57360EverBankMay 28, 2010November 5, 2012
Pinehurst BankSaint Paul MN57735Coulee BankMay 21, 2010October 26, 2012
Midwest Bank and Trust CompanyElmwood Park IL18117FirstMerit Bank, N.A.May 14, 2010August 23, 2012
Southwest Community BankSpringfieldMO34255Simmons First National BankMay 14, 2010August 23, 2012
New Liberty BankPlymouthMI35586Bank of Ann ArborMay 14, 2010August 23, 2012
Satilla Community BankSaint MarysGA35114Ameris BankMay 14, 2010November 5, 2012
1st Pacific Bank of CaliforniaSan DiegoCA35517City National BankMay 7, 2010December 13, 2012
Towne Bank of ArizonaMesaAZ57697Commerce Bank of ArizonaMay 7, 2010August 23, 2012
Access BankChamplinMN16476PrinsBankMay 7, 2010August 23, 2012
The Bank of BonifayBonifayFL14246First Federal Bank of FloridaMay 7, 2010November 5, 2012
Frontier BankEverettWA22710Union Bank, N.A.April 30, 2010January 15, 2013
BC National BanksButlerMO17792Community First BankApril 30, 2010August 23, 2012
Champion BankCreve CoeurMO58362BankLibertyApril 30, 2010August 23, 2012
CF BancorpPort HuronMI30005First Michigan BankApril 30, 2010January 15, 2013
Westernbank Puerto Rico
+ En Espanol
MayaguezPR31027Banco Popular de Puerto RicoApril 30, 2010November 5, 2012
R-G Premier Bank of Puerto Rico
+ En Espanol
Hato ReyPR32185Scotiabank de Puerto RicoApril 30, 2010November 5, 2012
Eurobank
+ En Espanol
San JuanPR27150Oriental Bank and TrustApril 30, 2010November 5, 2012
Wheatland BankNapervilleIL58429Wheaton Bank & TrustApril 23, 2010August 23, 2012
Peotone Bank and Trust CompanyPeotoneIL10888First Midwest BankApril 23, 2010August 23, 2012
Lincoln Park Savings BankChicagoIL30600Northbrook Bank & Trust CompanyApril 23, 2010August 23, 2012
New Century BankChicagoIL34821MB Financial Bank, N.A.April 23, 2010August 23, 2012
Citizens Bank and Trust Company of ChicagoChicagoIL34658Republic Bank of ChicagoApril 23, 2010August 23, 2012
Broadway BankChicagoIL22853MB Financial Bank, N.A.April 23, 2010August 23, 2012
Amcore Bank, National AssociationRockfordIL3735Harris N.A.April 23, 2010August 23, 2012
City BankLynnwoodWA21521Whidbey Island BankApril 16, 2010September 14, 2012
Tamalpais BankSan RafaelCA33493Union Bank, N.A.April 16, 2010August 23, 2012
Innovative BankOaklandCA23876Center BankApril 16, 2010August 23, 2012
Butler BankLowellMA26619People's United BankApril 16, 2010August 23, 2012
Riverside National Bank of FloridaFort PierceFL24067TD Bank, N.A.April 16, 2010November 5, 2012
AmericanFirst BankClermontFL57724TD Bank, N.A.April 16, 2010October 31, 2012
First Federal Bank of North FloridaPalatkaFL 28886TD Bank, N.A.April 16, 2010January 15, 2013
Lakeside Community BankSterling HeightsMI34878No AcquirerApril 16, 2010August 23, 2012
Beach First National BankMyrtle BeachSC34242Bank of North CarolinaApril 9, 2010November 5, 2012
Desert Hills BankPhoenixAZ57060New York Community BankMarch 26, 2010August 23, 2012
Unity National BankCartersvilleGA34678Bank of the OzarksMarch 26, 2010September 14, 2012
Key West BankKey WestFL34684Centennial BankMarch 26, 2010August 23, 2012
McIntosh Commercial BankCarrolltonGA57399CharterBankMarch 26, 2010August 23, 2012
State Bank of AuroraAuroraMN8221Northern State BankMarch 19, 2010August 23, 2012
First Lowndes BankFort DepositAL24957First Citizens BankMarch 19, 2010August 23, 2012
Bank of HiawasseeHiawasseeGA10054Citizens South BankMarch 19, 2010August 23, 2012
Appalachian Community BankEllijayGA33989Community & Southern BankMarch 19, 2010October 31, 2012
Advanta Bank Corp.DraperUT33535No AcquirerMarch 19, 2010September 14, 2012
Century Security BankDuluthGA58104Bank of UpsonMarch 19, 2010August 23, 2012
American National BankParmaOH18806The National Bank and Trust CompanyMarch 19, 2010August 23, 2012
Statewide BankCovingtonLA29561Home BankMarch 12, 2010August 23, 2012
Old Southern BankOrlandoFL58182Centennial BankMarch 12, 2010August 23, 2012
The Park Avenue BankNew YorkNY27096Valley National BankMarch 12, 2010August 23, 2012
LibertyPointe BankNew YorkNY58071Valley National BankMarch 11, 2010August 23, 2012
Centennial BankOgdenUT34430No AcquirerMarch 5, 2010September 14, 2012
Waterfield BankGermantownMD34976No AcquirerMarch 5, 2010August 23, 2012
Bank of IllinoisNormalIL9268Heartland Bank and Trust CompanyMarch 5, 2010August 23, 2012
Sun American BankBoca RatonFL27126First-Citizens Bank & Trust CompanyMarch 5, 2010August 23, 2012
Rainier Pacific BankTacomaWA38129Umpqua BankFebruary 26, 2010August 23, 2012
Carson River Community BankCarson CityNV58352Heritage Bank of NevadaFebruary 26, 2010January 15, 2013
La Jolla Bank, FSBLa JollaCA32423OneWest Bank, FSBFebruary 19, 2010August 24, 2012
George Washington Savings BankOrland ParkIL29952FirstMerit Bank, N.A.February 19, 2010August 24, 2012
The La Coste National BankLa CosteTX3287Community National BankFebruary 19, 2010September 14, 2012
Marco Community BankMarco IslandFL57586Mutual of Omaha BankFebruary 19, 2010August 24, 2012
1st American State Bank of MinnesotaHancockMN15448Community Development Bank, FSBFebruary 5, 2010August 24, 2012
American Marine BankBainbridge IslandWA16730Columbia State BankJanuary 29, 2010August 24, 2012
First Regional BankLos AngelesCA23011First-Citizens Bank & Trust CompanyJanuary 29, 2010August 24, 2012
Community Bank and TrustCorneliaGA5702SCBT National AssociationJanuary 29, 2010January 15, 2013
Marshall Bank, N.A.HallockMN16133United Valley BankJanuary 29, 2010August 23, 2012
Florida Community BankImmokaleeFL5672Premier American Bank, N.A.January 29, 2010January 15, 2013
First National Bank of GeorgiaCarrolltonGA16480Community & Southern BankJanuary 29, 2010December 13, 2012
Columbia River BankThe DallesOR22469Columbia State BankJanuary 22, 2010September 14, 2012
Evergreen BankSeattleWA20501Umpqua BankJanuary 22, 2010January 15, 2013
Charter BankSanta FeNM32498Charter BankJanuary 22, 2010August 23, 2012
Bank of LeetonLeetonMO8265Sunflower Bank, N.A.January 22, 2010January 15, 2013
Premier American BankMiamiFL57147Premier American Bank, N.A.January 22, 2010December 13, 2012
Barnes Banking CompanyKaysvilleUT1252No AcquirerJanuary 15, 2010August 23, 2012
St. Stephen State BankSt. StephenMN17522First State Bank of St. JosephJanuary 15, 2010August 23, 2012
Town Community + Bank & TrustAntiochIL34705First American BankJanuary 15, 2010August 23, 2012
Horizon BankBellinghamWA22977Washington Federal Savings and Loan AssociationJanuary 8, 2010August 23, 2012
First Federal Bank of California, F.S.B.Santa MonicaCA28536OneWest Bank, FSBDecember 18, 2009August 23, 2012
Imperial Capital BankLa JollaCA26348City National BankDecember 18, 2009September 5, 2012
Independent Bankers' BankSpringfieldIL26820The Independent BankersBank (TIB)December 18, 2009August 23, 2012
New South Federal Savings BankIrondaleAL32276Beal BankDecember 18, 2009August 23, 2012
Citizens State BankNew BaltimoreMI1006No AcquirerDecember 18, 2009November 5, 2012
Peoples First Community BankPanama CityFL32167Hancock BankDecember 18, 2009November 5, 2012
RockBridge Commercial BankAtlantaGA58315No AcquirerDecember 18, 2009November 5, 2012
SolutionsBankOverland ParkKS4731Arvest BankDecember 11, 2009August 23, 2012
Valley Capital Bank, N.A.MesaAZ58399Enterprise Bank & TrustDecember 11, 2009August 23, 2012
Republic Federal Bank, N.A.MiamiFL228461st United BankDecember 11, 2009November 5, 2012
Greater Atlantic BankRestonVA32583SonabankDecember 4, 2009November 5, 2012
Benchmark BankAuroraIL10440MB Financial Bank, N.A.December 4, 2009August 23, 2012
AmTrust BankClevelandOH29776New York Community BankDecember 4, 2009November 5, 2012
The Tattnall BankReidsvilleGA12080Heritage Bank of the SouthDecember 4, 2009November 5, 2012
First Security National BankNorcrossGA26290State Bank and Trust CompanyDecember 4, 2009November 5, 2012
The Buckhead Community BankAtlantaGA34663State Bank and Trust CompanyDecember 4, 2009November 5, 2012
Commerce Bank of Southwest FloridaFort MyersFL58016Central BankNovember 20, 2009November 5, 2012
Pacific Coast National BankSan ClementeCA57914Sunwest BankNovember 13, 2009August 22, 2012
Orion BankNaplesFL22427IBERIABANKNovember 13, 2009November 5, 2012
Century Bank, + F.S.B.SarasotaFL32267IBERIABANKNovember 13, 2009August 22, 2012
United Commercial BankSan FranciscoCA32469East West BankNovember 6, 2009November 5, 2012
Gateway Bank of St. LouisSt. LouisMO19450Central Bank of Kansas CityNovember 6, 2009August 22, 2012
Prosperan BankOakdaleMN35074Alerus Financial, N.A.November 6, 2009August 22, 2012
Home Federal Savings BankDetroitMI30329Liberty Bank and Trust CompanyNovember 6, 2009August 22, 2012
United Security BankSpartaGA22286Ameris BankNovember 6, 2009January 15, 2013
North Houston BankHoustonTX18776U.S. Bank N.A.October 30, 2009August 22, 2012
Madisonville State BankMadisonvilleTX33782U.S. Bank N.A.October 30, 2009August 22, 2012
Citizens National BankTeagueTX25222U.S. Bank N.A.October 30, 2009August 22, 2012
Park National BankChicagoIL11677U.S. Bank N.A.October 30, 2009August 22, 2012
Pacific National BankSan FranciscoCA30006U.S. Bank N.A.October 30, 2009August 22, 2012
California National BankLos AngelesCA34659U.S. Bank N.A.October 30, 2009September 5, 2012
San Diego National BankSan DiegoCA23594U.S. Bank N.A.October 30, 2009August 22, 2012
Community Bank of LemontLemontIL35291U.S. Bank N.A.October 30, 2009January 15, 2013
Bank USA, N.A.PhoenixAZ32218U.S. Bank N.A.October 30, 2009August 22, 2012
First DuPage BankWestmontIL35038First Midwest BankOctober 23, 2009August 22, 2012
Riverview Community BankOtsegoMN57525Central BankOctober 23, 2009August 22, 2012
Bank of ElmwoodRacineWI18321Tri City National BankOctober 23, 2009August 22, 2012
Flagship National BankBradentonFL35044First Federal Bank of FloridaOctober 23, 2009August 22, 2012
Hillcrest Bank FloridaNaplesFL58336Stonegate BankOctober 23, 2009August 22, 2012
American United BankLawrencevilleGA57794Ameris BankOctober 23, 2009September 5, 2012
Partners BankNaplesFL57959Stonegate BankOctober 23, 2009January 15, 2013
San Joaquin BankBakersfieldCA23266Citizens Business BankOctober 16, 2009August 22, 2012
Southern Colorado National BankPuebloCO57263Legacy BankOctober 2, 2009September 5, 2012
Jennings State BankSpring GroveMN11416Central BankOctober 2, 2009August 21, 2012
Warren BankWarrenMI34824The Huntington National BankOctober 2, 2009August 21, 2012
Georgian BankAtlantaGA57151First Citizens Bank and Trust Company, Inc.September 25, 2009August 21, 2012
Irwin Union Bank, F.S.B.LouisvilleKY57068First Financial Bank, N.A.September 18, 2009September 5, 2012
Irwin Union Bank and Trust CompanyColumbusIN10100First Financial Bank, N.A.September 18, 2009August 21, 2012
Venture BankLaceyWA22868First-Citizens Bank & Trust CompanySeptember 11, 2009August 21, 2012
Brickwell Community BankWoodburyMN57736CorTrust Bank N.A.September 11, 2009January 15, 2013
Corus Bank, N.A.ChicagoIL13693MB Financial Bank, N.A.September 11, 2009August 21, 2012
First State BankFlagstaffAZ34875Sunwest BankSeptember 4, 2009January 15, 2013
Platinum Community BankRolling MeadowsIL35030No AcquirerSeptember 4, 2009August 21, 2012
Vantus BankSioux CityIA27732Great Southern BankSeptember 4, 2009August 21, 2012
InBankOak ForestIL20203MB Financial Bank, N.A.September 4, 2009August 21, 2012
First Bank of Kansas CityKansas CityMO25231Great American BankSeptember 4, 2009August 21, 2012
Affinity BankVenturaCA27197Pacific Western BankAugust 28, 2009August 21, 2012
Mainstreet BankForest LakeMN1909Central BankAugust 28, 2009August 21, 2012
Bradford BankBaltimoreMD28312Manufacturers and Traders Trust Company (M&T Bank)August 28, 2009January 15, 2013
Guaranty BankAustinTX32618BBVA CompassAugust 21, 2009August 21, 2012
CapitalSouth BankBirmingham AL22130IBERIABANKAugust 21, 2009January 15, 2013
First Coweta Bank NewnanGA57702United BankAugust 21, 2009January 15, 2013
ebankAtlantaGA34682Stearns Bank, N.A.August 21, 2009August 21, 2012
Community Bank of NevadaLas VegasNV34043No AcquirerAugust 14, 2009August 21, 2012
Community Bank of ArizonaPhoenixAZ57645MidFirst BankAugust 14, 2009August 21, 2012
Union Bank, National AssociationGilbertAZ34485MidFirst BankAugust 14, 2009August 21, 2012
Colonial BankMontgomeryAL9609Branch Banking & Trust Company, (BB&T) August 14, 2009September 5, 2012
Dwelling House Savings and Loan AssociationPittsburghPA31559PNC Bank, N.A.August 14, 2009January 15, 2013
Community First BankPrinevilleOR23268Home Federal BankAugust 7, 2009January 15, 2013
Community National Bank of Sarasota CountyVeniceFL27183Stearns Bank, N.A.August 7, 2009August 20, 2012
First State BankSarasotaFL27364Stearns Bank, N.A.August 7, 2009August 20, 2012
Mutual BankHarveyIL18659United Central BankJuly 31, 2009August 20, 2012
First BankAmericanoElizabethNJ34270Crown BankJuly 31, 2009August 20, 2012
Peoples Community BankWest ChesterOH32288First Financial Bank, N.A.July 31, 2009August 20, 2012
Integrity BankJupiterFL57604Stonegate BankJuly 31, 2009August 20, 2012
First State Bank of AltusAltusOK9873Herring BankJuly 31, 2009August 20, 2012
Security Bank of Jones CountyGrayGA8486State Bank and Trust CompanyJuly 24, 2009August 20, 2012
Security Bank of Houston CountyPerryGA27048State Bank and Trust CompanyJuly 24, 2009August 20, 2012
Security Bank of Bibb CountyMaconGA27367State Bank and Trust CompanyJuly 24, 2009August 20, 2012
Security Bank of North MetroWoodstockGA57105State Bank and Trust CompanyJuly 24, 2009August 20, 2012
Security Bank of North FultonAlpharettaGA57430State Bank and Trust CompanyJuly 24, 2009August 20, 2012
Security Bank of Gwinnett CountySuwaneeGA57346State Bank and Trust CompanyJuly 24, 2009August 20, 2012
Waterford Village BankWilliamsvilleNY58065Evans Bank, N.A.July 24, 2009August 20, 2012
Temecula Valley BankTemeculaCA34341First-Citizens Bank & Trust CompanyJuly 17, 2009August 20, 2012
Vineyard BankRancho CucamongaCA23556California Bank & TrustJuly 17, 2009August 20, 2012
BankFirstSioux FallsSD34103Alerus Financial, N.A.July 17, 2009August 20, 2012
First Piedmont BankWinderGA34594First American Bank and Trust CompanyJuly 17, 2009January 15, 2013
Bank of WyomingThermopolisWY22754Central Bank & TrustJuly 10, 2009August 20, 2012
Founders BankWorthIL18390The PrivateBank and Trust CompanyJuly 2, 2009August 20, 2012
Millennium State Bank of TexasDallasTX57667State Bank of TexasJuly 2, 2009October 26, 2012
First National Bank of DanvilleDanvilleIL3644First Financial Bank, N.A.July 2, 2009August 20, 2012
Elizabeth State BankElizabethIL9262Galena State Bank and Trust CompanyJuly 2, 2009August 20, 2012
Rock River BankOregonIL15302The Harvard State BankJuly 2, 2009August 20, 2012
First State Bank of WinchesterWinchesterIL11710The First National Bank of BeardstownJuly 2, 2009August 20, 2012
John Warner BankClintonIL12093State Bank of LincolnJuly 2, 2009August 20, 2012
Mirae BankLos AngelesCA57332Wilshire State BankJune 26, 2009August 20, 2012
MetroPacific BankIrvineCA57893Sunwest BankJune 26, 2009August 20, 2012
Horizon BankPine CityMN9744Stearns Bank, N.A.June 26, 2009August 20, 2012
Neighborhood Community BankNewnanGA35285CharterBankJune 26, 2009August 20, 2012
Community Bank of West GeorgiaVilla RicaGA57436No AcquirerJune 26, 2009August 17, 2012
First National Bank of AnthonyAnthonyKS4614Bank of KansasJune 19, 2009August 17, 2012
Cooperative BankWilmingtonNC27837First BankJune 19, 2009August 17, 2012
Southern Community BankFayettevilleGA35251United Community BankJune 19, 2009August 17, 2012
Bank of LincolnwoodLincolnwoodIL17309Republic Bank of ChicagoJune 5, 2009August 17, 2012
Citizens National BankMacombIL5757Morton Community BankMay 22, 2009September 4, 2012
Strategic Capital BankChampaignIL35175Midland States BankMay 22, 2009September 4, 2012
BankUnited, FSBCoral GablesFL32247BankUnitedMay 21, 2009August 17, 2012
Westsound BankBremertonWA34843Kitsap BankMay 8, 2009September 4, 2012
America West BankLaytonUT35461Cache Valley BankMay 1, 2009August 17, 2012
Citizens Community BankRidgewoodNJ57563North Jersey Community BankMay 1, 2009September 4, 2012
Silverton Bank, NAAtlantaGA26535No AcquirerMay 1, 2009August 17, 2012
First Bank of IdahoKetchumID34396U.S. Bank, N.A.April 24, 2009August 17, 2012
First Bank of Beverly HillsCalabasasCA32069No AcquirerApril 24, 2009September 4, 2012
Michigan Heritage BankFarmington HillsMI34369Level One BankApril 24, 2009August 17, 2012
American Southern BankKennesawGA57943Bank of North GeorgiaApril 24, 2009August 17, 2012
Great Basin Bank of NevadaElkoNV33824Nevada State BankApril 17, 2009September 4, 2012
American Sterling BankSugar CreekMO8266Metcalf BankApril 17, 2009August 31, 2012
New Frontier BankGreeleyCO34881No AcquirerApril 10, 2009September 4, 2012
Cape Fear BankWilmingtonNC34639First Federal Savings and Loan AssociationApril 10, 2009August 17, 2012
Omni National BankAtlantaGA22238No AcquirerMarch 27, 2009August 17, 2012
TeamBank, NAPaolaKS4754Great Southern BankMarch 20, 2009August 17, 2012
Colorado National BankColorado SpringsCO18896Herring BankMarch 20, 2009August 17, 2012
FirstCity BankStockbridgeGA18243No AcquirerMarch 20, 2009August 17, 2012
Freedom Bank of GeorgiaCommerceGA57558Northeast Georgia BankMarch 6, 2009August 17, 2012
Security Savings BankHendersonNV34820Bank of NevadaFebruary 27, 2009September 7, 2012
Heritage Community BankGlenwoodIL20078MB Financial Bank, N.A.February 27, 2009August 17, 2012
Silver Falls BankSilvertonOR35399Citizens BankFebruary 20, 2009August 17, 2012
Pinnacle Bank of OregonBeavertonOR57342Washington Trust Bank of SpokaneFebruary 13, 2009August 17, 2012
Corn Belt Bank & Trust Co.PittsfieldIL16500The Carlinville National BankFebruary 13, 2009August 17, 2012
Riverside Bank of the Gulf CoastCape CoralFL34563TIB BankFebruary 13, 2009August 17, 2012
Sherman County BankLoup CityNE5431Heritage BankFebruary 13, 2009August 17, 2012
County BankMercedCA22574Westamerica BankFebruary 6, 2009September 4, 2012
Alliance BankCulver CityCA 23124California Bank & TrustFebruary 6, 2009August 16, 2012
FirstBank Financial ServicesMcDonoughGA57017Regions BankFebruary 6, 2009August 16, 2012
Ocala National BankOcalaFL26538CenterState Bank of Florida, N.A.January 30, 2009September 4, 2012
Suburban FSBCroftonMD30763Bank of EssexJanuary 30, 2009August 16, 2012
MagnetBankSalt Lake CityUT58001No AcquirerJanuary 30, 2009August 16, 2012
1st Centennial BankRedlandsCA33025First California BankJanuary 23, 2009August 16, 2012
Bank of Clark CountyVancouverWA34959Umpqua BankJanuary 16, 2009August 16, 2012
National Bank of CommerceBerkeleyIL19733Republic Bank of ChicagoJanuary 16, 2009August 16, 2012
Sanderson State Bank
+ En Espanol
SandersonTX11568The Pecos County State BankDecember 12, 2008September 4, 2012
Haven Trust BankDuluthGA35379Branch Banking & Trust Company, (BB&T) December 12, 2008August 16, 2012
First Georgia Community BankJacksonGA34301United BankDecember 5, 2008August 16, 2012
PFF Bank & Trust PomonaCA28344U.S. Bank, N.A.November 21, 2008January 4, 2013
Downey Savings & LoanNewport BeachCA30968U.S. Bank, N.A.November 21, 2008January 4, 2013
Community BankLoganvilleGA16490Bank of EssexNovember 21, 2008September 4, 2012
Security Pacific BankLos AngelesCA23595Pacific Western BankNovember 7, 2008August 28, 2012
Franklin Bank, SSBHoustonTX26870Prosperity BankNovember 7, 2008August 16, 2012
Freedom BankBradentonFL57930Fifth Third BankOctober 31, 2008August 16, 2012
Alpha Bank & TrustAlpharettaGA58241Stearns Bank, N.A.October 24, 2008August 16, 2012
Meridian BankEldredIL13789National BankOctober 10, 2008May 31, 2012
Main Street BankNorthvilleMI57654Monroe Bank & TrustOctober 10, 2008August 16, 2012
Washington Mutual Bank
+ (Including its subsidiary Washington Mutual Bank FSB)
HendersonNV32633JP Morgan Chase BankSeptember 25, 2008August 16, 2012
AmeribankNorthforkWV6782The Citizens Savings Bank

Pioneer Community Bank, Inc.
September 19, 2008August 16, 2012
Silver State Bank
+ En Espanol
HendersonNV34194Nevada State BankSeptember 5, 2008August 16, 2012
Integrity BankAlpharettaGA35469Regions BankAugust 29, 2008August 16, 2012
Columbian Bank & TrustTopekaKS22728Citizens Bank & TrustAugust 22, 2008August 16, 2012
First Priority BankBradentonFL57523SunTrust BankAugust 1, 2008August 16, 2012
First Heritage Bank, NANewport BeachCA57961Mutual of Omaha BankJuly 25, 2008August 28, 2012
First National Bank of NevadaRenoNV27011Mutual of Omaha BankJuly 25, 2008August 28, 2012
IndyMac BankPasadenaCA29730OneWest Bank, FSBJuly 11, 2008August 28, 2012
First Integrity Bank, NAStaplesMN12736First International Bank and TrustMay 30, 2008August 28, 2012
ANB Financial, NABentonvilleAR33901Pulaski Bank and Trust CompanyMay 9, 2008August 28, 2012
Hume BankHumeMO1971Security BankMarch 7, 2008August 28, 2012
Douglass National BankKansas CityMO24660Liberty Bank and Trust CompanyJanuary 25, 2008October 26, 2012
Miami Valley BankLakeviewOH16848The Citizens Banking CompanyOctober 4, 2007August 28, 2012
NetBankAlpharettaGA32575ING DIRECTSeptember 28, 2007August 28, 2012
Metropolitan Savings BankPittsburghPA35353Allegheny Valley Bank of PittsburghFebruary 2, 2007October 27, 2010
Bank of EphraimEphraimUT1249Far West BankJune 25, 2004April 9, 2008
Reliance BankWhite PlainsNY26778Union State BankMarch 19, 2004April 9, 2008
Guaranty National Bank of TallahasseeTallahasseeFL26838Hancock Bank of FloridaMarch 12, 2004June 5, 2012
Dollar Savings BankNewarkNJ31330No AcquirerFebruary 14, 2004April 9, 2008
Pulaski Savings BankPhiladelphiaPA27203Earthstar BankNovember 14, 2003July 22, 2005
First National Bank of BlanchardvilleBlanchardvilleWI11639The Park BankMay 9, 2003June 5, 2012
Southern Pacific BankTorranceCA27094Beal BankFebruary 7, 2003October 20, 2008
Farmers Bank of CheneyvilleCheneyvilleLA16445Sabine State Bank & TrustDecember 17, 2002October 20, 2004
Bank of AlamoAlamoTN9961No AcquirerNovember 8, 2002March 18, 2005
AmTrade International Bank
En Espanol
AtlantaGA33784No AcquirerSeptember 30, 2002September 11, 2006
Universal Federal Savings BankChicagoIL29355Chicago Community BankJune 27, 2002April 9, 2008
Connecticut Bank of CommerceStamfordCT19183Hudson United BankJune 26, 2002February 14, 2012
New Century BankShelby TownshipMI34979No AcquirerMarch 28, 2002March 18, 2005
Net 1st National BankBoca RatonFL26652Bank Leumi USAMarch 1, 2002April 9, 2008
NextBank, NAPhoenixAZ22314No AcquirerFebruary 7, 2002August 27, 2010
Oakwood Deposit Bank Co.OakwoodOH8966The State Bank & Trust CompanyFebruary 1, 2002October 25, 2012
Bank of Sierra BlancaSierra BlancaTX22002The Security State Bank of PecosJanuary 18, 2002November 6, 2003
Hamilton Bank, NA
+ En Espanol
MiamiFL24382Israel Discount Bank of New YorkJanuary 11, 2002June 5, 2012
Sinclair National BankGravetteAR34248Delta Trust & BankSeptember 7, 2001February 10, 2004
Superior Bank, FSBHinsdaleIL32646Superior Federal, FSBJuly 27, 2001June 5, 2012
Malta National BankMaltaOH6629North Valley BankMay 3, 2001November 18, 2002
First Alliance Bank & Trust Co.ManchesterNH34264Southern New Hampshire Bank & TrustFebruary 2, 2001February 18, 2003
National State Bank of MetropolisMetropolisIL3815Banterra Bank of MarionDecember 14, 2000March 17, 2005
Bank of HonoluluHonoluluHI21029Bank of the OrientOctober 13, 2000March 17, 2005
+ + + + +
+ + +
+
+ + + + +

+ + + + Last Updated + 04/23/2013 + + + +cservicefdicdal@fdic.gov
+ + +
+
+ + +
+ + + +
+ + + + + + + + + + + + + diff --git a/pandas/io/tests/data/spam.html b/pandas/io/tests/data/spam.html new file mode 100644 index 0000000000000..9f6ac2d74e0c9 --- /dev/null +++ b/pandas/io/tests/data/spam.html @@ -0,0 +1,797 @@ + + + + + + + + + + + + + Show Foods + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ National Nutrient Database + + + + + + + + + +
+ + + +
+
+ National Nutrient Database for Standard Reference
Release 25 +
+
+ + + + + + + +
Basic Report
+ +
+

Nutrient data for 07908, Luncheon meat, pork with ham, minced, canned, includes SPAM (Hormel) + + +

+ + + +
+ + +
+
+
Modifying household measures
+
+ +
+ +
+
+
+ + + + +
+ + + + + + + + + + + +
+ + +

Nutrient values and weights are for edible portion

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Help
NutrientUnit
Value per 100.0g
+ +
+ + oz 1 NLEA serving +
56g + +
Proximates
Water + + + g51.7028.95
Energy + + + kcal315176
Protein + + + g13.407.50
Total lipid (fat) + + + g26.6014.90
Carbohydrate, by difference + + + g4.602.58
Fiber, total dietary + + + g0.00.0
Sugars, total + + + g0.000.00
Minerals
Calcium, Ca + + + mg00
Iron, Fe + + + mg0.640.36
Magnesium, Mg + + + mg148
Phosphorus, P + + + mg15185
Potassium, K + + + mg409229
Sodium, Na + + + mg1411790
Zinc, Zn + + + mg1.590.89
Vitamins
Vitamin C, total ascorbic acid + + + mg0.00.0
Thiamin + + + mg0.3170.178
Riboflavin + + + mg0.1760.099
Niacin + + + mg3.5301.977
Vitamin B-6 + + + mg0.2180.122
Folate, DFE + + + µg32
Vitamin B-12 + + + µg0.450.25
Vitamin A, RAE + + + µg00
Vitamin A, IU + + + IU00
Vitamin E (alpha-tocopherol) + + + mg0.420.24
Vitamin D (D2 + D3) + + + µg0.60.3
Vitamin D + + + IU2615
Vitamin K (phylloquinone) + + + µg0.00.0
Lipids
Fatty acids, total saturated + + + g9.9875.593
Fatty acids, total monounsaturated + + + g13.5057.563
Fatty acids, total polyunsaturated + + + g2.0191.131
Cholesterol + + + mg7140
Other
Caffeine + + + mg00
+ +
+
+ + + + + +
+ +
+ + + + +
+ + + \ No newline at end of file diff --git a/pandas/io/tests/test_html.py b/pandas/io/tests/test_html.py new file mode 100644 index 0000000000000..d0468026caef3 --- /dev/null +++ b/pandas/io/tests/test_html.py @@ -0,0 +1,324 @@ +import os +import re +from cStringIO import StringIO +from unittest import TestCase + +import nose + +import numpy as np +from numpy.testing.decorators import slow + +from pandas.io.html import read_html, import_module +from pandas import DataFrame, MultiIndex +from pandas.util.testing import assert_frame_equal, network + + +def _skip_if_no_parser(): + try: + import_module('lxml') + except ImportError: + try: + import_module('bs4') + except ImportError: + raise nose.SkipTest + + +DATA_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data') + + +def _run_read_html(*args, **kwargs): + _skip_if_no_parser() + return read_html(*args, **kwargs) + + +def isframe(x): + return isinstance(x, DataFrame) + + +def assert_framelist_equal(list1, list2): + assert len(list1) == len(list2), ('lists are not of equal size ' + 'len(list1) == {0}, ' + 'len(list2) == {1}'.format(len(list1), + len(list2))) + assert all(map(lambda x, y: isframe(x) and isframe(y), list1, list2)), \ + 'not all list elements are DataFrames' + for frame_i, frame_j in zip(list1, list2): + assert_frame_equal(frame_i, frame_j) + assert not frame_i.empty, 'frames are both empty' + + +class TestLxmlReadHtml(TestCase): + def setUp(self): + self.spam_data = os.path.join(DATA_PATH, 'spam.html') + self.banklist_data = os.path.join(DATA_PATH, 'failed_banklist.html') + + def run_read_html(self, *args, **kwargs): + kwargs['flavor'] = 'lxml' + return _run_read_html(*args, **kwargs) + + @network + def test_banklist_url(self): + url = 'http://www.fdic.gov/bank/individual/failed/banklist.html' + df1 = self.run_read_html(url, 'First Federal Bank of Florida', + attrs={"id": 'table'}) + df2 = self.run_read_html(url, 'Metcalf Bank', attrs={'id': 'table'}) + + assert_framelist_equal(df1, df2) + + @network + def test_spam_url(self): + url = ('http://ndb.nal.usda.gov/ndb/foods/show/1732?fg=&man=&' + 'lfacet=&format=&count=&max=25&offset=&sort=&qlookup=spam') + df1 = self.run_read_html(url, '.*Water.*') + df2 = self.run_read_html(url, 'Unit') + + assert_framelist_equal(df1, df2) + + @slow + def test_banklist(self): + df1 = self.run_read_html(self.banklist_data, '.*Florida.*', + attrs={'id': 'table'}) + df2 = self.run_read_html(self.banklist_data, 'Metcalf Bank', + attrs={'id': 'table'}) + + assert_framelist_equal(df1, df2) + + @slow + def test_banklist_header(self): + df = self.run_read_html(self.banklist_data, 'Metcalf', + attrs={'id': 'table'}, header=0, skiprows=1)[0] + self.assertFalse(df.empty) + cols = ['Bank Name', 'City', 'State', 'CERT #', + 'Acquiring Institution', 'Closing Date', 'Updated Date'] + self.assertListEqual(df.columns.values.tolist(), cols) + self.assertEqual(df.shape[0], 499) + + def test_spam(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', + infer_types=False) + df2 = self.run_read_html(self.spam_data, 'Unit', infer_types=False) + + assert_framelist_equal(df1, df2) + + self.assertEqual(df1[0].ix[0, 0], 'Nutrient') + + def test_spam_no_match(self): + dfs = self.run_read_html(self.spam_data) + for df in dfs: + self.assertIsInstance(df, DataFrame) + + def test_banklist_no_match(self): + dfs = self.run_read_html(self.banklist_data, attrs={'id': 'table'}) + for df in dfs: + self.assertIsInstance(df, DataFrame) + + def test_spam_header(self): + df = self.run_read_html(self.spam_data, '.*Water.*', header=0)[0] + self.assertEqual(df.columns[0], 'Nutrient') + self.assertFalse(df.empty) + + def test_skiprows_int(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', skiprows=1) + df2 = self.run_read_html(self.spam_data, 'Unit', skiprows=1) + + assert_framelist_equal(df1, df2) + + def test_skiprows_xrange(self): + df1 = [self.run_read_html(self.spam_data, '.*Water.*').pop()[2:]] + df2 = self.run_read_html(self.spam_data, 'Unit', skiprows=xrange(2)) + + assert_framelist_equal(df1, df2) + + def test_skiprows_list(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', skiprows=[1, 2]) + df2 = self.run_read_html(self.spam_data, 'Unit', skiprows=[2, 1]) + + assert_framelist_equal(df1, df2) + + def test_skiprows_set(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', + skiprows=set([1, 2])) + df2 = self.run_read_html(self.spam_data, 'Unit', skiprows=set([2, 1])) + + assert_framelist_equal(df1, df2) + + def test_skiprows_slice(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', skiprows=1) + df2 = self.run_read_html(self.spam_data, 'Unit', skiprows=1) + + assert_framelist_equal(df1, df2) + + def test_skiprows_slice_short(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', + skiprows=slice(2)) + df2 = self.run_read_html(self.spam_data, 'Unit', skiprows=slice(2)) + + assert_framelist_equal(df1, df2) + + def test_skiprows_slice_long(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', + skiprows=slice(2, 5)) + df2 = self.run_read_html(self.spam_data, 'Unit', + skiprows=slice(4, 1, -1)) + + assert_framelist_equal(df1, df2) + + def test_skiprows_ndarray(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', + skiprows=np.arange(2)) + df2 = self.run_read_html(self.spam_data, 'Unit', skiprows=np.arange(2)) + + assert_framelist_equal(df1, df2) + + def test_skiprows_invalid(self): + self.assertRaises(ValueError, self.run_read_html, self.spam_data, + '.*Water.*', skiprows='asdf') + + def test_index(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', index_col=0) + df2 = self.run_read_html(self.spam_data, 'Unit', index_col=0) + assert_framelist_equal(df1, df2) + + def test_header(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', header=0) + df2 = self.run_read_html(self.spam_data, 'Unit', header=0) + assert_framelist_equal(df1, df2) + self.assertEqual(df1[0].columns[0], 'Nutrient') + + def test_header_and_index(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', header=0, + index_col=0) + df2 = self.run_read_html(self.spam_data, 'Unit', header=0, index_col=0) + assert_framelist_equal(df1, df2) + + def test_infer_types(self): + df1 = self.run_read_html(self.spam_data, '.*Water.*', header=0, + index_col=0, infer_types=False) + df2 = self.run_read_html(self.spam_data, 'Unit', header=0, index_col=0, + infer_types=False) + assert_framelist_equal(df1, df2) + + df2 = self.run_read_html(self.spam_data, 'Unit', header=0, index_col=0, + infer_types=True) + + self.assertRaises(AssertionError, assert_framelist_equal, df1, df2) + + def test_string_io(self): + with open(self.spam_data) as f: + data1 = StringIO(f.read()) + + with open(self.spam_data) as f: + data2 = StringIO(f.read()) + + df1 = self.run_read_html(data1, '.*Water.*', infer_types=False) + df2 = self.run_read_html(data2, 'Unit', infer_types=False) + assert_framelist_equal(df1, df2) + + def test_string(self): + with open(self.spam_data) as f: + data = f.read() + + df1 = self.run_read_html(data, '.*Water.*', infer_types=False) + df2 = self.run_read_html(data, 'Unit', infer_types=False) + + assert_framelist_equal(df1, df2) + + def test_file_like(self): + with open(self.spam_data) as f: + df1 = self.run_read_html(f, '.*Water.*', infer_types=False) + + with open(self.spam_data) as f: + df2 = self.run_read_html(f, 'Unit', infer_types=False) + + assert_framelist_equal(df1, df2) + + def test_bad_url_protocol(self): + self.assertRaises(ValueError, self.run_read_html, 'git://github.com', + '.*Water.*') + + @slow + def test_file_url(self): + url = self.banklist_data + dfs = self.run_read_html('file://' + url, 'First', + attrs={'id': 'table'}) + self.assertIsInstance(dfs, list) + for df in dfs: + self.assertIsInstance(df, DataFrame) + + @slow + def test_invalid_table_attrs(self): + url = self.banklist_data + self.assertRaises(AssertionError, self.run_read_html, url, + 'First Federal Bank of Florida', + attrs={'id': 'tasdfable'}) + + def _bank_data(self, *args, **kwargs): + return self.run_read_html(self.banklist_data, 'Metcalf', + attrs={'id': 'table'}, *args, **kwargs) + + @slow + def test_multiindex_header(self): + df = self._bank_data(header=[0, 1])[0] + self.assertIsInstance(df.columns, MultiIndex) + + @slow + def test_multiindex_index(self): + df = self._bank_data(index_col=[0, 1])[0] + self.assertIsInstance(df.index, MultiIndex) + + @slow + def test_multiindex_header_index(self): + df = self._bank_data(header=[0, 1], index_col=[0, 1])[0] + self.assertIsInstance(df.columns, MultiIndex) + self.assertIsInstance(df.index, MultiIndex) + + @slow + def test_multiindex_header_skiprows(self): + df = self._bank_data(header=[0, 1], skiprows=1)[0] + self.assertIsInstance(df.columns, MultiIndex) + + @slow + def test_multiindex_header_index_skiprows(self): + df = self._bank_data(header=[0, 1], index_col=[0, 1], skiprows=1)[0] + self.assertIsInstance(df.index, MultiIndex) + + @slow + def test_regex_idempotency(self): + url = self.banklist_data + dfs = self.run_read_html('file://' + url, + match=re.compile(re.compile('Florida')), + attrs={'id': 'table'}) + self.assertIsInstance(dfs, list) + for df in dfs: + self.assertIsInstance(df, DataFrame) + + def test_negative_skiprows_spam(self): + url = self.spam_data + self.assertRaises(AssertionError, self.run_read_html, url, 'Water', + skiprows=-1) + + def test_negative_skiprows_banklist(self): + url = self.banklist_data + self.assertRaises(AssertionError, self.run_read_html, url, 'Florida', + skiprows=-1) + + @slow + def test_multiple_matches(self): + url = self.banklist_data + dfs = self.run_read_html(url, match=r'Florida') + self.assertIsInstance(dfs, list) + self.assertGreater(len(dfs), 1) + for df in dfs: + self.assertIsInstance(df, DataFrame) + + +def test_invalid_flavor(): + url = 'google.com' + nose.tools.assert_raises(AssertionError, _run_read_html, url, 'google', + flavor='not a* valid**++ flaver') + + +class TestBs4ReadHtml(TestLxmlReadHtml): + def run_read_html(self, *args, **kwargs): + kwargs['flavor'] = 'bs4' + return _run_read_html(*args, **kwargs) diff --git a/setup.py b/setup.py index 24b07b1d274fc..3e56144e25378 100755 --- a/setup.py +++ b/setup.py @@ -509,7 +509,8 @@ def pxd(name): 'tests/data/*.txt', 'tests/data/*.xls', 'tests/data/*.xlsx', - 'tests/data/*.table'], + 'tests/data/*.table', + 'tests/data/*.html'], 'pandas.tools': ['tests/*.csv'], 'pandas.tests': ['data/*.pickle', 'data/*.csv'],