Let's take a step back and look at the big picture.
We see a pyramid here.
This is the one I pulled in last video United States in 1990.
Let me pull a different one.
We pulled the United States in 1950 not 1990 1950 and here.
Here you see it's a kind of a healthy looking triangle.
It's like a triangle right.
You have really three overarching types of the population pyramid.
You have what's called the expansive which would be the one you're seeing here a nice triangle.
You'll have the symmetric stationary where bilious symmetric equilibrium.
You have as much on top as a bottom and you have the constrictive which has very few at the bottom and
a lot of the top.
What does that mean.
Well in this case an expensive means you have a lot more younger people than older people and that's
a healthy society because you'll have enough people to to not only join the workforce make money know
make the economy function but also have enough people to take care of these older people because you
have you know less of older people than young people in the opposite constricted society.
It's you know you don't you just don't have enough people to take care of the older people there not
enough people for the to enter the workforce.
You've got to think about palliative geriatric a lot of health care to take care of these these older
people.
It's an imbalance it's not a very healthy society society is going to be in trouble eventually and symmetric
is kind of a warning is when you know you eventually know that there is as much people on top at the
bottom.
It's not an ideal situation you really want more people coming in it's like a Ponzi scheme or though
you want you know a lot of people coming in and very few people cashing the checks above the opposite
when it's flipped triangle that's when people go to jail usually you know it's upon the the the scheme
is about to break apart and it's a bit the same thing you could see with this population pyramid.
So I have a video going to show you here about one of these animations I made about Japan and here that
we're looking at 1950 and you see a clearly beautiful expensive beautiful triangle and want to go through
years all the way at two thousand one hundred and look at it is starting to get like symmetric now and
by 2030 2050.
Now it's expensive a lot more older people at top and not enough young people at the bottom right.
So Japan is a country which is often used as an example for you know these constrictive shapes they're
just not enough young people there's not enough birth and there's a lot of older people as well you
have a lot of you know advances in robotics take care of older people and it's not just Japan.
If you look at Europe if you like the United States and by by you know two thousand one hundred they
all start forming this kind of shape it seems that this the western New westernised countries eventually
have less.
You know there's less births than there are older people and eventually it starts flipping and which
is which is problematic.
So that's kind of the things that you would see when you're looking at a population pyramid is here
you're thinking OK.
We need schools when you're a healthy job market in the opposite with Japan like this you're looking
oh you need a lot more like robotic care to take care of the older people because there's not enough
younger people coming in the workforce not enough money coming in you have to find tools to take care
of the older people.
So that's the kind of things you can tell by looking at these these popular at the population pyramids
is the type of what a society needs at a particular time in this situation you'd want to maybe I know
open up immigration have more births whatever you really want to kind of shape it back to you know to
to its normal shape the.
There are a few things that are very interesting here and I want to show you before we move to making
these these animations and we're gonna make a cool animations of the world and see what what the shape
of the world is gonna be in the near future.
One I want to show you is is we can look at Qatar.
Qatar.
Qatar is interesting and we'll look at Qatar today and 2020 Qatar is interesting because there's a lot
larger male population than female population.
That's why we wanted to make these scales.
We wanted to force both scales to be the same quantity so you can quickly see the imbalances.
Here is another problem we're seeing right.
There's just a lot more males than there are females and there is a flip side of that is in Estonia
Estonia 2020 you're seeing a lot more females and they're all males.
It's a different situation so all these things tells you not only it tells you if you need more schools
more jobs or more you know health care it will also see if you have imbalances between male and female
and see what one of the reasons and what can you do to try to remedy this situation.
Right.
So very interesting.
Definitely explore look for different countries look at different a group of countries that's also interesting
look at different zip codes you could do groups by you know by financial strata by bite by industry.
If you can get that kind of breakdown by age and by you know by gender for a specific type of data maybe
you can do joint on data and you can eventually get this which is I think is fascinating.
OK.
So that's kind of a tool right.
Three rember three overarching types expensive constrictive and stationary and the different problems
they bring and imbalances.
Right.
These are all imbalances.
That's probably not very healthy either.
Okay.
So what I want to show you now before we move to mounting this thing to the cloud lets me scroll down
as other things in the intercoastal please check it out.
Let's look at the world.
So the world is very interesting.
Let's pull this one up right now.
I'll replace it over Estonia.
The world in 2020 is basically going to get all the data for the entire world in 2020.
And you see it looks overall right looks pretty expensive.
Looking pretty good and that's just for fun.
Let's go to two to one hundred and see what happens.
Oh look a little bit more of a bulge here.
Less people coming in and more of a bulge right.
Probably could go like that two thousand two hundred you probably started to this constrictive shape.
This is more maybe stationary.
More of a stationary shape maybe.
Oh yeah.
So let me tell you how you run how you make these animated videos.
It's actually really easy.
You will need to have F of MPEG running on your machine.
And I have a link on how to install it or how to document install it sometimes.
Some operate systems may be more difficult than others so you know hopefully it works for you but simply
all we're doing is we are going to run through the code exact same code that we ran before and we are
going to run it by the entire dataset escape from 1950 to 2100 by year by year.
If you want to go if you wanted to go faster you go by five years you could go buy by 10 years.
Right.
But it is simply going to loop we're creating a loop by year and going from 1950 to 2100 the entire
thing.
And then you're pulling that you're pulling that specific data right.
We specifically want for in this case with the world for that specific year.
I'm sorting it just like we did before for a specific country and I'm breaking it down I'm creating
the y axis is getting the the male dataset the female dataset getting them the maximum scale for that
to that particular data and we are then we are just simply plotting it.
That is it starts changing here a little bit.
You're calling instead of plot it plot that show you're calling plot dot a save figure.
So save S A V E figure that function from from a map plot lib and you give it a name.
So this is important part here.
I am calling it I'm putting in its own folder.
I don't want to be with the rest of file.
Going to create a lot of files right.
You want to make sure it's nice not nice and compact and you want to.
I'm calling it a name you can call it whatever you want to underscore and then I'm passing this counter.
Here is a counter right.
You start by zero and you have it count one by one and then you increase the counter.
I mean it's going to save every single image in that folder one by one.
Here it is.
It's going to save anything from zero all the way to one hundred and forty nine.
Right.
So I think a miss maybe missing one.
I'm not sure.
But basically they're all here.
I can click on one and we click on one randomly here.
Here is the world in 1977 nice and very nice expensive triangle.
And they're all here right.
And the important thing is they have to be named properly and in consecutive order with a digit at the
end because the next what we're gonna do is we're gonna call and I think we're gonna call right here
at the end.
Our order is properly we call then F M F F and Peg and there is gonna be a link there to make sure we
can install it.
You simply open a command window and you run this command.
You say F impact dash frame rate.
The bigger the frame rate the faster it will go.
So you want to make sure it looks nice as a video.
And I want wanted by 10 frames per second.
And then you give the name a name on the score percent.
D This means a digit right.
That's going to notice a digit.
That is a bunch of you know specific commands and a file name.
I mean I must win this case I call it out to MPEG and before and if I open it here let me put bullet
in here so you can see what it looks like but very much it can be very much like the one that showed
you about Japan right.
Here it is
very very very expensive and is slowly starting to get more melt say and symmetric stationary
we can see the population is slowly very slowly moving up.
This is the world.
You could do it for Europe.
You could do it for a different group of countries the BRIC countries I showed you but this is it right
this is a very easy way of creating animations.
Obviously anything you do with my plot layer right this is just a plot saved command and then you call
the F pet comment on that directory.
So anything any chance you have is a repetition.
You could very easily run this type of animation.
I think it looks awesome.
I'm going to use this one as kind of the way my Twitter account to advertise this class because I think
it's pretty cool and it's a nice I think for people who are interested in seeing the development of
a society.
It's always interesting to see how in the only the population is growing right.
You can see these numbers are growing and how the older populations we're living longer we're surviving
longer.
And you know there's less than where we're apparently reproducing less thus the going from expensive
to constrictive.