Python Pandas Tutorial | DataFrame and Series Basics - Selecting Rows and Columns

preview_player
Показать описание

In this Python Programming video, we will be learning about the DataFrame and Series objects. These are the backbone of Pandas and are fundamental to the library. DataFrames can be thought of as rows and columns, while a Series can be thought of as just a single column of rows. We'll also learn the basic navigation of these datatypes by learning how to select specific rows and columns. Let's get started...

#youtube #viral #viralvideo #youtubechannel #youtuber #data #pandas #youtubevideo

What Pandas DataFrame
How to manipulate data using pandas DataFrame
How to Locate Indexes of Pandas DataFrames
How to locate Named Indexes of Pandas

0:00
hello and welcome to this episode of
0:02
machine learning
0:04
at the end of this video you will be
0:05
able to learn about pandas and panda's
0:07
data frames and its application in
0:09
machine learning
0:11
but before we continue kindly like
0:13
subscribe and click the notification
0:15
bell to receive videos like this on your
0:18
devices
0:19
so what is a data frame
0:22
a pandas data frame is a two-dimensional
0:24
data structure like a two-dimensional
0:26
array or a table with rows and columns
0:30
for the sake of this tutorial illinois
0:32
will be using interactive python console
0:34
to demonstrate how pandas data frame
0:36
however you are at liberty to use the
0:38
code editor of your choice provided you
0:40
can write python codes in it
0:43
moving forward we can create a simple
0:45
pandas data frame by
0:47
1. importing the pandas library as pd
0:51
2 then create an object named data and
0:54
assign properties and values within
0:56
curly brackets as shown on the screen
0:59
the object data now contains two
1:01
properties that also contains list of
1:03
values
1:05
note that this list can be accessed via
1:07
indexing ie
1:09
the first item in a python list is
1:11
indexed to zero while the second item is
1:14
indexed with one
1:16
now we want to load the object data into
1:18
a data frame object so we'll place data
1:20
object now as an attribute of panda's
1:23
library data frame object using dot
1:25
notation
1:26
and dot b in python programming you can
1:29
actually access your object properties
1:31
by dot notation or bracket notation
1:35
now assign this to an object called df i
1:38
dot e data frame then print df
1:41
you can see a three by three table
1:43
showing the calories and duration
1:45
properties against the indices zero one
1:47
and two respectively showing the
1:49
position of those assigned values in
1:51
each property
1:52
role location
1:54
as you can see from the result above the
1:56
data frame is like a table with rows and
1:59
columns
2:00
pandas use the lock attribute to return
2:02
one or more specified rows
2:05
for example
2:07
let's refer to one of the first row
2:09
index from the data frame above
2:12
we say print df dot lock 0.
2:16
the result shows the first row
2:18
properties values of data object
2:20
respectively with the data type which is
2:22
integer
2:23
in the second example we reference ds
2:26
property values using a list of indexes
2:28
that is print df dot lock 0 1
2:33
you will observe that lock was used to
2:35
access the indexes the loc means locate
2:38
and a result also show a table
2:40
containing both the indexes and
2:41
properties
2:43
lastly we'll look at the named indexes
2:46
with the index argument you can name
2:48
your own indexes
2:50
named indexes
2:52
with the index argument you can name
2:54
your own indexes
2:57
import pandas as pd
2:59
data equals
3:01
calories
3:02
420 380 390
3:07
duration 50 40 45
3:11
df equals pd data frame data index
3:14
equals day 1 day 2 day 3. print df
3:20
here the previous indexes of 0 to 2 have
3:23
been replaced by day 1 day 2 and day 3
3:26
respectively from the data dictionary
3:29
you can apply this to your machine
3:30
learning practice and if there's any
3:32
question or comments kindly drop them in
3:35
the comment section and be sure to like
3:37
subscribe and turn on your notification
3:39
bell
3:40
thank you and see you in the next video
3:42
bye bye

also watch @programmingwithmosh @GreatStackDev @PythonGB @MontyPython @gilesmcmullen @patloeber
#pandas #DataFrames #iloc #loc #youtube #youtuber #youtubechannel #youtubevideo #viral #virals #viralvideo #viralvideos
Рекомендации по теме
join shbcf.ru