00:00Hello everyone. In this video, we are going to talk about file reading in pandas part 1.
00:09So, how do you upload file, how do you read the data, how do you read the data,
00:12how do you read the specific rows and columns, how do you access the details in the video.
00:21First, how do you upload the file,
00:24Now, we have a notebook open in the same location,
00:29we can upload the option on the right side.
00:31So, if you click upload,
00:33you can connect directly to downloads.
00:36So, in the downloads, we download the data frame first.
00:39So, we will choose, let's say,
00:42we can upload the hard data set.
00:44So, click open,
00:46if you click upload,
00:48you can upload the same location,
00:50you can create a new notebook in the same location.
00:53So, in that path, you can upload the data set.
00:56So, in the same location,
00:57we can upload the data data.
01:00So, this is the upload method.
01:02Next, we will go to Titanic data set.
01:05So, in titanic.csv format.csv stands for
01:09comma separated values.
01:11And the data, we have to choose.
01:15So, there are actually 12 columns.
01:18Here we are in the data set.
01:23If you download the data content now,
01:25the file is using Excel icon,
01:29in Excel format.
01:31And this is CSV format.
01:33Excel and CSV are no difference,
01:35CSV is nothing.
01:37It means we support smaller data set,
01:39limited data type.
01:40But we have Excel's last dataset support and multiple data types.
01:45This is the end file difference.
01:48Now, the titanic.csv file is read.
01:52First, we import the library.
01:57Import pandas as .pd.
01:59Next, we use pandas to read the data file.
02:04Now, the extension is titanic.csv.
02:10So, in csv format, there is a method.pd.read.csv file.
02:17That is the end file name.
02:19Single quotes.
02:21This is the extension in Excel file.
02:26So, let's specify the file name.
02:30Followed by this method.
02:32Read underscore excel.
02:34We change.pd.read underscore excel of.
02:37This is the file name.
02:39This is the titanic dataset.
02:43In titanic dataset, there are 12 columns.
02:46The first column is the passenger ID.
02:48If the titanic incident happened,
02:51So, based on that data set, you can create.
02:54So, there is a number of passengers.
02:56There is a passenger ID in the first column.
02:58The second one is the survived column.
03:00They don't do that.
03:02So, the values are 0, 1.
03:040 is the dead.
03:061 is the survive.
03:08The passenger class is the first class,
03:11second class, third class.
03:13There are three categories.
03:14Then, the name.
03:15Then, the gender.
03:16Then, the age.
03:17Next, the seventh column is siblings.
03:20Siblings-spouse column.
03:22Siblings-spouse.
03:23Who also has a particular passenger?
03:26There is a siblings.
03:27There are two siblings.
03:28There are two siblings.
03:29There are two siblings.
03:30There are two siblings.
03:31There is one.
03:33Then, the parts.
03:36Parents-children column.
03:38Parents-children column.
03:40The category number of children.
03:42You can specify the number of children.
03:43This is the name.
03:45This is the 8th column.
03:47The next one.
03:48ticket number then fare
03:50fare when the amount of you spend is done
03:53then final
03:56we have two columns
03:57one is cabin
03:59cabin when the cabin is done
04:01what cabin is done
04:02one is done
04:04cabin is done
04:06flight is done
04:08P153
04:10specifically we will say
04:11cabin column
04:13so cabin column
04:15values are done
04:18C123
04:19C15
04:21that's the data set
04:23we show
04:25C148
04:30B42
04:30that's the last column
04:33we have embarked column
04:34so embarked
04:36what particular
04:38passenger
04:39Titanic ship
04:41so there are three classes
04:43S, C and Q
04:45Southampton
04:47Titanic
04:49ship
04:49boat
04:49boat
04:52boat
04:52that's the
04:53S, C and Q
04:56Q stands for
04:57Queenstown
04:58so this
04:59we have a
05:01data set
05:01represent
05:02values
05:02different
05:03and
05:04numeric
05:05and
05:06categorical
05:07data types
05:08all
05:08mix
05:09This is the data set line.
05:15Next, if you want the data frame in a specific column,
05:18how do you access it?
05:19Titanic of,
05:20if you want to specify the column name,
05:23we can use the indexing, slicing,
05:26square rat.
05:28If you want to specify the column name,
05:30we can provide the column name.
05:32So, Titanic of name,
05:34we can access the name column.
05:36This is name and gender.
05:38We can access the name and gender.
05:41We can create the name and gender.
05:43How do we access the table format?
05:46Here is the name,
05:48here is the gender.
05:50So, in the table format,
05:52this is two-dimensional.
05:54If we want to pass the two-dimensional format,
05:56we can pass the name,
05:58then we can pass the gender column.
06:00Now, name,
06:02gender column next.
06:04So,
06:06here is the name and gender.
06:09So,
06:10this is the name and gender column.
06:12So, I need name and gender column access. So, if you have more than two or three columns
06:19access to this, just use the final column to extract the mbug column. So, I need three columns
06:28access. So, we need specific more than two columns easy access. Next, we need specific names
06:37we need to use the names. We need to confirm here. We need to go to the 50th row and 60th row data.
06:44So, we need to access it. We need to use the filtering techniques.
06:50Now, we will see the next video.
06:57This is the file reading in pandas part 1. We will see the next video.
Comments