Jump to content

Talk:List of South American countries by population

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia


Reversion

[edit]

As I mentioned to you on the template talk page, Jonesey95, this version you reverted to has far greater problems than a comma on the date. The population figures are completely off from current estimates and the calculated numbers totally divorced from them. Guarapiranga (talk) 06:27, 22 November 2019 (UTC)[reply]

The data in the current version of the article is sourced. The version as of 9 November 2019 is full of red error messages, a "Rank" column that is disconnected from the table (and makes no sense if the table is sorted), has year values with commas in them, and much more. This is a live encyclopedia that is shown to readers around the world. If there is a version of the article with accurate data that does not have these rendering errors, use that version. If you can fix the template, do so. – Jonesey95 (talk) 15:12, 22 November 2019 (UTC)[reply]
As I said in the template talk page, I couldn't fix it, Jonesey95. You said you can, so why didn't you?
The current data shown, not only is not sourced (calculated figures are divorced from population numbers with no audit trail, i.e. they're not verifiable), but also way out of date. The rank column is not disconnected from the table, it's fixed (as recommended at Help:Tables for tables with more than one sortable column). Guarapiranga (talk) 20:12, 22 November 2019 (UTC)[reply]
I played around in the template's sandbox for a bit, created a testcases page, and updated the template's documentation, but it would have taken me multiple hours to learn and re-learn the needed string manipulation templates. I am a volunteer, as are most of us here, and I prefer to spend my time on other tasks. As I said on the template's talk page, I was inclined to let you have the first crack at it. The testcases page should help you. Take one piece at a time. In the meantime, you can update this article if there are new sources; just please don't use buggy templates to do it. – Jonesey95 (talk) 20:36, 22 November 2019 (UTC)[reply]
Jonesey95 Guarapiranga The figures on the reversion are a little out of date, I will have a go updating it on the weekend. I think it is a bit of overkill to do a template in order to link it to a population clock; population doesn't change much within 6 to 12 months - the figures just need to be indicitive that you get a relative comparison between countries. Having one respected source for the entire page for these type of demographic and economic country lists (commonly CIA World Factbook, IMF, World Bank) I believe instills a lot more confidence to the reader than linking to seperate sources for every entry, with each country's statistical agency having different methodologies, varied competencies and update frequencies. Maranello10 (talk) 09:57, 28 November 2019 (UTC)[reply]
There, fixed and updated to the latest UN figures. Guarapiranga (talk) 23:19, 30 November 2019 (UTC)[reply]

Using Lua to get the data

[edit]

Following the discussion at the Village pump, I put together a prototype Lua function to generate a similar table, using the section markup in List of countries by population (United Nations).

{{#invoke:Country population|populations|ARG|BOL|BRA|COL|PER|VEN|XXX|CHL|ECU|PRY|URY|GUY|GUF|SUR|FLK}}
CountryProjected population
(19 December 2024)
Pct of
total
UN Population estimatesAnnual growthDoubling time
(years)
1 July 20231 July 2022IncrementRate
 Brazil212,372,84048.62%211,140,729210,306,415834,3140.40%175
 Colombia53,190,18112.18%52,321,15251,737,944583,2081.13%62
 Argentina45,730,85910.47%45,538,40145,407,904130,4970.29%242
 Peru34,397,0707.88%33,845,61733,475,438370,1791.11%63
 Venezuela28,430,4356.51%28,300,85428,213,01787,8370.31%223
 Chile19,815,3564.54%19,658,83519,553,036105,7990.54%128
 Ecuador18,212,1004.17%17,980,08317,823,897156,1860.88%79
 Bolivia12,493,7882.86%12,244,15912,077,154167,0051.38%50
 Paraguay6,969,0081.60%6,844,1466,760,46483,6821.24%56
 Uruguay3,383,9230.77%3,388,0813,390,913−2,832−0.08%−830
 Guyana833,3330.19%826,353821,6374,7160.57%121
 Suriname637,3900.15%628,886623,1645,7220.92%76
 French Guiana311,0490.07%303,402298,3065,0961.71%41
 Falkland Islands3,4580.00%3,4773,490−13−0.37%−186
Total436,780,791100%433,024,175430,492,7792,531,3960.58%118

A few comments of differences and issues:

  1. The preprocessor visited node count is only 1,164. This means much larger tables can be used.
  2. The data is sorted. This means if the projected population order changed, this is handled automatically.
  3. I added the two columns for the years with actual data. A proper module could make columns optional.
  4. The total is calculated from the country data.
  5. I still haven't solved the rounding after the maths calcualtions (projected population and doubling time). For some reason the zero precision rounding doesn't work in the function I use after these calculations, but does for the simpler percentage calculations. This is presumably fixable.
  6. The projected population numbers are different. This is because the time factor calculated using {{a.y}} is rounded to 1.4 rather than using higher precision.
  7. This function uses the section markup in the list article. Using data in a subpage is an alternative, that might be easier to update.

If you think this is a good idea, this could be made into a more flexible module. Any thoughts?   Jts1882 | talk  08:17, 9 December 2019 (UTC)[reply]

This is excellent, Jts1882, thank you. The only thing I'd like to suggest is using {{significant figures}} for the pcts, so Falkland Islands—or other similarly small entries in other tables—don't show up as zero.
Also, the projected population doesn't need to show decimals (I think).
And if you could go ahead and total the previous population column, so we can fill out the rest of the calculated cells, that'd be great.
For this case, putting the data in a subpage may indeed be the best compromise between flexibility and stability, but in others—typically those amalgamating data from various sources, e.g. national population statistics—it may be better to pulling the data via the markup, so common editors without knowledge of Lua can ensure it stays correct and current. Guarapiranga (talk) 08:33, 9 December 2019 (UTC)[reply]
This was just a first pass at something that works to show the principle. Now you've shown interest I will put it into a module and organise the code properly. I know there is an issue with the rounding and agree that significant figures is better, but these are details that must have solutions.
An example of a data subpage is this FIFA World Rankings one used for sports rankings tables. They are easily updated with the help of Excel. A module subpage could also hold population data for many years if desired. While there is something to be said for making the pages editable by anyone, the section markup makes it difficult to update. Data only needs to be updated occasionally, while page content describing and putting the data into context remains readily editably. You could argue that removing huge blocks of data tables makes it easier to edit the rest of the content.
I'm going to think about this a bit. Yesterday was just a bored rainy day activity. Please feel free to add any suggestions or ideas here.   Jts1882 | talk  09:31, 9 December 2019 (UTC)[reply]
As for markup, what I found is that it doesn't stand in the way of edits via VE; VE simply puts the cell contents first in the cell, so the beginning section markup needs to be put at the end of the formatting part of the cell, e.g.:
| style="…" <section begin=name1/> | cell 1 || <section end=name1/> style="…" <section begin=name2/> | cell 2 || <section end=name2/> …
Guarapiranga (talk) 21:48, 9 December 2019 (UTC)[reply]

Update

[edit]

I've created Module:Country population and the table above now uses the updated version. The only thing I haven't done is put significant figures on the % of total column. I'm looking for the best way of doing this. It's probably best if this is called from a template, which will need a few changes. Any thoughts on template name? Or should it just be an option for {{Country population}}?   Jts1882 | talk  16:52, 10 December 2019 (UTC)[reply]

I've added a piechart function.

South American population by country (top 10)

  Brazil (48.8%)
  Colombia (12.1%)
  Argentina (10.5%)
  Peru (7.8%)
  Venezuela (6.5%)
  Chile (4.5%)
  Ecuador (4.2%)
  Bolivia (2.8%)
  Paraguay (1.6%)
  Uruguay (0.8%)
  Other (0.4%)
{{#invoke:Country population|piechart|ARG|BOL|BRA|COL|PER|VEN|XXX|CHL|ECU|PRY|URY|GUY|GUF|SUR|FLK
|caption=South American population by country (top 10)
|slices=10
|other=yes}}
It is a wrapper for the {{Pie chart}} but automatically retrieves the data for the listed countries from the UN population article for the |label= and |value= parameters. The |slices= parameter determines the number of countries to show as slices, with the remainder going in other.   Jts1882 | talk  08:13, 14 December 2019 (UTC)[reply]
@Jts1882: Is the module ready for release? The article is broken and fixing it would be ugly. It relies on lots of code to extract numbers from named sections which complicates the wikitext. I believe the fundamental problem at the moment is that the total is calculated by an amazing template which adds up numbers from various named sections. However, that total is used to generate the pie chart, and adjusting the total section to include the total template does not work. Before the last edit, a hard-coded value for the total made the pie chart work, but there were then two total values (slightly disagreeing which each other!) and they were concatenated in the article. Johnuniq (talk) 09:49, 7 June 2020 (UTC)[reply]
@Johnuniq: I haven't done anything since the above comment; the discussion petered out. It looks like it is getting the numbers from the UN population page correctly and both table and piechart look OK. It would be best if someone else can double check the numbers, but the current state of the article is far from ideal. I think it's ready to fix this article, but if it is to be used more widely would need further work.
The thing I couldn't get to work properly was the static rank column. It is fine most of the time, but fails to align on some screen sizes and zooms, which is unsatisfactory. —  Jts1882 | talk  11:53, 7 June 2020 (UTC)[reply]
@Jts1882: Thanks, that's much better! One glitch is that you have a nice minus sign for Venezuala's increment, but just a hyphen for the negative percentage. If you fix that, please also remove the hidden comment in line 2 of the article which complains about the hyphen that occurred from the old wikitext. I gave the numbers a rough check and they seem good. I know very little about complex tables but I wouldn't think it was possible to have the static rank column always aligned. You could incorporate it into the table as was done before which would make it not static—that could be regarded as a feature? Anyway, it's working and is much cleaner. Johnuniq (talk) 04:09, 8 June 2020 (UTC)[reply]

Remove numbering for French Guiana and Falkland Islands?

[edit]

Can we remove the numbering for dependent territories, similar to what is done on the List of Oceanian countries by population and the List of European countries by population? Cstanford.math (talk) 20:05, 2 September 2021 (UTC)[reply]

I've added handling for a norank parameter, e.g. |norank=FLK,GUF by Module:Country population.
This adds the class static-row-numbers-norank which suppresses the display of rank and increment for the automatic row numbering using {{static row numbers}} and templatestyles. This new class can be used in any table using {{static row numbers}}. —  Jts1882 | talk  09:07, 3 September 2021 (UTC)[reply]
Awesome, that's great that there's already a parameter for that. Thanks! Cstanford.math (talk) 00:05, 4 September 2021 (UTC)[reply]

Complete update

[edit]

I have added official figures and dates with detailed sources, so that the article no longer relies on a single source. To make room, I removed the doubling time and absolute change columns. I also added a map and tweaked the pie chart and See also section. I made a column for notes but there are currently none. Wizmut (talk) 03:27, 28 June 2023 (UTC)[reply]