WEBVTT 00:00.660 --> 00:07.530 Now in this kitchen at a stroke about how to abate and add new columns and Euros before doing anything 00:07.530 --> 00:08.390 like that. 00:08.400 --> 00:11.310 Remember how we add a new element in type that list. 00:11.650 --> 00:14.250 I remember how we add new element inside. 00:14.260 --> 00:18.690 Additionally also remember how we add new element in our data stream. 00:18.750 --> 00:24.180 With the help of traditionally so what we used to do is we dig the heading and then passed in a matter 00:24.180 --> 00:25.170 of values. 00:25.170 --> 00:29.670 That is a key value pair saying we have to follow to add a new column. 00:29.700 --> 00:35.460 So the first thing that we need to do is just take our data frame and then use a square to brackets 00:35.460 --> 00:37.590 it and then give the column name. 00:38.310 --> 00:41.160 So I had my column name will be status. 00:41.160 --> 00:44.430 Now with this column I need to provide 10 values. 00:44.430 --> 00:50.430 Suppose you have a new column head and then you will have 10 values for this particular column. 00:50.580 --> 00:54.910 But what if I only tried to pass two values and then execute this program. 00:56.390 --> 01:03.500 You can see I got an error and had the error is value error that does length of values does not match 01:03.720 --> 01:05.330 lint off index. 01:05.420 --> 01:10.420 So I have to provide 10 values to match my column and index. 01:10.700 --> 01:12.410 So let me Boston values it 01:15.800 --> 01:17.680 Hey you can see the outer band values. 01:17.680 --> 01:19.380 Let me execute this one. 01:20.190 --> 01:26.970 Once that is executed let me bring might be if one hey you can see highlighted on new column you can 01:26.970 --> 01:32.850 see I have actually passed a single value for 10 times instead of that I have used a single element 01:33.120 --> 01:36.780 and then multiplied by ten times that would be quite easier. 01:41.090 --> 01:43.730 Here you can see highlighted on new column. 01:43.730 --> 01:45.700 Also we got our new shipment out. 01:46.280 --> 01:52.070 So if I try to print my India off one not cheap it would turn out to Bollywood to lose the first one 01:52.070 --> 01:59.930 is lentil our index and the second one is off our column so I can use my ship and headache I can result 01:59.960 --> 02:10.310 for my position Zito so that would be 10 and I can actually use this one and pass here and execute this 02:10.310 --> 02:13.850 one. 02:13.970 --> 02:16.270 You can sit still give me the same result. 02:16.430 --> 02:22.880 So that would work absolutely fine if you can use our shape method and then utilize the force value 02:22.880 --> 02:26.020 of double that is size of index. 02:26.120 --> 02:29.510 I can also play with these values and add an element with them. 02:29.700 --> 02:34.820 So if I want to update I would be doing something similar that I would do the list and if I want to 02:34.820 --> 02:37.750 update my day let me take my data frame. 02:37.850 --> 02:41.910 So with my day I just want to add some name on variable. 02:42.020 --> 02:49.500 After my due stay after my Wednesday let me try to implement that say hey remember I'm updating and 02:49.500 --> 02:58.060 I'm taking my previous value and then adding a new string along with that. 02:58.210 --> 02:59.570 You can see the result. 02:59.650 --> 03:00.970 Now I have my day. 03:01.180 --> 03:03.200 And then a string added to that. 03:03.640 --> 03:06.790 So that's all I can actually update my previous value. 03:06.790 --> 03:09.270 And I can also add new value with them. 03:09.340 --> 03:13.390 You can actually remove the date and you can do so then more things. 03:13.540 --> 03:19.270 And if you want to do specifically for a particular value that means select with the index position 03:19.330 --> 03:26.520 of column and rows and then passed a new value that you won't do a bit that would work fine. 03:26.530 --> 03:31.180 Now how do we have talked about adding new column and updating all column. 03:31.210 --> 03:37.660 The second thing I want to talk about adding new rules so there is no defined method of how to add a 03:37.660 --> 03:38.590 neutral. 03:38.590 --> 03:42.310 The simplest way we can do is we can use traveler's method. 03:42.430 --> 03:47.350 So take a simple example traversing our particular example right now. 03:47.440 --> 03:50.650 So that means this will be done in two rows. 03:50.710 --> 03:55.600 And this would be done in book columns and then we'll be adding new column to that. 03:55.870 --> 04:02.740 So we will be adding column number 10 and then traversing back that means up column would become rows 04:02.740 --> 04:04.410 and rows will become column. 04:04.420 --> 04:08.600 That means we'll be getting our orders are back with a neutral. 04:08.620 --> 04:13.310 So what we have done is we have clear data frame we can order a new rule. 04:13.450 --> 04:18.660 So what we did is we travelers that added a new column and draw us back. 04:19.000 --> 04:23.630 So our new column added would be working as neutral. 04:23.710 --> 04:28.990 I think that might sound confusing but let us do that before doing that. 04:29.140 --> 04:34.090 Before doing that let me clean this up and start with my traffic dot CSP. 04:34.120 --> 04:35.470 So this is our data frame. 04:35.530 --> 04:38.640 I want to add a neutral or less then. 04:38.920 --> 04:44.260 So the first thing I need to do is I need to traverse our current data frame so everything I would be 04:44.260 --> 04:46.410 doing is inside my DFT. 04:46.420 --> 04:52.940 That is my data frame second and I would be storing my travels straight up 3 am 1 04:55.990 --> 05:00.040 so this will be the hazard I have in columns at this point of time. 05:00.370 --> 05:05.660 And these will be our rules that as did visitors be our country. 05:05.860 --> 05:09.280 Clicks and they notice again simply step. 05:09.320 --> 05:10.600 Just start a new column 05:13.520 --> 05:18.030 and remember ahead I need to pass six values the first value will be dead. 05:18.230 --> 05:19.860 So that would be 11. 05:19.900 --> 05:28.320 The second value will be my visit to the third value will be my be on the fourth value will be my country 05:29.760 --> 05:36.390 fifth to leaving my clicks and then will remind me once that is done. 05:36.400 --> 05:38.370 Just execute this one. 05:38.560 --> 05:41.860 Let me print by new reserved. 05:41.890 --> 05:44.020 You can see I have added a new column. 05:44.060 --> 05:44.400 No. 05:44.400 --> 05:49.590 All I have to do is just dollars this back and store that into my data from one. 05:50.110 --> 05:56.340 So all I have to do is just overwrite my data from one and stored the Davos reserve of my data stream 05:56.350 --> 06:03.220 to and if I execute this one you can see that's done. 06:04.490 --> 06:08.420 So you can see this is the simplest and the easiest way to earn a new. 06:08.840 --> 06:12.900 And also you can try to spend method to update a few values of a row. 06:13.100 --> 06:17.460 So you have to browse through all the changes to our spec. 06:17.470 --> 06:18.710 That's the simplest way. 06:19.220 --> 06:20.800 So that's all for this lecture. 06:20.840 --> 06:25.590 I hope you understand about finals as well as ship download work. 06:25.850 --> 06:26.870 Thank you for watching. 06:26.870 --> 06:28.710 See you in the next 1.