Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Applying row height to all rows including and after row 7
Post: RE: Applying row height to all rows including and ...

Never mind. I can do this with a variety of approaches. The issue is that the file I am trying to set the row height on has something in it keeping the code from working right. It works fine on other ...
curranjohn46 General Coding Help 2 6,497 Oct-14-2019, 03:10 PM
    Thread: Applying row height to all rows including and after row 7
Post: RE: Applying row height to all rows including and ...

I came up with this to to set the row height to 20. It will not start at row 7 though. It ignores that and sets row height for all the rows from row one to the max_row. Any idea where I am going wrong...
curranjohn46 General Coding Help 2 6,497 Oct-14-2019, 02:04 PM
    Thread: Applying row height to all rows including and after row 7
Post: Applying row height to all rows including and afte...

Using openpyxl, I cannot figure out how to apply a row height on an existing worksheet unless I do it one row at a time. This works for a single row: ws4.row_dimensions[14].height = 25But I want to s...
curranjohn46 General Coding Help 2 6,497 Oct-14-2019, 10:35 AM
    Thread: Need to copy column of cell values from one workbook to another with openpyxl
Post: RE: Need to copy column of cell values from one wo...

Figured out how to write the source data to a different starting row on destination sheet. I do not need to dump the values in to a list as I did above: row_offset=5 for rows in ws2.iter_rows(min_row...
curranjohn46 General Coding Help 3 11,084 Oct-12-2019, 10:57 PM
    Thread: Need to copy column of cell values from one workbook to another with openpyxl
Post: RE: Need to copy column of cell values from one wo...

Thanks I saw that article but it didn't use iter_rows and iter_cols, which I was determined to use. Anyway, I figured out this solution: for x, rows in enumerate(DateColumnA): ws3.cell(row=x+1,...
curranjohn46 General Coding Help 3 11,084 Oct-12-2019, 07:23 PM
    Thread: Need to copy column of cell values from one workbook to another with openpyxl
Post: Need to copy column of cell values from one workbo...

I am extracting data from one workbook's column and need to copy the data to another existing workbook. This is how I extract the data (works fine): wb2 = load_workbook('C:\\folder\\AllSitesOpen2.xl...
curranjohn46 General Coding Help 3 11,084 Oct-11-2019, 10:13 PM
    Thread: Trying to Pass date to pandas search from input prompt
Post: RE: Trying to Pass date to pandas search from inpu...

This is resolved. I had to remove the single quotes around TestedDateBegin as python, of course, interpreted that as a string and not a variable. Simple! data = df.loc[df[b]['emr_first_access_date']...
curranjohn46 Data Science 1 2,073 Oct-10-2019, 10:01 AM
    Thread: Need help passing date to pandas query
Post: RE: Need help passing date to pandas query

This is resolved. I had to remove the single quotes around TestedDateBegin as python, of course, interpreted that as a string and not a variable. Duh. So simple. data = df.loc[df[b]['emr_first_acce...
curranjohn46 Data Science 1 5,422 Oct-10-2019, 09:59 AM
    Thread: Need help passing date to pandas query
Post: Need help passing date to pandas query

How do I pass the output of this prompt to a pandas search by date in excel? import pandas as pd TestedDateBegin = pd.to_datetime(input('Input date in mm-dd-yyyy format: '))For example, if I input 2...
curranjohn46 Data Science 1 5,422 Oct-09-2019, 11:33 PM
    Thread: Trying to Pass date to pandas search from input prompt
Post: Trying to Pass date to pandas search from input pr...

Hi, I am trying to figure out how to pass a date inputted at a prompt by the user to pandas to search by date. I have both the search and the input prompt working separately but not together. I will...
curranjohn46 Data Science 1 2,073 Oct-09-2019, 09:06 PM
    Thread: wrap_text with openpyxl. How to use documentation to resolve deprecation warning?
Post: RE: wrap_text with openpyxl. How to use documentat...

I learned that I did not have the latest openpyxl version. pip install openpyxl installed 2.5. I upgraded it to 3.0. Now when I look at https://openpyxl.readthedocs.io/en/stable/index.html it makes mo...
curranjohn46 General Coding Help 4 14,221 Oct-09-2019, 01:04 PM
    Thread: wrap_text with openpyxl. How to use documentation to resolve deprecation warning?
Post: RE: wrap_text with openpyxl. How to use documentat...

Through sheer trial and error I got this to work. But I'd like to understand how I can approach without trial and error: from openpyxl import load_workbook from openpyxl.styles import Alignment HISo...
curranjohn46 General Coding Help 4 14,221 Oct-09-2019, 11:59 AM
    Thread: wrap_text with openpyxl. How to use documentation to resolve deprecation warning?
Post: wrap_text with openpyxl. How to use documentation ...

Hi All, I run the following openpyxl command to wrap text in all rows after row 9. It works fine but throws a deprecation warning. I'd love to figure out how to use documentation such as https://open...
curranjohn46 General Coding Help 4 14,221 Oct-09-2019, 11:08 AM
    Thread: coloring cells in a row with openpyxl
Post: RE: coloring cells in a row with openpyxl

That worked. Thank you so much!
curranjohn46 General Coding Help 3 7,022 Oct-08-2019, 11:46 AM
    Thread: coloring cells in a row with openpyxl
Post: replacing numeric value with number from list

I have a list: [10, 18, 529, 657] I want to loop through the above list and replace XX in the first line below with 10 then 18 then 529 and 657 : for rows in ws2.iter_rows(min_row=XX, max_row=XX, m...
curranjohn46 General Coding Help 3 7,022 Oct-08-2019, 10:15 AM
    Thread: coloring cells in a row with openpyxl
Post: coloring cells in a row with openpyxl

Hi All, I am struggling with something and looking everywhere for a clue. The scenario is this: I am searching column 2 of a spreadsheet for a value in a list called subid. See code below. cells_i...
curranjohn46 General Coding Help 3 7,022 Oct-07-2019, 11:03 PM
    Thread: Trying to color an excel row based on list
Post: Trying to color an excel row based on list

Hi, The code below uses openpyxl and iterates through all rows and columns in a spreadsheet searching for a value in a list called subID. It then colors each cell it finds with that value light blue....
curranjohn46 General Coding Help 2 6,480 Oct-04-2019, 10:30 PM
    Thread: Trying to search excel for a value in row then format row
Post: RE: Trying to search excel for a value in row then...

I am familiar with stack exchange. I look everywhere for examples. I can specify a column and/or row and format it, color it. That is no issue. My challenge is this: once I iterate through all the ...
curranjohn46 General Coding Help 5 13,333 Oct-04-2019, 02:23 PM
    Thread: Trying to search excel for a value in row then format row
Post: RE: Trying to search excel for a value in row then...

Another mental hurdle I am trying to get past. The code below will color the individual cell blue if the value is found in column B. But I am trying to figure out how to color the entire row. I have ...
curranjohn46 General Coding Help 5 13,333 Oct-04-2019, 12:31 PM
    Thread: Trying to search excel for a value in row then format row
Post: RE: Trying to search excel for a value in row then...

Thanks Tim. Makes total sense now. And it worked of course. Appreciate it!!
curranjohn46 General Coding Help 5 13,333 Oct-04-2019, 11:12 AM

User Panel Messages

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