Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 3 characters in body
Source Link
Taku
  • 34.1k
  • 12
  • 79
  • 88
under__list =[[74, 0.1423287845938018, None, None, 10,  1.9099604642265018, 0.5185563065935468, 1.6825659992347914,  3.547506695574544, 2.7789822726693023, 20051, 0, 25, None, ' >50K'],  [44, 0.9181229773462783, None, None, 14, 0.17973300970873787,  0.1644822006472492, 0.13940129449838187, 1.1252427184466018,  0.4357200647249191, 0, 0, 40, None, ' <=50K']] 

I have the above list but I want to add the elements together but skip past the None and the ">=50" elements.

I want to be able to do it even if I don't know where None number values are. Any suggestions would be very welcome. Thanks for looking.?

for item in zip(under__list[row]): under__list.append(int(sum(item[0]))) 

Looking for the below out_putoutput:

[1182, 25.2452245, None, None, 9212, 256, 2624, 25.24,  2532, 25, 2005252, 52, 25632, None, ' >50K'] 

It would be one list with numbers added together.

under__list =[[74, 0.1423287845938018, None, None, 10, 1.9099604642265018, 0.5185563065935468, 1.6825659992347914, 3.547506695574544, 2.7789822726693023, 20051, 0, 25, None, ' >50K'], [44, 0.9181229773462783, None, None, 14, 0.17973300970873787, 0.1644822006472492, 0.13940129449838187, 1.1252427184466018, 0.4357200647249191, 0, 0, 40, None, ' <=50K']] 

I have the above list but I want to add the elements together but skip past the None and the ">=50" elements.

I want to be able to do it even if I don't know where None number values are. Any suggestions would be very welcome. Thanks for looking.

for item in zip(under__list[row]): under__list.append(int(sum(item[0]))) 

Looking for the below out_put:

[1182, 25.2452245, None, None, 9212, 256, 2624, 25.24, 2532, 25, 2005252, 52, 25632, None, ' >50K'] 

It would be one list with numbers added together.

under__list =[[74, 0.1423287845938018, None, None, 10,  1.9099604642265018, 0.5185563065935468, 1.6825659992347914,  3.547506695574544, 2.7789822726693023, 20051, 0, 25, None, ' >50K'],  [44, 0.9181229773462783, None, None, 14, 0.17973300970873787,  0.1644822006472492, 0.13940129449838187, 1.1252427184466018,  0.4357200647249191, 0, 0, 40, None, ' <=50K']] 

I have the above list but I want to add the elements together but skip past the None and the ">=50" elements.

I want to be able to do it even if I don't know where None number values are. Any suggestions?

for item in zip(under__list[row]): under__list.append(int(sum(item[0]))) 

Looking for the below output:

[1182, 25.2452245, None, None, 9212, 256, 2624, 25.24,  2532, 25, 2005252, 52, 25632, None, ' >50K'] 

It would be one list with numbers added together.

added 24 characters in body
Source Link
Derek MC
  • 376
  • 2
  • 6
  • 25
under__list =[[74, 0.1423287845938018, None, None, 10, 1.9099604642265018, 0.5185563065935468, 1.6825659992347914, 3.547506695574544, 2.7789822726693023, 20051, 0, 25, None, ' >50K'], [44, 0.9181229773462783, None, None, 14, 0.17973300970873787, 0.1644822006472492, 0.13940129449838187, 1.1252427184466018, 0.4357200647249191, 0, 0, 40, None, ' <=50K']] 

I have the above list but I want to add the elements together but skip past the None and the ">=50" elements.

I want to be able to do it even if I don't know where None number values are. Any suggestions would be very welcome. Thanks for looking.

for item in zip(under__list[row]): under__list.append(int(sum(item[0]))) 

Looking for the below out_put:

[1182, 25.2452245, None, None, 9212, 256, 2624, 25.24, 2532, 25, 2005252, 52, 25632, None, ' >50K'] 

It would be one list with numbers addadded together.

under__list =[[74, 0.1423287845938018, None, None, 10, 1.9099604642265018, 0.5185563065935468, 1.6825659992347914, 3.547506695574544, 2.7789822726693023, 20051, 0, 25, None, ' >50K'], [44, 0.9181229773462783, None, None, 14, 0.17973300970873787, 0.1644822006472492, 0.13940129449838187, 1.1252427184466018, 0.4357200647249191, 0, 0, 40, None, ' <=50K']] 

I have the above list but I want to add the elements together but skip past the None and the ">=50" elements.

