We consider a Köthe space $(𝔼,||·||_𝔼)$ of random variables (r.v.) defined on the Lebesgue space ([0,1],B,λ). We show that for any sub-σ-algebra ℱ of B and for all r.v.'s X with values in a separable finitely compact metric space (M,d) such that d(X,x) ∈ 𝔼 for all x ∈ M (we then write X ∈ 𝔼(M)), there exists a median of X given ℱ, i.e., an ℱ-measurable r.v. Y ∈ 𝔼(M) such that $||d(X,Y)||_𝔼 ≤ ||d(X,Z)||_𝔼$ for all ℱ-measurable Z. We develop the basic theory of these medians, we show the convergence of empirical medians and we give some applications.