[{"data":1,"prerenderedAt":1141},["ShallowReactive",2],{"doc:\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-specific-columns-from-excel-with-pandas":3,"surround:\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-specific-columns-from-excel-with-pandas":1133},{"id":4,"title":5,"body":6,"description":1124,"extension":1125,"meta":1126,"navigation":116,"path":1127,"seo":1128,"stem":1131,"__hash__":1132},"docs\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-specific-columns-from-excel-with-pandas\u002Findex.md","Read Specific Columns From Excel With Pandas",{"type":7,"value":8,"toc":1110},"minimark",[9,38,43,50,78,82,88,324,328,331,394,398,405,463,467,482,601,604,608,615,743,747,759,873,885,889,902,906,1002,1017,1021,1035,1048,1060,1070,1074,1084,1088,1106],[10,11,12,16,17,20,21,26,27,29,30,33,34,37],"p",{},[13,14,15],"code",{},"pandas.read_excel()"," loads every column on a sheet by default, which wastes memory and time when you only need four columns out of forty. The fix is the ",[13,18,19],{},"usecols"," parameter: it tells pandas to materialize a subset and skip the rest. This guide is part of ",[22,23,25],"a",{"href":24},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002F","Reading Excel Files with Pandas",", and it covers all four forms ",[13,28,19],{}," accepts — a list of names, a list of indices, an Excel-letter range, and a callable — plus how to combine the selection with ",[13,31,32],{},"sheet_name"," and ",[13,35,36],{},"dtype",". Every snippet writes its own sample workbook so you can paste and run it.",[39,40,42],"h2",{"id":41},"prerequisites","Prerequisites",[10,44,45,46,49],{},"Install pandas and the ",[13,47,48],{},".xlsx"," engine:",[51,52,57],"pre",{"className":53,"code":54,"language":55,"meta":56,"style":56},"language-bash shiki shiki-themes github-light github-dark","pip install pandas openpyxl\n","bash","",[13,58,59],{"__ignoreMap":56},[60,61,64,68,72,75],"span",{"class":62,"line":63},"line",1,[60,65,67],{"class":66},"sScJk","pip",[60,69,71],{"class":70},"sZZnC"," install",[60,73,74],{"class":70}," pandas",[60,76,77],{"class":70}," openpyxl\n",[39,79,81],{"id":80},"create-a-sample-workbook","Create a sample workbook",[10,83,84,85,87],{},"Each example below reads this file. It has more columns than any one read needs, which is exactly when ",[13,86,19],{}," earns its keep:",[51,89,93],{"className":90,"code":91,"language":92,"meta":56,"style":56},"language-python shiki shiki-themes github-light github-dark","import pandas as pd\n\nsample = pd.DataFrame({\n    \"Order_ID\": [1001, 1002, 1003],\n    \"SKU\": [\"A-100\", \"B-200\", \"C-300\"],\n    \"Quantity\": [3, 1, 5],\n    \"Unit_Price\": [19.99, 49.50, 8.75],\n    \"Region\": [\"North\", \"South\", \"West\"],\n    \"Notes\": [\"rush\", \"\", \"backorder\"],\n})\nsample.to_excel(\"orders.xlsx\", sheet_name=\"Raw\", index=False)\nprint(\"wrote orders.xlsx\")\n","python",[13,94,95,111,118,130,157,180,203,226,249,272,278,310],{"__ignoreMap":56},[60,96,97,101,105,108],{"class":62,"line":63},[60,98,100],{"class":99},"szBVR","import",[60,102,104],{"class":103},"sVt8B"," pandas ",[60,106,107],{"class":99},"as",[60,109,110],{"class":103}," pd\n",[60,112,114],{"class":62,"line":113},2,[60,115,117],{"emptyLinePlaceholder":116},true,"\n",[60,119,121,124,127],{"class":62,"line":120},3,[60,122,123],{"class":103},"sample ",[60,125,126],{"class":99},"=",[60,128,129],{"class":103}," pd.DataFrame({\n",[60,131,133,136,139,143,146,149,151,154],{"class":62,"line":132},4,[60,134,135],{"class":70},"    \"Order_ID\"",[60,137,138],{"class":103},": [",[60,140,142],{"class":141},"sj4cs","1001",[60,144,145],{"class":103},", ",[60,147,148],{"class":141},"1002",[60,150,145],{"class":103},[60,152,153],{"class":141},"1003",[60,155,156],{"class":103},"],\n",[60,158,160,163,165,168,170,173,175,178],{"class":62,"line":159},5,[60,161,162],{"class":70},"    \"SKU\"",[60,164,138],{"class":103},[60,166,167],{"class":70},"\"A-100\"",[60,169,145],{"class":103},[60,171,172],{"class":70},"\"B-200\"",[60,174,145],{"class":103},[60,176,177],{"class":70},"\"C-300\"",[60,179,156],{"class":103},[60,181,183,186,188,191,193,196,198,201],{"class":62,"line":182},6,[60,184,185],{"class":70},"    \"Quantity\"",[60,187,138],{"class":103},[60,189,190],{"class":141},"3",[60,192,145],{"class":103},[60,194,195],{"class":141},"1",[60,197,145],{"class":103},[60,199,200],{"class":141},"5",[60,202,156],{"class":103},[60,204,206,209,211,214,216,219,221,224],{"class":62,"line":205},7,[60,207,208],{"class":70},"    \"Unit_Price\"",[60,210,138],{"class":103},[60,212,213],{"class":141},"19.99",[60,215,145],{"class":103},[60,217,218],{"class":141},"49.50",[60,220,145],{"class":103},[60,222,223],{"class":141},"8.75",[60,225,156],{"class":103},[60,227,229,232,234,237,239,242,244,247],{"class":62,"line":228},8,[60,230,231],{"class":70},"    \"Region\"",[60,233,138],{"class":103},[60,235,236],{"class":70},"\"North\"",[60,238,145],{"class":103},[60,240,241],{"class":70},"\"South\"",[60,243,145],{"class":103},[60,245,246],{"class":70},"\"West\"",[60,248,156],{"class":103},[60,250,252,255,257,260,262,265,267,270],{"class":62,"line":251},9,[60,253,254],{"class":70},"    \"Notes\"",[60,256,138],{"class":103},[60,258,259],{"class":70},"\"rush\"",[60,261,145],{"class":103},[60,263,264],{"class":70},"\"\"",[60,266,145],{"class":103},[60,268,269],{"class":70},"\"backorder\"",[60,271,156],{"class":103},[60,273,275],{"class":62,"line":274},10,[60,276,277],{"class":103},"})\n",[60,279,281,284,287,289,292,294,297,299,302,304,307],{"class":62,"line":280},11,[60,282,283],{"class":103},"sample.to_excel(",[60,285,286],{"class":70},"\"orders.xlsx\"",[60,288,145],{"class":103},[60,290,32],{"class":291},"s4XuR",[60,293,126],{"class":99},[60,295,296],{"class":70},"\"Raw\"",[60,298,145],{"class":103},[60,300,301],{"class":291},"index",[60,303,126],{"class":99},[60,305,306],{"class":141},"False",[60,308,309],{"class":103},")\n",[60,311,313,316,319,322],{"class":62,"line":312},12,[60,314,315],{"class":141},"print",[60,317,318],{"class":103},"(",[60,320,321],{"class":70},"\"wrote orders.xlsx\"",[60,323,309],{"class":103},[39,325,327],{"id":326},"select-columns-by-name","Select columns by name",[10,329,330],{},"Pass a list of header names. The names must match the header row exactly — same casing, no leading or trailing spaces. Order in your list does not matter; pandas returns columns in their on-sheet order:",[51,332,334],{"className":90,"code":333,"language":92,"meta":56,"style":56},"import pandas as pd\n\ndf = pd.read_excel(\"orders.xlsx\", usecols=[\"SKU\", \"Quantity\", \"Unit_Price\"])\nprint(df.head())\n",[13,335,336,346,350,387],{"__ignoreMap":56},[60,337,338,340,342,344],{"class":62,"line":63},[60,339,100],{"class":99},[60,341,104],{"class":103},[60,343,107],{"class":99},[60,345,110],{"class":103},[60,347,348],{"class":62,"line":113},[60,349,117],{"emptyLinePlaceholder":116},[60,351,352,355,357,360,362,364,366,368,371,374,376,379,381,384],{"class":62,"line":120},[60,353,354],{"class":103},"df ",[60,356,126],{"class":99},[60,358,359],{"class":103}," pd.read_excel(",[60,361,286],{"class":70},[60,363,145],{"class":103},[60,365,19],{"class":291},[60,367,126],{"class":99},[60,369,370],{"class":103},"[",[60,372,373],{"class":70},"\"SKU\"",[60,375,145],{"class":103},[60,377,378],{"class":70},"\"Quantity\"",[60,380,145],{"class":103},[60,382,383],{"class":70},"\"Unit_Price\"",[60,385,386],{"class":103},"])\n",[60,388,389,391],{"class":62,"line":132},[60,390,315],{"class":141},[60,392,393],{"class":103},"(df.head())\n",[39,395,397],{"id":396},"select-columns-by-integer-index","Select columns by integer index",[10,399,400,401,404],{},"When headers are unreliable or absent, select by zero-based position instead. ",[13,402,403],{},"[0, 2, 3]"," reads the first, third, and fourth columns:",[51,406,408],{"className":90,"code":407,"language":92,"meta":56,"style":56},"import pandas as pd\n\ndf = pd.read_excel(\"orders.xlsx\", usecols=[0, 2, 3])\nprint(df.columns.tolist())\n",[13,409,410,420,424,456],{"__ignoreMap":56},[60,411,412,414,416,418],{"class":62,"line":63},[60,413,100],{"class":99},[60,415,104],{"class":103},[60,417,107],{"class":99},[60,419,110],{"class":103},[60,421,422],{"class":62,"line":113},[60,423,117],{"emptyLinePlaceholder":116},[60,425,426,428,430,432,434,436,438,440,442,445,447,450,452,454],{"class":62,"line":120},[60,427,354],{"class":103},[60,429,126],{"class":99},[60,431,359],{"class":103},[60,433,286],{"class":70},[60,435,145],{"class":103},[60,437,19],{"class":291},[60,439,126],{"class":99},[60,441,370],{"class":103},[60,443,444],{"class":141},"0",[60,446,145],{"class":103},[60,448,449],{"class":141},"2",[60,451,145],{"class":103},[60,453,190],{"class":141},[60,455,386],{"class":103},[60,457,458,460],{"class":62,"line":132},[60,459,315],{"class":141},[60,461,462],{"class":103},"(df.columns.tolist())\n",[39,464,466],{"id":465},"select-columns-by-excel-letter-range","Select columns by Excel letter range",[10,468,469,471,472,145,475,145,478,481],{},[13,470,19],{}," accepts a string of Excel column letters — the same ",[13,473,474],{},"A",[13,476,477],{},"B",[13,479,480],{},"C"," you see in the spreadsheet UI. Use a colon for a contiguous range, commas for individual columns, or mix both:",[51,483,485],{"className":90,"code":484,"language":92,"meta":56,"style":56},"import pandas as pd\n\ncontiguous = pd.read_excel(\"orders.xlsx\", usecols=\"A:C\")        # A, B, C\nsparse = pd.read_excel(\"orders.xlsx\", usecols=\"A,C,E\")          # A, C, E\nmixed = pd.read_excel(\"orders.xlsx\", usecols=\"A:C,E\")           # A, B, C, E\nprint(contiguous.columns.tolist())\nprint(sparse.columns.tolist())\nprint(mixed.columns.tolist())\n",[13,486,487,497,501,528,554,580,587,594],{"__ignoreMap":56},[60,488,489,491,493,495],{"class":62,"line":63},[60,490,100],{"class":99},[60,492,104],{"class":103},[60,494,107],{"class":99},[60,496,110],{"class":103},[60,498,499],{"class":62,"line":113},[60,500,117],{"emptyLinePlaceholder":116},[60,502,503,506,508,510,512,514,516,518,521,524],{"class":62,"line":120},[60,504,505],{"class":103},"contiguous ",[60,507,126],{"class":99},[60,509,359],{"class":103},[60,511,286],{"class":70},[60,513,145],{"class":103},[60,515,19],{"class":291},[60,517,126],{"class":99},[60,519,520],{"class":70},"\"A:C\"",[60,522,523],{"class":103},")        ",[60,525,527],{"class":526},"sJ8bj","# A, B, C\n",[60,529,530,533,535,537,539,541,543,545,548,551],{"class":62,"line":132},[60,531,532],{"class":103},"sparse ",[60,534,126],{"class":99},[60,536,359],{"class":103},[60,538,286],{"class":70},[60,540,145],{"class":103},[60,542,19],{"class":291},[60,544,126],{"class":99},[60,546,547],{"class":70},"\"A,C,E\"",[60,549,550],{"class":103},")          ",[60,552,553],{"class":526},"# A, C, E\n",[60,555,556,559,561,563,565,567,569,571,574,577],{"class":62,"line":159},[60,557,558],{"class":103},"mixed ",[60,560,126],{"class":99},[60,562,359],{"class":103},[60,564,286],{"class":70},[60,566,145],{"class":103},[60,568,19],{"class":291},[60,570,126],{"class":99},[60,572,573],{"class":70},"\"A:C,E\"",[60,575,576],{"class":103},")           ",[60,578,579],{"class":526},"# A, B, C, E\n",[60,581,582,584],{"class":62,"line":182},[60,583,315],{"class":141},[60,585,586],{"class":103},"(contiguous.columns.tolist())\n",[60,588,589,591],{"class":62,"line":205},[60,590,315],{"class":141},[60,592,593],{"class":103},"(sparse.columns.tolist())\n",[60,595,596,598],{"class":62,"line":228},[60,597,315],{"class":141},[60,599,600],{"class":103},"(mixed.columns.tolist())\n",[10,602,603],{},"The letters map to physical spreadsheet positions, so they ignore the header names entirely — handy when an export shuffles column titles but keeps the layout stable.",[39,605,607],{"id":606},"select-columns-with-a-callable","Select columns with a callable",[10,609,610,611,614],{},"Pass a function and pandas calls it once per column name, keeping the column when it returns ",[13,612,613],{},"True",". This is the right tool for pattern-based selection — every column starting with a prefix, or every name except a blocklist:",[51,616,618],{"className":90,"code":617,"language":92,"meta":56,"style":56},"import pandas as pd\n\n# Keep every column except free-text \"Notes\"\ndf = pd.read_excel(\"orders.xlsx\", usecols=lambda name: name != \"Notes\")\nprint(df.columns.tolist())\n\n# Keep only price-like columns\nprices = pd.read_excel(\n    \"orders.xlsx\",\n    usecols=lambda name: \"Price\" in name or name == \"Quantity\",\n)\nprint(prices.columns.tolist())\n",[13,619,620,630,634,639,667,673,677,682,692,700,732,736],{"__ignoreMap":56},[60,621,622,624,626,628],{"class":62,"line":63},[60,623,100],{"class":99},[60,625,104],{"class":103},[60,627,107],{"class":99},[60,629,110],{"class":103},[60,631,632],{"class":62,"line":113},[60,633,117],{"emptyLinePlaceholder":116},[60,635,636],{"class":62,"line":120},[60,637,638],{"class":526},"# Keep every column except free-text \"Notes\"\n",[60,640,641,643,645,647,649,651,653,656,659,662,665],{"class":62,"line":132},[60,642,354],{"class":103},[60,644,126],{"class":99},[60,646,359],{"class":103},[60,648,286],{"class":70},[60,650,145],{"class":103},[60,652,19],{"class":291},[60,654,655],{"class":99},"=lambda",[60,657,658],{"class":103}," name: name ",[60,660,661],{"class":99},"!=",[60,663,664],{"class":70}," \"Notes\"",[60,666,309],{"class":103},[60,668,669,671],{"class":62,"line":159},[60,670,315],{"class":141},[60,672,462],{"class":103},[60,674,675],{"class":62,"line":182},[60,676,117],{"emptyLinePlaceholder":116},[60,678,679],{"class":62,"line":205},[60,680,681],{"class":526},"# Keep only price-like columns\n",[60,683,684,687,689],{"class":62,"line":228},[60,685,686],{"class":103},"prices ",[60,688,126],{"class":99},[60,690,691],{"class":103}," pd.read_excel(\n",[60,693,694,697],{"class":62,"line":251},[60,695,696],{"class":70},"    \"orders.xlsx\"",[60,698,699],{"class":103},",\n",[60,701,702,705,707,710,713,716,719,722,724,727,730],{"class":62,"line":274},[60,703,704],{"class":291},"    usecols",[60,706,655],{"class":99},[60,708,709],{"class":103}," name: ",[60,711,712],{"class":70},"\"Price\"",[60,714,715],{"class":99}," in",[60,717,718],{"class":103}," name ",[60,720,721],{"class":99},"or",[60,723,718],{"class":103},[60,725,726],{"class":99},"==",[60,728,729],{"class":70}," \"Quantity\"",[60,731,699],{"class":103},[60,733,734],{"class":62,"line":280},[60,735,309],{"class":103},[60,737,738,740],{"class":62,"line":312},[60,739,315],{"class":141},[60,741,742],{"class":103},"(prices.columns.tolist())\n",[39,744,746],{"id":745},"combine-usecols-with-sheet_name-and-dtype","Combine usecols with sheet_name and dtype",[10,748,749,751,752,755,756,758],{},[13,750,19],{}," composes with the rest of ",[13,753,754],{},"read_excel",". Target a tab with ",[13,757,32],{},", then pin the types of the columns you kept so downstream math doesn't break when Excel stores a number as text:",[51,760,762],{"className":90,"code":761,"language":92,"meta":56,"style":56},"import pandas as pd\n\ndf = pd.read_excel(\n    \"orders.xlsx\",\n    sheet_name=\"Raw\",\n    usecols=[\"Order_ID\", \"Quantity\", \"Unit_Price\"],\n    dtype={\"Order_ID\": \"int64\", \"Quantity\": \"int64\", \"Unit_Price\": \"float64\"},\n)\nprint(df.dtypes)\n",[13,763,764,774,778,786,792,803,824,862,866],{"__ignoreMap":56},[60,765,766,768,770,772],{"class":62,"line":63},[60,767,100],{"class":99},[60,769,104],{"class":103},[60,771,107],{"class":99},[60,773,110],{"class":103},[60,775,776],{"class":62,"line":113},[60,777,117],{"emptyLinePlaceholder":116},[60,779,780,782,784],{"class":62,"line":120},[60,781,354],{"class":103},[60,783,126],{"class":99},[60,785,691],{"class":103},[60,787,788,790],{"class":62,"line":132},[60,789,696],{"class":70},[60,791,699],{"class":103},[60,793,794,797,799,801],{"class":62,"line":159},[60,795,796],{"class":291},"    sheet_name",[60,798,126],{"class":99},[60,800,296],{"class":70},[60,802,699],{"class":103},[60,804,805,807,809,811,814,816,818,820,822],{"class":62,"line":182},[60,806,704],{"class":291},[60,808,126],{"class":99},[60,810,370],{"class":103},[60,812,813],{"class":70},"\"Order_ID\"",[60,815,145],{"class":103},[60,817,378],{"class":70},[60,819,145],{"class":103},[60,821,383],{"class":70},[60,823,156],{"class":103},[60,825,826,829,831,834,836,839,842,844,846,848,850,852,854,856,859],{"class":62,"line":205},[60,827,828],{"class":291},"    dtype",[60,830,126],{"class":99},[60,832,833],{"class":103},"{",[60,835,813],{"class":70},[60,837,838],{"class":103},": ",[60,840,841],{"class":70},"\"int64\"",[60,843,145],{"class":103},[60,845,378],{"class":70},[60,847,838],{"class":103},[60,849,841],{"class":70},[60,851,145],{"class":103},[60,853,383],{"class":70},[60,855,838],{"class":103},[60,857,858],{"class":70},"\"float64\"",[60,860,861],{"class":103},"},\n",[60,863,864],{"class":62,"line":228},[60,865,309],{"class":103},[60,867,868,870],{"class":62,"line":251},[60,869,315],{"class":141},[60,871,872],{"class":103},"(df.dtypes)\n",[10,874,875,876,878,879,881,882,884],{},"The keys in ",[13,877,36],{}," only need to cover columns that survive ",[13,880,19],{},"; a ",[13,883,36],{}," entry for a dropped column is silently ignored.",[39,886,888],{"id":887},"why-usecols-saves-memory-on-wide-files","Why usecols saves memory on wide files",[10,890,891,893,894,897,898,901],{},[13,892,754],{}," builds the full DataFrame in RAM. On a sheet with hundreds of columns, restricting to the handful you actually use cuts both the parse work and the resident memory roughly in proportion to the columns dropped. There is no ",[13,895,896],{},"chunksize"," for Excel, so column pruning is one of the few levers you have to keep a wide-file read inside a memory budget. Pair it with ",[13,899,900],{},"nrows"," when you only need a sample.",[39,903,905],{"id":904},"common-pitfalls","Common pitfalls",[907,908,909,925],"table",{},[910,911,912],"thead",{},[913,914,915,919,922],"tr",{},[916,917,918],"th",{},"Symptom",[916,920,921],{},"Cause",[916,923,924],{},"Fix",[926,927,928,946,965,984],"tbody",{},[913,929,930,936,939],{},[931,932,933],"td",{},[13,934,935],{},"ValueError: Usecols do not match columns",[931,937,938],{},"A name in the list isn't an exact header match (case or whitespace differs)",[931,940,941,942,945],{},"Print ",[13,943,944],{},"pd.read_excel(path, nrows=0).columns.tolist()"," and copy the exact spelling",[913,947,948,951,954],{},[931,949,950],{},"Empty or wrong columns returned",[931,952,953],{},"Mixed names and indices in one list",[931,955,956,957,961,962,964],{},"Use ",[958,959,960],"em",{},"either"," all names ",[958,963,721],{}," all indices — never both in the same list",[913,966,967,970,973],{},[931,968,969],{},"Selection is off by one column",[931,971,972],{},"Header sits below metadata rows, shifting positions",[931,974,975,976,979,980,983],{},"Apply ",[13,977,978],{},"skiprows","\u002F",[13,981,982],{},"header"," first so indices and letters align to the real header",[913,985,986,991,996],{},[931,987,988,990],{},[13,989,36],{}," cast has no effect",[931,992,993,994],{},"The targeted column was dropped by ",[13,995,19],{},[931,997,998,999,1001],{},"Make sure the column is in your ",[13,1000,19],{}," list before pinning its type",[10,1003,1004,1005,1008,1009,1012,1013,1016],{},"A subtle one: a list mixing names and indices (",[13,1006,1007],{},"[\"SKU\", 2]",") raises a ",[13,1010,1011],{},"ValueError",". The string form (",[13,1014,1015],{},"\"A,C\"",") and the callable are the only ways to express \"these specific columns\" without committing to a single key style.",[39,1018,1020],{"id":1019},"frequently-asked-questions","Frequently asked questions",[10,1022,1023,1030,1031,1034],{},[1024,1025,1026,1027,1029],"strong",{},"Does ",[13,1028,19],{}," order control the DataFrame column order?","\nNo. Whether you pass names, indices, or letters, pandas returns the selected columns in their original on-sheet order. Reorder afterward with ",[13,1032,1033],{},"df = df[[\"Unit_Price\", \"SKU\"]]",".",[10,1036,1037,1043,1044,1047],{},[1024,1038,1039,1040,1042],{},"Can I use ",[13,1041,19],{}," with no header row?","\nYes — pass ",[13,1045,1046],{},"header=None"," and select by index list or letter range. Name-based selection needs a header to match against.",[10,1049,1050,1059],{},[1024,1051,1052,1053,33,1055,1058],{},"What's the difference between ",[13,1054,520],{},[13,1056,1057],{},"[0, 1, 2]","?","\nThey select the same physical columns. The letter range mirrors the spreadsheet UI and reads naturally; the index list is easier to build programmatically from a computed set of positions.",[10,1061,1062,1065,1066,1069],{},[1024,1063,1064],{},"Why does my callable receive names I didn't expect?","\nThe callable receives the parsed header values, including any auto-generated ",[13,1067,1068],{},"Unnamed: N"," labels for blank header cells. Guard against those in your predicate.",[39,1071,1073],{"id":1072},"conclusion","Conclusion",[10,1075,1076,1078,1079,33,1081,1083],{},[13,1077,19],{}," has four interchangeable forms — names, indices, an Excel-letter string, and a callable — and the right one depends on what's stable in your file. Names read clearest when headers are reliable; letters and indices survive header churn; the callable handles pattern-based selection. All four compose with ",[13,1080,32],{},[13,1082,36],{},", so you can target a tab, prune columns, and pin types in a single call while keeping wide-file reads inside a memory budget.",[39,1085,1087],{"id":1086},"where-to-go-next","Where to go next",[10,1089,1090,1091,1093,1094,1096,1097,1101,1102,1034],{},"For the end-to-end reading workflow, return to ",[22,1092,25],{"href":24},". To see ",[13,1095,19],{}," in the context of sheet targeting, header realignment, and dtypes, read ",[22,1098,1100],{"href":1099},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fhow-to-read-excel-with-pandas-step-by-step\u002F","How to Read Excel Files With Pandas: A Step-by-Step Guide",". When you're ready to write results back out, see ",[22,1103,1105],{"href":1104},"\u002Fgetting-started-with-python-excel-automation\u002Fwriting-dataframes-to-excel-with-pandas\u002Fwrite-pandas-dataframe-to-excel-without-index\u002F","Write a Pandas DataFrame to Excel Without the Index",[1107,1108,1109],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":56,"searchDepth":113,"depth":113,"links":1111},[1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123],{"id":41,"depth":113,"text":42},{"id":80,"depth":113,"text":81},{"id":326,"depth":113,"text":327},{"id":396,"depth":113,"text":397},{"id":465,"depth":113,"text":466},{"id":606,"depth":113,"text":607},{"id":745,"depth":113,"text":746},{"id":887,"depth":113,"text":888},{"id":904,"depth":113,"text":905},{"id":1019,"depth":113,"text":1020},{"id":1072,"depth":113,"text":1073},{"id":1086,"depth":113,"text":1087},"Use read_excel usecols to load only the columns you need by name, index, Excel-letter range, or callable — combine it with sheet_name and dtype to save memory.","md",{},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-specific-columns-from-excel-with-pandas",{"title":1129,"description":1130},"Read Specific Columns from Excel with Pandas","Select Excel columns in pandas with usecols: pass a name list, index list, an 'A:C' letter range, or a callable predicate, and pair it with dtype on wide files.","getting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-specific-columns-from-excel-with-pandas\u002Findex","ccibpzBLtZn8-THVPA5UJVxSeCFJctGF5PTpynN3QdE",[1134,1137],{"title":1100,"path":1135,"stem":1136,"children":-1},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fhow-to-read-excel-with-pandas-step-by-step","getting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fhow-to-read-excel-with-pandas-step-by-step\u002Findex",{"title":1138,"path":1139,"stem":1140,"children":-1},"Using openpyxl for Excel File Manipulation","\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation","getting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Findex",1781773160715]