Well, welcome to the Cannabis Data Science Meetup Group.
It's good to have you both.
So happy to have you, Kyron.
So I'll introduce myself first and then I'd love to hear about what brings you to the
group.
So my name is Keegan.
So I started a company, Candlytics.
And so we principally provide software to laboratories.
And being in this space, we realize there's a high demand for analytics.
And coincidentally, that's what my background is in.
So just thought, OK, time to lend a hand to everyone.
So we help everyone from labs to producers, processors, retailers, crunch numbers, move
data around, just make life simple and easy.
So that's what we do.
And so every Wednesday, we do a Cannabis Data Science Meetup Group where we basically get
some real cannabis data, look at some statistics to show, OK, this is how you would do things.
These are some statistics that you can calculate with data that's out there.
And just have fun, pick each other's brains.
So that's what we're about.
And so I'd love to hear about your angle.
What's your background, Kyron?
Well, I actually am in a data analytics boot camp.
And for one of my mock roles, it's to get started on networking.
Because I'm like an alternative route into the analytics field.
That's going to be a little bit more difficult for me since I have a degree backing it up.
So this is actually my first meetup that I'm doing on the subject.
And I picked this one because it kind of sounds interesting enough to learn about.
But other than that, there really isn't much.
I'm just here to sell it all in.
I think it's one of the, if you're coming from a data perspective, it's one of the best
subjects you could be studying because, believe it or not, there's no data like it.
No one's got public data like cannabis data.
So because the states want to keep a good measure on the cannabis operations, cannabis
activity, because this is something that used to be illegal.
So they want to keep a good eye on it.
And so nobody's tracking tomatoes from seed to sale.
Well maybe to a certain extent, but not to the extent that they are with cannabis.
And then on top of that, a lot of these states are really forthcoming with their data.
They've got public data.
And for the most, the biggest hurdle is just the technical hurdle.
They're happy to provide all the data.
It's just all their mechanisms in place.
And some states have awesome mechanisms.
And so we're going to be exploring some of those today.
So up in the Northeast, like for example, today we'll look at Massachusetts and Finnish
Connecticut.
They've got their data readily available through an API.
So you can just tap in, get some of these cases real time data.
So Connecticut basically is real time data.
And it calculates statistics to your heart's content.
So it's fun.
It's a good space to be in.
Cool.
Sounds good.
So well, without further ado, let's just jump into it.
Because yeah, you know, show don't tell.
So OK, so just to give you a little introduction here.
So we're coming from the we've got a repository here where you can find each week's code and
data that way you can follow along.
So basically last week we were looking at cannabinoids in Connecticut.
And so I figured, OK, before we move on, let's just go ahead and finish out this analysis
with Connecticut data just to be thorough.
So let's essentially do just that.
So here's the script we were working with last time that I've tidied up a little bit.
And so just to remind everyone from last week and then to show you, Kyron, this is the data
source.
So data.ct.gov.
And then you can find your way to the medical cannabis brand registry where they essentially
have real time or at least up to the past day entries for what appears to be every product
sold in Connecticut.
I could be wrong, but it appears to be every product.
So if you're going into the store and you're getting, you know, one of these, you know,
if you're getting Abiflex flower, then you can actually get the image.
So you went and bought some Abiflex flower.
And then you can actually see the certificate of analysis.
So you can actually see, OK, you know, this sample of data passed quality assurance testing,
test microtoxins, you know, there's no heavy metals detected.
You know, there's your cannabinoids and your terpenes.
So and it's verified, signed off on by the lab director here.
So we've got nice official records.
So this is this is a pretty pristine data set, right, because, you know, if if there's
any confusion with the numbers, so for whatever reason, if there was any confusion with any
of these data points, well, you can just refer back to the certificate if you need to.
So cool data set.
They have made it easily accessible.
So you can just come here, you can download it or.
As we like to do when possible, so you can automate things, we can access it through
an API.
So so what's cool here is we'll use the Socrata API.
And with Connecticut, we'll use this package here.
And then the second half of the meetup, we'll get data from Massachusetts and we'll do things
manually.
So here we'll use a package and then in Massachusetts, Massachusetts will just do things manually
just to show you both ways.
So without further ado, let's get this data.
So I'm not as familiar with DS codes.
Console here, terminal, but we'll experiment.
And then I just wrote just a quick charting function.
We'll talk about this when we get to it.
So just a little background work.
I basically looked at all the data points and just defined, OK, these are cannabinoids.
These are terpenes.
So we can define those.
Next it's real easy to get data from this endpoint here.
So essentially all you need to know is this ID right here.
That's essentially the data set ID.
And there we have it right there.
And we can probably get this data.
See if we have any data.
And so there we are.
So there are 10,859 observations at this moment.
And we have read those in with the API.
And so what's cool is as they add records, you can get those through the API.
So you can always have the latest data.
And then you can dive into this code or watch last week's meetup.
But this is basically what we did last week was we spent the majority of the time parsing
the data and getting it into a nice clean format.
So although it's maybe less than 15 lines of code now, this is what we spent the bulk
of our time on last week.
So that's nice that we can just move forward this week with clean data.
And just to show you what does the data look like.
We've got our brand.
We've got the approval date.
And now we've just cleaned all of the cannabinoids, terpenes.
And we added these two columns, total cannabinoids and total terpenes.
Because all those numbers weren't present in the data set.
These numbers, if we look at one of these certificates, I would not be the least bit
surprised to find total cannabinoids.
Well it does not look like total cannabinoids or total terpenes are reported on these COAs.
So perhaps in Massachusetts they aren't.
However in many states you'll see total terpenes and total cannabinoids reported on the certificate
of analysis.
And so this number doesn't make sense, right?
Because you can't have cannabinoids above 100.
So we'll have to account for situations like this.
Where in general we can now have a pretty good measure of those animals.
Now we want to look at the data.
So what we wanted to do last week was we basically said, OK, what is the prevalence of each terpene?
So how often can it be found?
How often does it occur in products?
In Connecticut actually.
This is in Massachusetts.
So this is code we did last week where we basically, we just, the magic here is we just
calculate the prevalence, which is basically the length, so the number of observations
where we have an analyte present divided by the total number of observations.
And so let's show this data sooner rather than later.
Here we are.
Didn't think we were going to be plotting this quite yet.
Anyways, this was basically this chart here, which I have the source code for here, this
chart.
But basically I just tried to generalize to basically, you pass your data frame and a
handful of parameters, and then this generates a fairly good looking chart.
Just as you can tell, sometimes it takes a few lines of code here to make a good chart.
So I encourage you to look through this code on your own if you're interested in making
good looking Matplotlib charts.
So but at the moment I've just sort of abstracted this away for simplicity here because this
isn't really the focus of the meetup.
You're welcome to look at this code here to see how to make the chart.
Anyways, we calculated the data.
So for each analyte here, we've calculated its prevalence, and we've also calculated
its average concentration.
And so just plotted the top 10.
And so as you can see, beta-karyonfylene is in about half of the samples.
Then you have this next group here, which is in about 30%, 30% to 33% of all samples,
the linalool, limonene, humulene, betamersene.
And so betamersene, I believe, is what you may find in lavenders.
So betamersene, betakaryophyllene, I think, are going to be more prevalent in what you
typically would call an indica strain.
And then the limonene, limonool, those may be more present in what you would call a sativa
type strain.
And then these other terpenes, I don't know as much about.
Beta-pinene, alpha-pinene, alpha-bizabolol, osemine, trans-nerolidal.
You do not know as much about these terpenes.
However, they appear in a non-negligible portion of the samples.
So there may be something special going on about these.
So people may be chopping around through these terpenes without knowing it.
So for example, osemine, it would be interesting to dive into the samples that contain osemine.
And see if there is a particular strain or what have you that explains this.
So maybe it's popular.
Maybe it's not popular.
So that's what we essentially did last week.
But I just wanted to run through it again this week just to show you the cleaner code
and we can add on top of it real quick.
So here are some other charts, some of them useful, some of them not so useful, that you
can also make.
And these ones I didn't beautify, I just made.
But they're interesting nonetheless.
So this next one, it was like, OK, how do these terpenes occur with each other?
So that's not what we wanted.
I'm going to run this interactive.
OK, so this is honestly, I wouldn't call this the most informative figure in the world,
but it does have some insights.
So what this is, is this is a choreogram of terpenes in Connecticut.
So this is how correlated various terpenes are with each other.
So what you can think of this is the darker the color, the more common these terpenes
are occurring with each other.
So you can just look at some dark colors here.
So here's one.
So it looks like, OK, this beta-phardazine occurs quite often with phelan...
Phelan... phelandrine.
I'm probably not pronouncing that correctly.
So is that a good insight or is that not a good insight?
I'm not certain.
But there's some interesting ones here.
And so I don't know how these could particularly help you, but maybe they could.
So like, here's another one.
So it's like, OK, for whatever reason, menthol and it looks like puligol looks like those
are correlated with each other.
So that's interesting.
So maybe if you notice that, OK, samples that have menthol perhaps have this particular
taste, who knows what type of strains contain menthol or puligol or what they smell or taste
like.
But perhaps if that was something you were looking for, maybe you could use this data
to your advantage.
Maybe some of these like beta-karyophylline, that would be an interesting one.
OK, so what shows up a lot with beta-karyophylline.
So you may be able to use this when you're selecting strains, if you're trying to breathe
for a particular terpene.
Hard to say.
So honestly, the chart's not as informative as I was...
I don't know.
It exists.
So if you have any insights from this figure, by all means, by all means share.
Moving on.
So I figured, OK, that wasn't the most informative figure in the world.
With another way we can look at this data.
Well we've looked at the terpenes.
Let's look at the cannabinoids.
So what we've looked at in past weeks, particularly in hemp, is OK, what's the CBD to THC ratio?
So let's do just that.
So here we're just going to do a scatter plot of CBD to THCA.
This figure could probably be refined.
So one thing we're doing here is we're just lumping all the sample types together.
It would probably be fruitful to separate out the different sample types, so that way
you're comparing apples to apples.
So what I always like to do is just start with flour, if that's what you're interested
in looking at, to just look at flour samples.
So a lot of times here in the cannabis data science group, we're more about do rather
than talk.
So why don't we see if we can do that?
So the way I would go about doing that is first we want to remind ourselves, OK, what
data points do we actually have here?
A bunch of them.
But it looks, oh yes, that's right, it may be hard for us to isolate.
So I think usage form is, yes, so there's many different types of product categories.
So not to go too deep into this, but I'll give it 30 seconds here.
Let's see if we can just say, OK, we'll say the flour data is the data where the data
is stored in the dosage form as a string.
We want it, I'm not sure if this is going to work, but this is what I would like to
do where the dosage form as a string that's lowered.
This is not going to work, contains flour.
That's what I would love to be able to do.
We're going to have to hit Google real quick.
So we were just doing this last week where we were saying get data, get contains.
OK, there's actually another way we could potentially do this.
OK, so let's see if we can do.
OK, so we can actually do this and we can actually say, OK, let's just get everything
where it contains flour or it contains flour.
Awesome.
So let's see if this makes sense.
So like I said, if you're doing this analysis for research purposes or any serious endeavors,
you'll want to double check all of this stuff.
A lot of times here in the Canvas Data Science group, we're just moving quick, just sort
of doing proof of concepts.
So if you're doing this on your own, you're going to want to dive in here and look at
the flour data and make sure that this makes sense to you.
OK, these are flour observations.
The cannabinoids should all be less than 30, 35 percent.
I'm instantly wondering what's going on with these cannabinoids.
So something's either going wrong with their total cannabinoid calculation or something's
going on there.
Looks like in some cases it's getting it right, some cases what's going on.
So if you're doing this on your own, you're going to want to dive in and figure out, OK,
this is an oil syringe.
This needs to be excluded from the flour data.
Just since we're just moving quick and breaking things, I'll just make our scattered plot
here of flour data.
And then we'll move on to new things.
So we'll just do the scattered plot here.
Looks like I messed something up.
That's probably it.
OK, so I think that's about as much time as we'll dedicate to this particular endeavor.
But here we tried to just isolate the flour data.
You could potentially, this is another little ad hoc thing, we could just say, oh, we'll
just get everything with the total cannabinoids.
Let's just say less than 40, just in case there's some high things in there.
So this is an ad hoc way of just getting those oils out of there.
But similar thing going on where, OK, it looks like there's maybe a slight correlation here
between CBDA and THCA, but maybe not a perfect correlation by any means, because it looks
like you can definitely crank up the THCA without increasing CBDA and perhaps conversely
as well.
So long story short, the data needs a bit more cleaning to do a nice scattered plot
here.
So I thought, OK, one last attempt, let's just look at a scatter plot of cannabinoids
versus total terpenes and see if there's a trade-off there.
Because last week we talked about, oh, maybe if the plant is producing more terpenes, then
maybe it's producing less cannabinoids.
Maybe they have a positive relationship.
So we don't really know, so we can find out.
So this is just a scatter plot here of total cannabinoids, or it should be total terpenes
versus total cannabinoids.
Cool.
Oh, yeah, I also separated this by producer.
So what I would say from this is there's no strong correlation.
You'd actually have to crunch the stats to actually know the correlation.
But just from eyeball, I'd say there's not a strong correlation, but maybe a weak positive
correlation between terpenes and cannabinoids.
So what that would basically suggest to me is just higher quality product.
So just the higher quality product it's going to be is to basically the higher you crank
up the lights, the higher you crank up the nutrients.
I think it's going to say the lights.
So if you really crank those lights up, you're going to get high terpenes.
You're going to get high cannabinoids.
The things on this side of the graph are probably concentrates.
So that's more about processing.
But I think this is interesting.
So here I separated this.
So here let me open this figure up so we can get a better look at it.
So here I separated by the different producers.
And this is what I found so interesting is that Connecticut is similar to Illinois in
that you only have a handful of producers.
You only have four producers in Connecticut.
So I know Connecticut's a small state, but that seems like a small number of producers.
So we'll actually look at Massachusetts next and compare the two.
We'll do the comparison next week.
We'll get Massachusetts dated today.
Again, looking at Massachusetts, then do a comparison next week perhaps.
But for this week, I thought it was interesting that, oh, let's look at what these different
companies are doing.
And not to single out any one of these companies.
But it looks like they kind of have different segments of the market.
They've each found things that work well for them.
So you've got their plant here.
And it looks like they've got, you know, you'd have to do the statistics.
But they have maybe lower terpenes than some of the other players on average.
But wow, they definitely have some of these high canobinoids over here.
So maybe they do a lot of distillates, these high THC distillates perhaps.
And then maybe these companies like Advanced Grow, definitely the Connecticut Pharmaceutical
Solutions.
It looks like they're maybe doing some of these, you know, high terpene concentrates
where sometimes I do believe they'll add terpenes back in after the...
And Heather can maybe speak to this, where this is maybe what consumers are looking for,
these real tasty concentrates.
And so, right, so it's interesting, right?
So here you have, you know, an Orange Connecticut CPS.
And they're doing some and they're not even the highest cannabinoids.
But wow, you know, they've got like some that are like, look, they've got the highest, they've
got one here that's almost 10% terpenes and no one else is up there.
Well, I think that their plant's kind of up there a couple times.
So long story short, I just thought it was interesting to break this out by producer
since you only have four.
And then once again, it looks like there's maybe a slight positive correlation here,
especially when you get into this sort of what I would call the high quality top shelf
flower where you basically got the flower really starting at around 15 to 18% to about,
you know, the high...
Well, this is total cannabinoids.
You know, this is going to be up to like 33, about 35%.
Looks like some of them kind of pushing that.
And that's, you know, just adding all the cannabinoids together, not taking in the mass
factor for THCA or anything like that.
So long story short, this is where the bulk of your flowers shaking out.
And it does look like there's just like positive correlation between terpenes.
So cool things going on in Connecticut.
Awesome data there.
So to step next door, we can start looking at Massachusetts.
So this will be a brand new look here at this data.
I just put together the requests this morning.
So now we can get back into some of the programming things for you, for you program nerds out
there.
So basically if you're using Python, we were using Subcrata, which is a third party package
to access the API.
I was looking around online and some people were kind of complaining.
Subcrata is maybe a little, or not Subcrata, but the SodaPy package is maybe a little dated.
And you can accomplish the same things on your own with simple HTML requests.
So we're just going to, one, this is what can let it stress is simple is that, well,
Python for that matter, simple is better than complex.
Simple solutions just tend to work out better in the long run.
So we can simply request this data with the request package, which is about as simple
and bare bones as you can get.
So basically just going to get these pretty standard packages here.
I am reading in an app token.
You don't need one, but this will make our requests so they're not throttled.
Then we're just going to define our headers.
So basically this is our authentication.
We just pass our app token.
This is the main URL.
So it's just like visiting a web page where you just, it's just a URL.
So this is just a URL that contains a lot of awesome data.
So we can just read those into the terminal here.
And we can start getting these data points.
And so just to show you the data before we, or show you the data source.
So the first one we'll get, we're just going to get the adult use cannabis retail sales
by date and product type in Massachusetts.
So basically we're just going to get all of the Massachusetts data.
We can, and then we'll see what we can do with it at that point.
So as we noted, we really just need this data set ID and then Bob's your uncle.
So we just slap that data set ID onto the base URL, add.json because that way we can
specify that we want our data in JSON requests, allow us to specify our parameters here.
And I will admit that I am not an SQL expert by any means.
Just tell me to move along if I'm getting that too technical here or anyone.
But basically if you want to nerd out, Socrata has good documentation for how to do all of
this.
And so I won't buy into it too much on my own here, but I've put the links up at the
GitHub.
And so then you can, you know, if you're interested, you can read up and see, okay, this is how
the ordering data, or this is how we, you can do many magical things here.
So but anyways, if you're interested, there's many powerful things you can do for our needs
today.
Sorry, let's get back on track here.
For our needs today, we don't really need to limit, but I'm going to add one anyways.
And then we just need to order the data.
So I've already looked at the data set here.
Here we are.
You can see the fields and actually is this the right data set?
Well we'll find out.
But these are the data points and it looks like we want to order by the activity summary
date.
There's a reason I'm saying sales date.
So anyways, it should work, but a little bit of disconnect here.
Sorry, the documentation is not great.
I should have left better comments.
But anyways, for this first one, we're just going to get the products that are in Massachusetts.
So just read 100 of them.
And so these are products that are getting sold.
And so it looks like, okay, these are our product sales by day.
So it looks like we've got data up until the 14th, looks like.
So up and through last week.
So not bad.
And then we just know, okay, these are the amount of buds that were sold.
This is the amount of concentrate that was sold.
This is the amount of edibles that were sold.
So mostly sales data at this point.
However, we can still, we can.
Hold on, there may be.
Anyways, maybe there was someone trying to join, but anyways.
Well this is interesting data because we can maybe start to compare Massachusetts to Connecticut.
And so what we've been trying, we've been working on is, okay, what's the competitiveness
of these different states?
Because they're all, each state is supposedly, it's a little island where they're all operating
like these little isolated environments.
And so we could say, what's the effect of that?
So like Illinois, they only allowed a few dozen licensees.
How does Illinois compare to Michigan, which is, or to Oklahoma?
Like we know Oklahoma in particular is a free for all.
So how do those states compare?
How does Connecticut compare to Massachusetts?
So Connecticut only has four licensees that produce cannabis, four production licenses.
We'll find out how many Massachusetts has, and then does that have any effect on the
competitiveness?
So can we now compare sales in Connecticut to sales in Massachusetts?
Are they different?
Like is there a price discrepancy if we can break that out?
Because that's what is ultimately, that's kind of what I'm coming out with.
My economics background is, what are the effects of these policies?
So yes, they're legalizing and permitting cannabis in various forms, but what's the
effect of that?
Maybe some policies are more optimal than others.
You may have unintended consequences of certain policies.
It's fascinating to see, okay, how do the different states shake out?
And so the do instead of just speak, let's look at the licensees here in Massachusetts.
So there's a hundred of them.
Let's actually just go ahead and get all of them.
I think there are less than a thousand.
So let's see.
Okay, awesome.
So in Massachusetts, there are 898 licensees.
Awesome.
What do they do?
So there's license type.
So let's find out how many of each type there are.
So this is the first time I looked at this data with you.
I promise this is all I've done is I just wrote the code to get the data.
So that's the, getting the data is often the most boring part.
So I've already done sort of the boring part.
And so now we get to get into the fun part, which is looking at the data, cleaning it
up, which is fun depending on who you talk to.
And then visualizing the data, which is if you're a fan of Edward Cuff, this is what
it's all about.
If you've got data, you want to visualize it like that.
Visualize the data should be step one, but you actually have to first, you actually have
to get the data and then you actually have to kind of clean it up.
So inevitably those are the first two steps.
But then you want to look at the data.
So anyways, let's do just that.
So for the license type in the licensees.license type.
So let's just look at all the unique license types.
Let's list them.
For all of these.
Let's find the, you know, the license count for each one.
So that's just going to be the length where our licensees, the license type is equal to
that license type.
So that should get us the, that should get us the license count.
And then we can just print that out.
We can say, okay, so what's the number of this license type?
And that's just going to be the license count.
We don't promise this is going to work.
It looks like it may have.
So this is awesome because now we now have the count of all the licensees here in Massachusetts,
which is already useful because we can already start making comparisons to Connecticut right
off the bat.
There's a lot more cultivators in Massachusetts than there are in Connecticut.
What's the population difference of these two states?
Well, this is a, this is a data point that we've already collected here.
So you can use Fred, Fed to find the population for various states.
And so let's compare these two.
So Massachusetts is 6.9 million, Connecticut's 3.6 million.
So what did we say?
3.6, 6.9, 6.9 minus 3.6.
So Massachusetts is almost twice as large as, and so Massachusetts is a little less
than twice as large as Connecticut.
So that's interesting, but it's got a lot more than twice the number of cultivators,
right?
Remember Connecticut had four and you've got 274 Massachusetts.
So quite a bit different.
And then you have a handful of other companies, you know, you have your processors, you have
your retailers.
And then we can find out, okay, what's the percentage that these are of the whole market
here?
So we want to find out what percent this is of the whole market.
For the percentage of licensees, well, that's just going to be the license count divided
by all licensees.
So let's see if we can't.
Need more decimal places.
Cool.
So now we can even break it down.
So we've done this in other states.
So now this is cool because now we can start comparing Massachusetts to other states.
We can say, okay, look at this.
Almost 40% of the licensees are retailers.
That's much higher than we've noted in other states.
I want to say we were just looking at these statistics in Oklahoma and maybe only 15%
of the licensees were retailers.
And maybe 60 to 70% were cultivators.
Here only 30% are cultivators.
The manufacturers is a little higher than we saw in Oklahoma, but comparable.
And then of course, your other businesses are comparable where you only have a small
number of laboratories.
This may be higher than it was in Oklahoma.
This is greater than 1%.
So let's put this in percentages.
But that's not what we want.
Exactly.
So I think in Oklahoma, maybe less than 1% of the licensees were laboratories.
Here you have a little more than 1%.
Not sure if that's a significant difference.
You've got just a small number of transporters, et cetera.
I just think it's interesting that you have a much different breakdown of retailers, of
the percent of retailers and cultivators than you do in Oklahoma.
And so I would like to think, OK, does this have to do with time?
Is Massachusetts a more mature market than Oklahoma?
And trend that.
So you could start to make predictions.
So maybe you could look at Massachusetts early on and maybe look at Massachusetts like a
year ago, two years ago, and see, OK, maybe the percent of retailers has increased over
time and the percent of cultivators has decreased over time.
Just a conjecture, but that may be the case.
And so if that's the case, you can basically learn from Massachusetts.
And you could maybe use that to apply to Oklahoma.
And you say, OK, maybe over time, Oklahoma may wind up with a higher percentage of retailers
and a lower percentage of cultivators.
May, may not.
And it may be a policy effect.
Right?
So if you look at them, you watch them over time, and time doesn't appear to be a factor,
which would be like maturity, learning by doing, et cetera, then maybe there's another
explanatory factor.
Right?
Maybe it's the policy.
Maybe there's policies in place in Massachusetts that just encourage a large percentage of
retail versus Oklahoma.
So already, already, we've barely gotten the data.
We've barely scratched the surface.
Right?
We've basically taken like, we're talking about a conditional average.
We've taken a conditional count.
Like, we made like one conditional statistic here.
And we already have groundbreaking insights.
I mean, you could borderline already write a paper on this.
Like say, oh, like this is, right, because what we're doing is we're basically looking
at the industrial organization of these different states.
And you can start to see how does the policies and behavior of the organizations and players,
how does that affect the structure?
So fascinating stuff here.
So we'll kind of bring it to a head here, but basically just want to show you the rest
of the data points.
That way you can start picking your brains about what statistics could be made for next
week.
So that way we can continue to uncover insights and maybe continue our interstate comparison.
So just to show you the other data points here, you can also get prices.
So just get a hundred prices here.
Awesome.
So you basically have the average price of an ounce, unbelievably a flower, by day.
So I don't think my order worked.
Oh, yes, this is actually by month.
So this is a really aggregated statistic, but statistics on prices are hard to come
by.
We've got them in Washington state because we can do Freedom of Information Act requests.
We probably get them in other states, but prices are hard to come by.
So this is good data.
I'm happy to have it.
And so here you just have the average price of an ounce per month.
And then just to show you real quick what you can do with that, we want to sort this
on the place.
Okay.
Let's go to our good friend Google real quick.
Just see how do we sort a data frame.
We use sort values.
So let's do sort the values.
Okay.
That looks chronological.
Okay.
I'll be wrapping up here, but basically just to show you this data.
Oh, that's not what we want.
Here we are.
So you can plot prices over time.
This is real interesting.
So they have this data on their website, but as many of you noticed, there was something
unusual about April of 2020.
I'll let you be the judge of what was unusual about that month, but it had an effect on
prices.
It looks like it was a transitory effect on prices.
So as you can see, everybody's running through the store to get cannabis.
And for whatever reason, you'd actually think prices would rise, but for whatever reason,
prices fell dramatically that month, April of 2020.
But it was transitory and by May, the prices had stabilized.
As you can see, this is what you'd call an increase in volatility, where you basically
have pretty stable prices and then, whoa, we've got a volatile market.
Prices are going all over the place.
People like, this is what you see from a rise in uncertainty.
So people are less certain about what's going on.
Oh no.
Is this good?
Is this bad?
We don't really know.
This is what I would call increased volatility, where you see it's just greater variation
in prices, not quite so stable.
So who knows if this is going to persist, but that's how I would characterize this past
year.
And you could actually look at the statistics, actually compare the variance of this period
versus the variance of this period.
I know you only have so many observations, so you probably couldn't get the statistical
claim one way or the other, but you could still look at the variance and maybe we'll
do that next week.
But long story short, you can look at the trend.
So there's cool things you can do, even though it's just a simple series.
And then the last set of data points here, which can't be forgotten because this is some
real meat right here.
So we'll dive into this meat and potatoes next week.
But just to show you what the data looks like, let's just look at a couple of these.
So here is real cool data.
So you've got the date.
Yeah, so you've got daily data here.
You've got plant counts.
You've got you know what stage they're in.
So you know how many flowering plants there are, how many vegetative plants there are,
how many plants are being harvested.
Just you've got the sales total.
You know how many packages there are.
Packages are kind of a little vague, but nonetheless, interesting data point.
And you know strains is interesting.
You know how many employees there are.
This is an incredibly interesting data point because it's real.
There's ways to measure capital.
So in economics, we talk about two inputs to the production function, primarily.
You've got capital and labor.
And you know, there's many ways to measure capital.
And I've done it in the past and we'll do it maybe next week where we can just kind
of proxy capital with things like plants or what have you.
There's ways to do it.
But actually knowing the number of employees, the labor, of course, yes, it would be nice
to know the breakdown of the labor.
What are these employees doing?
What are their wages?
However, we'll take what we get.
So we've been given the total number of employees.
So I think this is an extraordinarily interesting data point.
So you know, just to run just a little bit longer here, let's just do a similar thing
we did with prices and just plot employees real quick because I'm super, super interested
what that may look like by total employees.
So let's just end on this note.
Oh, oh no.
I want to check.
OK, that is chronological order.
So this is worrisome.
At least it is to me.
If unless I somehow plotted this in the wrong direction, which is not unfathomable.
Yes, I think I may have plotted the data backwards here.
So let's double check on this next week because right off the bat, I'm worried I may have
plotted this in the wrong direction because this would look like, oh no, our total employees
are falling off a cliff here.
But I've got a feeling if you look here at the data, we've got 2021, 06, 05, and we have
8,000.
And then here we have 2021, 09, 14.
We have 9,000.
So I think this is reversed.
So that's OK.
So got a little sloppy there at the end.
So next week, we'll finish cleaning this data and then dive into more analysis.
So we've got all these awesome data points here so we can have a field day next week.
So I'm going to stop the presentation there.
But thank you both for listening to that big launch feel.
Did any questions, comments come to mind?
As far as the presentation went, it was a great watch.
Everything kind of went over my head because, like I said, I'm still learning about this.
I haven't even dipped more than a pinky toe into Python yet.
But I was going to ask after we're done here if I could get like five minutes of your time
to ask a couple of questions.
It's also for my school thing.
Oh, yes.
Always happy to talk.
This is sort of our approach is yet thrown in on the deep end.
So like I said, it's just sort of a cursory approach.
In practice, you'd go much slower and really parse things out and be real certain with
things.
But this is what we're sort of doing just real quick and easy.
We're just showing, OK, it's possible.
The data is there.
You can get the data.
You can print it.
And so this group is more for fun.
And then exactly, yes, if you're trying to get serious about data analytics, then I'm
always happy to be a resource for you.
It's good to hear.