pandas equivalent of np.where

Question or problem about Python programming: np.where has the semantics of a vectorized if/else (similar to Apache Spark’s when/otherwise DataFrame method). I know that I can use np.where on pandas Series, but pandas often defines its own API to use instead of raw numpy functions, which is usually more convenient with pd.Series/pd.DataFrame.

Continue Reading

Mako or Jinja2?

Question or problem about Python programming: I didn’t find a good comparison of jinja2 and Mako. What would you use for what tasks ? I personnaly was satisfied by mako (in a pylons web app context) but am curious to know if jinja2 has some nice features/improvements that mako doesn’t ? -or maybe downsides ?- […]

Continue Reading