Python Forum
OpenPyxl: How to iterate through each Column (in 1 row) to find a value?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OpenPyxl: How to iterate through each Column (in 1 row) to find a value?
#3
Iterating through pandas dataFrame objects is generally slow. Pandas iteration beats the whole purpose of using DataFrame. It is an anti-pattern and is something you should only do when you have exhausted every other option. It is better look for a List Comprehensions , vectorized solution or DataFrame.apply() method.

Pandas DataFrame loop using list comprehension

result = [(x, y,z) for x, y,z in zip(df['Name'], df['Promoted'],df['Grade'])]
buran write Apr-06-2021, 06:03 AM:
URL removed.
Necroposting with sole purpose to promote your site via clickbite is unacceptable and will not be tolerated.
Reply


Messages In This Thread
RE: OpenPyxl: How to iterate through each Column (in 1 row) to find a value? - by carlhyde - Apr-06-2021, 04:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Find a string from a column of one table in another table visedwings049 8 1,316 Sep-07-2023, 03:22 PM
Last Post: deanhystad
  Openpyxl-change value of cells in column based on value that currently occupies cells phillipaj1391 5 10,177 Mar-30-2022, 11:05 PM
Last Post: Pedroski55
  Find last filled column in openpyxl Irv1n 2 13,187 Jan-16-2022, 11:05 AM
Last Post: Pedroski55
  pandas pivot table: How to find count for each group in Index and Column JaneTan 0 3,440 Oct-23-2021, 04:35 AM
Last Post: JaneTan
  How can I iterate through all cells in a column (with merge cells) with openpyxl? aquerci 1 7,616 Feb-11-2021, 09:31 PM
Last Post: nilamo
  Openpyxl tkinter search a value in Excel column Heathcliff_1 0 3,326 Dec-02-2020, 04:35 PM
Last Post: Heathcliff_1
  Python Openpyxl is unable to check from Column 6 onwards Skye 0 1,783 Oct-13-2020, 06:11 AM
Last Post: Skye
  Using OpenPyXL How To Read Entire Column Into Dictionary jo15765 1 2,754 Jun-08-2020, 04:10 AM
Last Post: buran
  Need to copy column of cell values from one workbook to another with openpyxl curranjohn46 3 11,412 Oct-12-2019, 10:57 PM
Last Post: curranjohn46
  Openpyxl -Coming up with a single column from a multi column data set Givan007 1 2,766 Sep-07-2018, 04:29 AM
Last Post: Prabakaran141

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020