I want to be able to do it even if I don't know where None number values are. Any suggestions would be very welcome. Thanks for looking.

for item in zip(under__list[row]): under__list.append(int(sum(item[0]))) 

out_put:

[1182, 25.2452245, None, None, 9212, 256, 2624, 25.24, 2532, 25, 2005252, 52, 25632, None, ' >50K'] 

It would be one list with numbers add together.

under__list =[[74, 0.1423287845938018, None, None, 10, 1.9099604642265018, 0.5185563065935468, 1.6825659992347914, 3.547506695574544, 2.7789822726693023, 20051, 0, 25, None, ' >50K'], [44, 0.9181229773462783, None, None, 14, 0.17973300970873787, 0.1644822006472492, 0.13940129449838187, 1.1252427184466018, 0.4357200647249191, 0, 0, 40, None, ' <=50K']] 

I have the above list but I want to add the elements together but skip past the None and the ">=50" elements.

I want to be able to do it even if I don't know where None number values are. Any suggestions would be very welcome. Thanks for looking.

for item in zip(under__list[row]): under__list.append(int(sum(item[0]))) 

Looking for the below out_put:

[1182, 25.2452245, None, None, 9212, 256, 2624, 25.24, 2532, 25, 2005252, 52, 25632, None, ' >50K'] 

It would be one list with numbers added together.

Add a comma into the first sublist and the last list. Fix indentation. Add syntax
Source Link
under__list =[[74, 0.1423287845938018, None, None, 10, 1.9099604642265018, 0.5185563065935468, 1.6825659992347914, 3.547506695574544, 2.7789822726693023, 20051, 0, 25, None'None, ' >50K'], [44, 0.9181229773462783, None, None, 14, 0.17973300970873787, 0.1644822006472492, 0.13940129449838187, 1.1252427184466018, 0.4357200647249191, 0, 0, 40, None, ' <=50K']] 

I have the above list but I want to add the elements together but skip past the "None"None and the ">=50"">=50" elements.

I want to be able to do it even if I don't know where noneNone number values are. Any suggestions would be very welcome. Thanks for looking.

for item in zip(under__list[row]):   under__list.append(int(sum(item[0]))) 

out_put:

[1182, 25.2452245, None, None, 9212, 256, 2624, 25.24, 2532, 25, 2005252, 52, 25632, None'None, ' >50K'] 

It would be one list with numbers add together.

under__list =[[74, 0.1423287845938018, None, None, 10, 1.9099604642265018, 0.5185563065935468, 1.6825659992347914, 3.547506695574544, 2.7789822726693023, 20051, 0, 25, None' >50K'], [44, 0.9181229773462783, None, None, 14, 0.17973300970873787, 0.1644822006472492, 0.13940129449838187, 1.1252427184466018, 0.4357200647249191, 0, 0, 40, None, ' <=50K']] 

I have the above list but I want to add the elements together but skip past the "None" and the ">=50" elements.

I want to be able to do it even if I don't know where none number values are. Any suggestions would be very welcome. Thanks for looking.

for item in zip(under__list[row]):   under__list.append(int(sum(item[0]))) 

out_put:

[1182, 25.2452245, None, None, 9212, 256, 2624, 25.24, 2532, 25, 2005252, 52, 25632, None' >50K'] 

It would be one list with numbers add together.

under__list =[[74, 0.1423287845938018, None, None, 10, 1.9099604642265018, 0.5185563065935468, 1.6825659992347914, 3.547506695574544, 2.7789822726693023, 20051, 0, 25, None, ' >50K'], [44, 0.9181229773462783, None, None, 14, 0.17973300970873787, 0.1644822006472492, 0.13940129449838187, 1.1252427184466018, 0.4357200647249191, 0, 0, 40, None, ' <=50K']] 

I have the above list but I want to add the elements together but skip past the None and the ">=50" elements.

I want to be able to do it even if I don't know where None number values are. Any suggestions would be very welcome. Thanks for looking.

for item in zip(under__list[row]): under__list.append(int(sum(item[0]))) 

out_put:

[1182, 25.2452245, None, None, 9212, 256, 2624, 25.24, 2532, 25, 2005252, 52, 25632, None, ' >50K'] 

It would be one list with numbers add together.

added 171 characters in body
Source Link
Derek MC
  • 376
  • 2
  • 6
  • 25
Loading
added 4 characters in body
Source Link
Anshul Goyal
  • 78k
  • 42
  • 162
  • 196
Loading
Source Link
Derek MC
  • 376
  • 2
  • 6
  • 25
Loading