Python Forum
for loop and if translate from R in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for loop and if translate from R in Python
#1
Hi everyone,

i have a new work in data science.
My problem is that i always code in R and in python i have no good experience

1)
my code in R
Quote: for(i in 1:length(l)) X[,i] = MF[[i]](x)

in Python
Quote:for i in range(1,1+l.length()):
X[:,i]= MF[i](x)

i really don't know if it is right Dodgy

2)
code in R
Quote:if(is.na(sv[1])) l = rep(0,length(V)) else l = sv[-1]

Python
this is very confusing for me i have noooo ideas Sad
Reply


Messages In This Thread
for loop and if translate from R in Python - by Joey21 - Feb-06-2018, 09:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Explaining "translate" method lummers 4 3,384 Jan-13-2020, 06:31 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020