Most Python is still single-threaded unless you get into the more advanced stuff. R multithreads a little bit more easily, but 4 cores is more than enough.
However, the extra clockspeed of the i7 would probably run things a bit better. You could also look into the i5-8250u (15W TDP, insane battery life, 4C/8T like the 7th gen i7). There's also an i7-8550u with a bit higher clocks.