File tree 1 file changed +34
-0
lines changed
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -1354,3 +1354,37 @@ of the data values:
1354
1354
' weight' : [100 , 140 , 180 ],
1355
1355
' sex' : [' Male' , ' Female' ]})
1356
1356
df
1357
+
1358
+ Common Excel Operations
1359
+ -----------------------
1360
+
1361
+ Fill Handle
1362
+ ***********
1363
+
1364
+ Create a series of numbers in a DataFrame.
1365
+
1366
+ .. ipython :: python
1367
+
1368
+ df = pd.DataFrame({' AAA' : [1 ]* 8 , ' BBB' : list (range (0 ,8 ))}); df
1369
+
1370
+ # Fill numbers with difference 4 starting from 1
1371
+ # in rows 2 to 5 in column AAA.
1372
+
1373
+ df.iloc[2 :(5 + 1 )].AAA = [ x* 4 + 2 for x in range (0 , len (df.iloc[2 :(5 + 1 )])) ]
1374
+
1375
+ df
1376
+
1377
+ Filters
1378
+ *******
1379
+
1380
+ .. ipython :: python
1381
+
1382
+ # Filter by value 0 in column AAA
1383
+
1384
+ df[df.AAA == 0 ]
1385
+
1386
+ # Filter by multiple values
1387
+
1388
+ df[(df.AAA == 0 ) | (df.AAA == 2 )]
1389
+
1390
+
You can’t perform that action at this time.
0 commit comments