SlideShare une entreprise Scribd logo
1  sur  11
R Functions in Dataframe
Dim()
Nrow()
Ncol()
Str()
Summary()
Names()
Head()
Tail()
Edit()
• dim(): shows the dimensions of the data frame by
row and column
• str(): shows the structure of the data frame
• summary(): provides summary statistics on the
columns of the data frame
• colnames(): shows the name of each column in the
data frame
• head(): shows the first 6 rows of the data frame
• tail(): shows the last 6 rows of the data frame
• View(): shows a spreadsheet-like display of the
entire data frame
• dim(crime)
• str(crime)
• summary(crime)
• colnames(crime)
• ### The head() and tail() functions default to 6 rows, but
we can adjust the number of rows using the "n = "
argument
• head(crime, n = 10)
• tail(crime, n = 5)
• ### While the first 6 functions are printed to the console,
the View() function opens a table in another window
• View(crime)
• nrow(Employee)
• ncol(Employee)
• str(Employee)
• rk<-data.frame(Employee)
• rk
• str(rk)
• summary(rk)
• names(rk)
• head(rk,n=3)
• head(Employee,n=-2)
• tail(rk,n=3)
• tail(rk,n=-3)
• edit(Employee)
• Employee[1:3,]
• Employee[1:3,1:2]
• rk[1:10,]
• Subset(Employee,slary>25000)
Merge, join, concatenate and compare
• pandas provides various facilities for easily
combining together Series or DataFrame with
various kinds of set logic for the indexes and
relational algebra functionality in the case of
join / merge-type operations.
• In addition, pandas also provides utilities to
compare two Series or DataFrame and
summarize their differences.
• Concatenating objects
• The concat() function (in the main pandas
namespace) does all of the heavy lifting of
performing concatenation operations along an
axis while performing optional set logic (union
or intersection) of the indexes (if any) on the
other axes.
• Note that I say “if any” because there is only a
single possible axis of concatenation for Series.
• df1 = data.frame
• (A: ["A0", "A1", "A2", "A3"],
• B: ["B0", "B1", "B2", "B3"],
• C: ["C0", "C1", "C2", "C3"], "D": ["D0", "D1", "D2", "D3"], index=[0, 1,
2, 3], )
• df2 = pd.DataFrame({"A": ["A4", "A5", "A6", "A7"],
• "B": ["B4", "B5", "B6", "B7"],
• "C": ["C4", "C5", "C6", "C7"],
• "D": ["D4", "D5", "D6", "D7"], }, index=[4, 5, 6, 7], )
• df3 = pd.DataFrame({
• "A": ["A8", "A9", "A10", "A11"],
• "B": ["B8", "B9", "B10", "B11"],
• "C": ["C8", "C9", "C10", "C11"],
• "D": ["D8", "D9", "D10", "D11"], }, index=[8, 9, 10, 11], )
• frames = [df1, df2, df3]
• result = pd.concat(frames)
• Merge(x=df1,y=df2,z=df3)
Read from a table
• A data table can reside in a text file, the cells
inside the tables are separatedby blank
characters
• Rk<-read.table(“”)
Exploring Data
• Data in R is a set of organised information. Statistical
data type is more common in R, Which is set of
observations where values for the variables are passed.
• These input variables are ised in measuring , controlling
or manipulating the results of a program
• Integer
• Numeric
• Logical
• Character/String
• Factor
• Complex
Exploring Data Analysis
• EDA involves dataset analysis to summarise the main
characteristics in the form of visual representations.
• EDA using R is an approach used to summarise and visualise
the main characteristics of a data set
Which differs from initial data analysis.
1. Exploring data by inderstanding its structure and varialbles
2. Developing an intuition about the dataset
3. Considering how the dataset came to existance
4. Deciding how to investigate by providing a formal
statistical method
5. Extending better in sighting
6. Handling any missing value
7. Investigate with more formal statistical methods.
• Some of the graphical techniques used in EDA is
• Box Plot
• Histograms
• Scatter plot
• Run chart
• Bar chart
• Density plots
• Pareto chart

Contenu connexe

Similaire à R Functions in Dataframe.pptx

Python Cheat Sheet 2.0.pdf
Python Cheat Sheet 2.0.pdfPython Cheat Sheet 2.0.pdf
Python Cheat Sheet 2.0.pdf
Rahul Jain
 
R Programming.pptx
R Programming.pptxR Programming.pptx
R Programming.pptx
kalai75
 

Similaire à R Functions in Dataframe.pptx (20)

Chapter3_Visualizations2.pdf
Chapter3_Visualizations2.pdfChapter3_Visualizations2.pdf
Chapter3_Visualizations2.pdf
 
