Python Forum
loop to regroup modality of a variable
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
loop to regroup modality of a variable
#1
Hello there,

I'm kind of new with Python and sometimes I'm lacking some basics.

Here I want to regroup some modalities like them :

For column langue_navigateur
Français 88262
NA 9723
Anglais 1607
Turc 171
Portugais 158
Espagnol 88
Russe 86
Italien 60
Roumain 47
Polonais 47
Allemand 30
Chinois 27
Arabe 23

I want to obtain a output like this :

Français 88262
NA 9723
Others : sum of the others modalities (1607 + 171 +.... + 23)

I think I need a if else statement but I couldn't find the right code to obtain this.

Could you help me ? :)

Thanks.
Reply


Messages In This Thread
loop to regroup modality of a variable - by LoliMarth - Mar-22-2019, 11:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Variable definitions inside loop / could be better? gugarciap 2 468 Jan-09-2024, 11:11 PM
Last Post: deanhystad
  How to create a variable only for use inside the scope of a while loop? Radical 10 1,836 Nov-07-2023, 09:49 AM
Last Post: buran
  Nested for loops - help with iterating a variable outside of the main loop dm222 4 1,621 Aug-17-2022, 10:17 PM
Last Post: deanhystad
  loop (create variable where name is dependent on another variable) brianhclo 1 1,160 Aug-05-2022, 07:46 AM
Last Post: bowlofred
  Multiple Loop Statements in a Variable Dexty 1 1,220 May-23-2022, 08:53 AM
Last Post: bowlofred
Big Grin Variable flag vs code outside of for loop?(Disregard) cubangt 2 1,198 Mar-16-2022, 08:54 PM
Last Post: cubangt
  How to save specific variable in for loop in to the database? ilknurg 1 1,166 Mar-09-2022, 10:32 PM
Last Post: cubangt
  How to add for loop values in variable paulo79 1 1,475 Mar-09-2022, 07:20 PM
Last Post: deanhystad
  Using Excel Cell As A Variable In A Loop knight2000 7 4,195 Aug-25-2021, 12:43 PM
Last Post: snippsat
  Using Excel Cell As A Variable In A Loop knight2000 7 5,071 Jul-18-2021, 10:52 AM
Last Post: knight2000

Forum Jump:

User Panel Messages

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