Consider an i.i.d. sample (Xi, Yi), i = 1, . . . , n of observations and denote by F (y|x) the conditional cumulative distribution function of Yi given Xi = x. We provide a data driven nonparametric strategy to estimate F . We prove that, in term of the integrated mean square risk on a compact set, our estimator performs a squared-bias variance compromise. We deduce from this an upper bound for the rate of convergence of the estimator, in a context of anisotropic function classes. A lower bound for this rate is also proved, which implies the optimality of our estimator. Then our procedure can be adapted to positive censored random variables Yi's, i.e. when only Zi = inf(Yi, Ci) and δi = ½ {Y i ≤C i } are observed, for an i.i.d. censoring sequence (Ci) 1≤i≤n independent of (Xi, Yi) 1≤i≤n . Simulation experiments and a real data example illustrate the method.