Python Forum
How to ignore empty columns from DB?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to ignore empty columns from DB?
#1
Hello,

As I read rows from a database and concatenate some columns into a string, some columns are empty.

What is the correct way to ignore those when building the string, and avoid having "None\n"?

for row in rows:
	#How to avoid eg. "Col3 stuff\nNone\nCol 5 stuff" ?
	bigstring = f'{row["col3"]}\n{row["col4"]}\n{row["col5"]}'
Thank you.
Reply


Messages In This Thread
How to ignore empty columns from DB? - by Winfried - May-15-2020, 07:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Good way to ignore case when searching elements? Winfried 1 226 Apr-25-2024, 12:39 PM
Last Post: menator01
  Ignore WakeWord after it's said Extra 2 1,227 Apr-01-2022, 12:32 AM
Last Post: Extra
  How to ignore "Retrying (Retry(total=2, connect=2, read=5, redirect=5, status=None))" const 3 2,778 Mar-26-2022, 08:55 AM
Last Post: ndc85430
  Ignore first few letters of a line when reading file. ShakeyPakey 16 6,578 May-30-2020, 02:17 PM
Last Post: BitPythoner
  How to make the script ignore down devices. wagnergt12 4 3,267 Apr-20-2020, 11:45 PM
Last Post: wagnergt12
  Regex ignore JohnnyCoffee 1 2,628 Mar-16-2020, 12:16 PM
Last Post: scidam
  Ignore Folder Evil_Patrick 3 3,769 Oct-29-2019, 07:44 AM
Last Post: Gribouillis
  How to ignore formulas when reading excel file SriMekala 3 6,577 Aug-16-2019, 04:04 PM
Last Post: buran
  How to ignore - ERROR: The system was unable to find the specified registry key or va asheru93 9 6,723 Feb-04-2019, 06:35 AM
Last Post: asheru93
  Ignore character in if statement Fizo 6 3,714 Sep-09-2018, 12:39 PM
Last Post: Fizo

Forum Jump:

User Panel Messages

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