Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
fString Nested forLoop
#8
(Oct-13-2018, 09:55 AM)pcsailor Wrote: ok, maybe I'm looking at this wrong.
I'm sorry if this is so basic. I feel pretty dumb right now >:

I thought with the f-string I would only have this code:
rows = range(1, 10)
columns = range(1, 5)
wb.active.cell(row, col).value = f'row:{row}, column:{col}'

You can process tables as a whole in pandas/numpy - though building initial values may still require either looping or comprehension (comprehension being a looping in not so deceiving disguise)
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
fString Nested forLoop - by pcsailor - Oct-13-2018, 05:57 AM
RE: fString Nested forLoop - by buran - Oct-13-2018, 06:25 AM
RE: fString Nested forLoop - by pcsailor - Oct-13-2018, 08:09 AM
RE: fString Nested forLoop - by buran - Oct-13-2018, 08:50 AM
RE: fString Nested forLoop - by pcsailor - Oct-13-2018, 09:45 AM
RE: fString Nested forLoop - by volcano63 - Oct-13-2018, 09:51 AM
RE: fString Nested forLoop - by pcsailor - Oct-13-2018, 09:55 AM
RE: fString Nested forLoop - by volcano63 - Oct-13-2018, 12:10 PM

Forum Jump:

User Panel Messages

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