Python Forum
[solved] list of list with one or more empty one
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] list of list with one or more empty one
#3
Quote:Why not using a loop?
I'm using a list comprehension so far, and in a list of more than a million of components, performance falls of about 25% Cry ; it looks like:

Mprime = [[0] if n == [] else n for n in M]
Let me trying itertools

Paul
Reply


Messages In This Thread
RE: list of list with one or more empty one - by paul18fr - May-24-2023, 06:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [Solved] How to refer to dataframe column name based on a list lorensa74 1 2,388 May-17-2021, 07:02 AM
Last Post: lorensa74
  convert a list of string+bytes into a list of strings (python 3) pacscaloupsu 4 11,032 Mar-17-2020, 07:21 AM
Last Post: markfilan
  search for a part of strinf from list in another list ! evilcode1 3 3,292 Oct-29-2018, 12:07 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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