Python Cheat Sheet 2.0.pdf
Python Cheat Sheet 2.0.pdfPython Cheat Sheet 2.0.pdf
Python Cheat Sheet 2.0.pdf
 
R Programming.pptx
R Programming.pptxR Programming.pptx
R Programming.pptx
 
R_CheatSheet.pdf
R_CheatSheet.pdfR_CheatSheet.pdf
R_CheatSheet.pdf
 
ppanda.pptx
ppanda.pptxppanda.pptx
ppanda.pptx
 
CS.3.Arrays.pdf
CS.3.Arrays.pdfCS.3.Arrays.pdf
CS.3.Arrays.pdf
 
Project matlab group one,dzaklo courage kwasi
Project matlab group one,dzaklo courage kwasiProject matlab group one,dzaklo courage kwasi
Project matlab group one,dzaklo courage kwasi
 
PPT on Data Science Using Python
PPT on Data Science Using PythonPPT on Data Science Using Python
PPT on Data Science Using Python
 
Data Exploration in R.pptx
Data Exploration in R.pptxData Exploration in R.pptx
Data Exploration in R.pptx
 
Lecture 9.pptx
Lecture 9.pptxLecture 9.pptx
Lecture 9.pptx
 
R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In R
 
Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandas
 
Data import-cheatsheet
Data import-cheatsheetData import-cheatsheet
Data import-cheatsheet
 
2 pandasbasic
2 pandasbasic2 pandasbasic
2 pandasbasic
 
Introduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordIntroduction to Data Science With R Lab Record
Introduction to Data Science With R Lab Record
 
Getting started with Pandas Cheatsheet.pdf
Getting started with Pandas Cheatsheet.pdfGetting started with Pandas Cheatsheet.pdf
Getting started with Pandas Cheatsheet.pdf
 
pandas dataframe notes.pdf
pandas dataframe notes.pdfpandas dataframe notes.pdf
pandas dataframe notes.pdf
 
Pandas pythonfordatascience
Pandas pythonfordatasciencePandas pythonfordatascience
Pandas pythonfordatascience
 
interenship.pptx
interenship.pptxinterenship.pptx
interenship.pptx
 

Plus de Ramakrishna Reddy Bijjam

Plus de Ramakrishna Reddy Bijjam (20)

Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Arrays to arrays and pointers with arrays.pptx
Arrays to arrays and pointers with arrays.pptxArrays to arrays and pointers with arrays.pptx
Arrays to arrays and pointers with arrays.pptx
 
Auxiliary, Cache and Virtual memory.pptx
Auxiliary, Cache and Virtual memory.pptxAuxiliary, Cache and Virtual memory.pptx
Auxiliary, Cache and Virtual memory.pptx
 
Python With MongoDB in advanced Python.pptx
Python With MongoDB in advanced Python.pptxPython With MongoDB in advanced Python.pptx
Python With MongoDB in advanced Python.pptx
 
Pointers and single &multi dimentionalarrays.pptx
Pointers and single &multi dimentionalarrays.pptxPointers and single &multi dimentionalarrays.pptx
Pointers and single &multi dimentionalarrays.pptx
 
Certinity Factor and Dempster-shafer theory .pptx
Certinity Factor and Dempster-shafer theory .pptxCertinity Factor and Dempster-shafer theory .pptx
Certinity Factor and Dempster-shafer theory .pptx
 
Auxiliary Memory in computer Architecture.pptx
Auxiliary Memory in computer Architecture.pptxAuxiliary Memory in computer Architecture.pptx
Auxiliary Memory in computer Architecture.pptx
 
Random Forest Decision Tree.pptx
Random Forest Decision Tree.pptxRandom Forest Decision Tree.pptx
Random Forest Decision Tree.pptx
 
K Means Clustering in ML.pptx
K Means Clustering in ML.pptxK Means Clustering in ML.pptx
K Means Clustering in ML.pptx
 
Pandas.pptx
Pandas.pptxPandas.pptx
Pandas.pptx
 
Python With MongoDB.pptx
Python With MongoDB.pptxPython With MongoDB.pptx
Python With MongoDB.pptx
 
Python with MySql.pptx
Python with MySql.pptxPython with MySql.pptx
Python with MySql.pptx
 
PYTHON PROGRAMMING NOTES RKREDDY.pdf
PYTHON PROGRAMMING NOTES RKREDDY.pdfPYTHON PROGRAMMING NOTES RKREDDY.pdf
PYTHON PROGRAMMING NOTES RKREDDY.pdf
 
BInary file Operations.pptx
BInary file Operations.pptxBInary file Operations.pptx
BInary file Operations.pptx
 
Data Science in Python.pptx
Data Science in Python.pptxData Science in Python.pptx
Data Science in Python.pptx
 
