  Scientific studies of society increasingly rely on digital traces produced by
various aspects of human activity. In this paper, we use a relatively
unexplored source of data, anonymized records of bank card transactions
collected in Spain by a big European bank, in order to propose a new
classification scheme of cities based on the economic behavior of their
residents. First, we study how individual spending behavior is qualitatively
and quantitatively affected by various factors such as customer's age, gender,
and size of a home city. We show that, similar to other socioeconomic urban
quantities, individual spending activity exhibits a statistically significant
superlinear scaling with city size. With respect to the general trends, we
quantify the distinctive signature of each city in terms of residents' spending
behavior, independently from the effects of scale and demographic
heterogeneity. Based on the comparison of city signatures, we build a novel
classification of cities across Spain in three categories. That classification
is, with few exceptions, stable over different ways of city definition and
connects with a meaningful socioeconomic interpretation. Furthermore, it
appears to be related with the ability of cities to attract foreign visitors,
which is a particularly remarkable finding given that the classification was
based exclusively on the behavioral patterns of city residents. This highlights
the far-reaching applicability of the presented classification approach and its
ability to discover patterns that go beyond the quantities directly involved in
it.
