Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 2

R functions Python functions

1 class() type()
2 install.packages("PN") pip install PN
3 library(name) import pandas as pd
4 getwd() os.getcwd()
5 setwd() os.chdir("dir path")
6 read.csv("files name") pandas.read_csv("file name")
7 c(1,2,4) vectors [1,2,4] (list)
8 rownames(df) df.index
9 colnames(df) df.columns
10 dim(df) df.shape
11 length(df) len(df)
12 as.data.frame(df) pd.DataFrame(varible)
13 summary(df) df.describe()
14 str(df) df.info()
15 df[ , ] df.iloc[ , ]
Operation
Gives data type of the mentioned variable
install the package
load a package
to get the current working dir
Change/set the current Working dir
Reads a csv table

names of rows
col names
number of rows and col

To convert into data frame


summary
structure

You might also like