High-quality datasets are of paramount importance for the operation and planning of wind farms. However,the datasets collected by the supervisory control and data acquisition system may contain missing values due to various factors such as sensor failure and communication congestion. In this paper, a data-driven approach is proposed to fill missing data of wind farms based on a context encoder (CE), which consists of an encoder, a decoder, and a discriminator. Through deep convolutional neural networks, the proposed method is able to automatically explore the complex non-linear characteristics of the datasets that are difficult to model explicitly. The proposed method can not only fully use the surrounding context information by the reconstructed loss, but also make filling data look real by the adversarial loss. In addition, the correlation among multiple missing attributes is taken into account by adjusting the format of input data. The simulation results show that the performance of CE is better than traditional methods for the attributes of wind farms with hallmark characteristics such as large peaks, large valleys, and fast ramps. Moreover, the CE shows stronger generalization ability than those of traditional methods such as auto-encoder, K-means, k-nearest neighbor, back propagation neural network, cubic interpolation, and conditional generative adversarial networkfor different missing data scales.