![jupyter notebook tutorial pdf jupyter notebook tutorial pdf](https://www.aipython.in/wp-content/uploads/2021/03/Jupyter-notebook-for-Python.jpg)
Write.table (iris ,file = 'iris.txt' ,sep = '\t' ,col.names = T ,quote = F ,row.names = F ) rm (iris ) #Read in the file we just wrote. #Load it withĭata (iris ) #Let's write it into a file and read it from input. #One of the most common datasets in use is the Iris dataset. #rownames(mx2)Ĭbinded = cbind (mx2, rep ( 3, 3 ), mx2 ) #Join matrices by rows. #Join matrices by columns #Make sure that matrix column names match. Mx_col3div2 =mx2 / 2 #Change 1 row of mx2
![jupyter notebook tutorial pdf jupyter notebook tutorial pdf](https://miro.medium.com/max/1400/1*iIzQfqPYGyGg_6oCkuj5dg.png)
Mx2_col2 =mx2 #Extract element value in third column and first row Mx2_row12 =mx2 #Multiply the first row elements by two. Mx4 = matrix ( rep ( 10, 10 ), ncol = 5 ) #How many rows and columns / printed on console print ( 'Rownumber of mx2' ) nrow (mx2 ) print ( 'Colnumber of mx2' ) ncol (mx2 ) #Extract subsets in matrix. Larger_than4 =x # All elements of x that are greater/equal than 4įn_ = sin (x +2 ) ^ 2 + c ( 3 ) Joined_vec = c (x ,z ) #join x and z vectors Last_fr =fruits #last element of a vectorįirst_2 =fruits # First two elementsįirst_3 =fruits #Elements 1 to 3Īll_ex3 =fruits #Everything exept the 3 elements See what it does by consulting the help pages.įruits = c ( "apples", "oranges", "kiwis", "mangos" )Īsn = as.numeric ( c ( "1", "2", "3" ))įr_1 =fruits #first element of a vector
![jupyter notebook tutorial pdf jupyter notebook tutorial pdf](https://miro.medium.com/max/1200/1*RUvqu9TepCDmElSlvKRhlA.png)
Y = x + 1 #We add 1 to all members of vector x c ( 48, 56, 79 ) #this will not be stored anywhere but is printed on console. X = c ( 1, 3, 4, 7 ) #assign vector to a variable name.