CSV JSON and XML files in Python.pptx
CSV JSON and XML files in Python.pptxCSV JSON and XML files in Python.pptx
CSV JSON and XML files in Python.pptx
 
HTML files in python.pptx
HTML files in python.pptxHTML files in python.pptx
HTML files in python.pptx
 
Regular Expressions in Python.pptx
Regular Expressions in Python.pptxRegular Expressions in Python.pptx
Regular Expressions in Python.pptx
 
datareprersentation 1.pptx
datareprersentation 1.pptxdatareprersentation 1.pptx
datareprersentation 1.pptx
 
Apriori.pptx
Apriori.pptxApriori.pptx
Apriori.pptx
 

Dernier

Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
amitlee9823
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
JoseMangaJr1
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
MarinCaroMartnezBerg
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
ELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptxELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptx
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 

R Functions in Dataframe.pptx

  • 1. R Functions in Dataframe Dim() Nrow() Ncol() Str() Summary() Names() Head() Tail() Edit()
  • 2. • dim(): shows the dimensions of the data frame by row and column • str(): shows the structure of the data frame • summary(): provides summary statistics on the columns of the data frame • colnames(): shows the name of each column in the data frame • head(): shows the first 6 rows of the data frame • tail(): shows the last 6 rows of the data frame • View(): shows a spreadsheet-like display of the entire data frame
  • 3. • dim(crime) • str(crime) • summary(crime) • colnames(crime) • ### The head() and tail() functions default to 6 rows, but we can adjust the number of rows using the "n = " argument • head(crime, n = 10) • tail(crime, n = 5) • ### While the first 6 functions are printed to the console, the View() function opens a table in another window • View(crime)
  • 4. • nrow(Employee) • ncol(Employee) • str(Employee) • rk<-data.frame(Employee) • rk • str(rk) • summary(rk) • names(rk) • head(rk,n=3) • head(Employee,n=-2) • tail(rk,n=3) • tail(rk,n=-3) • edit(Employee) • Employee[1:3,] • Employee[1:3,1:2] • rk[1:10,] • Subset(Employee,slary>25000)
  • 5. Merge, join, concatenate and compare • pandas provides various facilities for easily combining together Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. • In addition, pandas also provides utilities to compare two Series or DataFrame and summarize their differences. • Concatenating objects
  • 6. • The concat() function (in the main pandas namespace) does all of the heavy lifting of performing concatenation operations along an axis while performing optional set logic (union or intersection) of the indexes (if any) on the other axes. • Note that I say “if any” because there is only a single possible axis of concatenation for Series.
  • 7. • df1 = data.frame • (A: ["A0", "A1", "A2", "A3"], • B: ["B0", "B1", "B2", "B3"], • C: ["C0", "C1", "C2", "C3"], "D": ["D0", "D1", "D2", "D3"], index=[0, 1, 2, 3], ) • df2 = pd.DataFrame({"A": ["A4", "A5", "A6", "A7"], • "B": ["B4", "B5", "B6", "B7"], • "C": ["C4", "C5", "C6", "C7"], • "D": ["D4", "D5", "D6", "D7"], }, index=[4, 5, 6, 7], ) • df3 = pd.DataFrame({ • "A": ["A8", "A9", "A10", "A11"], • "B": ["B8", "B9", "B10", "B11"], • "C": ["C8", "C9", "C10", "C11"], • "D": ["D8", "D9", "D10", "D11"], }, index=[8, 9, 10, 11], ) • frames = [df1, df2, df3] • result = pd.concat(frames) • Merge(x=df1,y=df2,z=df3)
  • 8. Read from a table • A data table can reside in a text file, the cells inside the tables are separatedby blank characters • Rk<-read.table(“”)
  • 9. Exploring Data • Data in R is a set of organised information. Statistical data type is more common in R, Which is set of observations where values for the variables are passed. • These input variables are ised in measuring , controlling or manipulating the results of a program • Integer • Numeric • Logical • Character/String • Factor • Complex
  • 10. Exploring Data Analysis • EDA involves dataset analysis to summarise the main characteristics in the form of visual representations. • EDA using R is an approach used to summarise and visualise the main characteristics of a data set Which differs from initial data analysis. 1. Exploring data by inderstanding its structure and varialbles 2. Developing an intuition about the dataset 3. Considering how the dataset came to existance 4. Deciding how to investigate by providing a formal statistical method 5. Extending better in sighting 6. Handling any missing value 7. Investigate with more formal statistical methods.
  • 11. • Some of the graphical techniques used in EDA is • Box Plot • Histograms • Scatter plot • Run chart • Bar chart • Density plots • Pareto chart