Talk:List of South American countries by population

Reversion
As I mentioned to you on the template talk page,, 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)
 * 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)
 * As I said in the template talk page, I couldn't fix it, . 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)
 * 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)
 * 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)
 * There, fixed and updated to the latest UN figures. Guarapiranga (talk) 23:19, 30 November 2019 (UTC)

Using Lua to get the data
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).

A few comments of differences and issues: If you think this is a good idea, this could be made into a more flexible module. Any thoughts?  Jts1882 &#124; talk 08:17, 9 December 2019 (UTC)
 * 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.
 * This is excellent,, 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)
 * 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 &#124; talk 09:31, 9 December 2019 (UTC)
 * 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="…" | cell 1 || style="…" | cell 2 || … Guarapiranga (talk) 21:48, 9 December 2019 (UTC)

Update
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 &#124; talk 16:52, 10 December 2019 (UTC)


 * I've added a piechart function.


 * 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 &#124; talk 08:13, 14 December 2019 (UTC)
 * 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)
 * 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 &#124; talk 11:53, 7 June 2020 (UTC)
 * 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)

Remove numbering for French Guiana and Falkland Islands?
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)
 * I've added handling for a norank parameter, e.g. FLK,GUF by Module:Country population.
 * This adds the class  which suppresses the display of rank and increment for the automatic row numbering using static row numbers and  . This new class can be used in any table using static row numbers.  —  Jts1882 &#124; talk 09:07, 3 September 2021 (UTC)


 * Awesome, that's great that there's already a parameter for that. Thanks! Cstanford.math (talk) 00:05, 4 September 2021 (UTC)

Complete update
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)