7. The minimum value of the function $f(x)=\sum_{k=1}^{2013}|x-k|$ is
7.1013042.

Notice that, the median of $1,2, \cdots, 2013$ is 1007.
Therefore, when $x=1007$, the function reaches its minimum value
$$
\begin{array}{l}
f(1007)=2(1+2+\cdots+1006) \\
=1006 \times 1007=1013042
\end{array}
$$