The dark-energy component of the Universe still remains a mystery ; however , several papers based on observational data have shown that its equation of state may have an oscillatory behaviour . In this paper , we provide a general description for the dark-energy equation of state w ( z ) in the form of a Fourier series . This description generalizes some previous dynamical dark-energy models and is in agreement with the w ( z ) reconstructions . We make use of a modified version of a simple and fast Markov chain Monte Carlo code to constrain the model parameters . For the analysis we use data from supernovae type Ia , baryon acoustic oscillations , H ( z ) measurements and cosmic microwave background . We provide a comparison of the proposed model with \Lambda CDM , w CDM and the standard Taylor approximation . The Fourier-series expansion of w ( z ) is preferred from \Lambda CDM at more than the 3 \sigma significance level based on the improvement in the fit alone . We use the Akaike criterion to perform the model comparison and find that , even though there are extra parameters , there is a slight preference for the Fourier series compared with the \Lambda CDM model . The preferred shape of w ( z ) found here puts in jeopardy the single scalar field models , as they can not reproduce the crossing of the phantom divide line w = − 1 .