Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 取出一列多维数组并对其进行排序?_Python_Python 3.4 - Fatal编程技术网

Python 取出一列多维数组并对其进行排序?

Python 取出一列多维数组并对其进行排序?,python,python-3.4,Python,Python 3.4,我有一个大小合适的多DIMMENSOANL阵列: listPatients = [[ "Johnson", "Fred", "N", "2763 Filibuster Drive", "Lakeland", "FL", "37643", "Q", "05/27/1935", "164-55-0726", "N"]] \ + [[ "Williams", "Betty", "L", "701 Collage Avenue", "Orland

我有一个大小合适的多DIMMENSOANL阵列:

listPatients =   
[[  "Johnson",   "Fred", "N", "2763 Filibuster Drive",  "Lakeland", "FL", "37643", "Q", "05/27/1935", "164-55-0726", "N"]] \
+                
[[ "Williams",  "Betty", "L",    "701 Collage Avenue",   "Orlando", "FL", "31234", "F", "11/27/1971", "948-44-1038", "Y"]] \
+                
[[     "Ling", "Hector", "X",     "1500 Raceway Lane",     "Tampa", "FL", "32785", "M", "10/17/2003", "193-74-0274", "Y"]] \
+ 
[[    "Albin",   "Ross", "L",      "207 Daisy Avenue",  "Lakeland", "FL", "32643", "M", "12/08/1990", "458-57-2867", "N"]] \
+                
[[ "Anderson",  "Jason", "O",       "1527 Lewis Road",     "Tampa", "FL", "32785", "M", "11/25/1991", "093-50-1093", "Y"]] \
+                
[[     "Baca",  "Edwin", "L",       "25 Hunters Lane",  "Lakeland", "FL", "32643", "M", "10/30/1992", "159-56-9731", "Y"]] \
+                
[[   "Birner", "Dalton", "M",     "851 Applebe Court",   "Orlando", "FL", "31234", "M", "09/22/1993", "695-21-2340", "Y"]] \
+                
[["Dominguez", "Javier", "B",   "1410 Waterford Blvd",   "Orlando", "FL", "31234", "M", "08/04/1994", "753-66-6482", "N"]] \
+                
[[   "Aimino", "Nicolo", "S",      "2379 Runners Way",  "Lakeland", "FL", "32643", "M", "07/11/1995", "852-73-4196", "Y"]] \
+                
[["Armstrong","Addison", "T",    "46 Hawthorne Drive",  "Lakeland", "FL", "32643", "M", "06/18/1996", "648-81-1456", "Y"]] \
+                
[[    "Beard",    "Ian", "J",  "1814 Constitution Ct",   "Orlando", "FL", "31234", "M", "05/28/1997", "879-61-1829", "N"]] \
+                
[[ "Calderon",  "Yamil", "C",         "345 Cigar Row",     "Tampa", "FL", "32785", "M", "04/07/1998", "123-87-6431", "Y"]] \
+                
[[   "Carter", "Thomas", "P",       "896 Pine Avenue",     "Tampa", "FL", "32785", "M", "03/12/1999", "248-65-3197", "Y"]] \
+                
[[  "Chaname",  "Bryan", "D",    "24 Blue Belt Drive",  "Lakeland", "FL", "32643", "M", "02/23/2000", "741-85-9632", "Y"]] \
+                
[[   "Chaney", "Chaney", "Z",    "2589 College Court",   "Orlando", "FL", "31234", "M", "01/15/2001", "963-25-7418", "Y"]]
我需要做的是取出每个列表的第[7]个元素并同时打印出来。注意:我无法使用numPY。

请尝试:

for patient in listPatients:
    print patient[6]
或:


张贴不带+符号的实际列表。这是二维数组吗?问题的排序部分如何?您是否试图按第7列对数组的元素进行排序?行与行之间的
+
是什么?@deadcode我正在尝试推断每个列表的第7列
output = ""
for patient in listPatients:
    output += patient[6] + ", "
print output