[WSG20] Programming Fundamentals Week 1

During week 1 of Daily Wolfram Study Group, May 2020, we will be looking at the following topics:

  • Day 1: Working with Data
  • Day 2: Building Interfaces
  • Day 3: Functional Programming
  • Day 4: Tips for Writing Fast Code

We will look at lecture videos from the Wolfram U archives and also work on simple coding examples and mini projects.

Feel free to post questions on the material we cover in these sessions here.

6 Likes

Daily Challenge (May 4):
A challenge in the spirit of “May the fourth be with you”.

Chart the production budget against the release date of the Star Wars movies (from the WL EntityClass “StarWarsFranchise”). Which movie had the lowest production budget?

1 Like

Please send the link of the study group to regster

You can register for study groups at https://www.wolfram.com/wolfram-u/special-event/study-groups/

For this week specifically: sign up here

Could you please post links to the quizzes mentioned in the session today. Thank you.

1 Like

Hi Abrita,

Hope, I understood correctly the challenge.

My PieChart[]:

PieChart[EntityClass["Movie", "StarWarsFranchise"][
  EntityProperty["Movie", "ProductionBudget"]], 
 ChartLabels -> 
  Placed[EntityClass["Movie", "StarWarsFranchise"][
    EntityProperty["Movie", "ReleaseDate"]], "RadialCallout"]]

The movie with the lowest production budget:

In[2]:= data =
EntityClass[“Movie”,
“StarWarsFranchise”][{EntityProperty[“Movie”, “ProductionBudget”],
EntityProperty[“Movie”, “ReleaseDate”]}];
Select[data, #[1] == Min[data[[All, 1]]] &][1]

Out[2]= {Quantity[8.5`6.*^6, “USDollars”],
DateObject[{2008, 8, 15}, “Day”, “Gregorian”, 3.]}

1 Like

@Sviatoslav Archava could you please email wolfram-u@wolfram.com and we will send the link to you.

Hi Valeriu,
I had a DateListPlot in mind. But the fun of using the Wolfram Language is that there are so many ways of doing the same thing. And your chart highlights the information just as well.
Thanks for sharing.

1 Like

Sure, Abrita, with DateListPlot[] it’s much more simpler:

DateListPlot[
 EntityClass["Movie", 
   "StarWarsFranchise"][{EntityProperty["Movie", "ReleaseDate"], 
   EntityProperty["Movie", "ProductionBudget"]}]]

2 Likes
3 Likes

3 Likes

I wanted to upload my Notebook, but I can’t because I have to log in to my Wolfram Cloud account. I am logged in another tab in my browser, but I don’t know how to link that to this group, can you help me please?

In the meantime, here is my code:

a = EntityClass[“Movie”, “StarWarsFranchise”][“Name”];

y = EntityClass[“Movie”, “StarWarsFranchise”][“ProductionBudget”]

x = EntityClass[“Movie”, “StarWarsFranchise”][“ReleaseDate”]

BarChart[y, ChartLabels → Placed[{x, a}, {Before, After}],
BarOrigin → Left,
AxesLabel → {“Date of release”, “Production budget [USD]”}]

1 Like

Perfectly ok to copy paste code snippets. Notebook not needed.

1 Like
1 Like
1 Like

Hi Abrita, where can I access to the weekly quizzes and videos of the session? Can you give me any page link?

You should receive the links in the daily reminder email for the webinars. If you are not receiving those emails kindly write to wolfram-u@wolfram.com.

A DateListPlot with labels added in:

movies = EntityClass["Movie", 
"StarWarsFranchise"][{EntityProperty["Movie", "ReleaseDate"], 
EntityProperty["Movie", "ProductionBudget"], "Name"}] // Sort;
least = SortBy[movies, #[[2]] &, Min] // First;
DateListPlot[
Callout[#[[{1, 2}]], #[[3]], Automatic, #[[1]], 
LeaderSize -> {15, 125 \[Degree], -10}] & /@ movies, 
PlotMarkers -> Automatic, ImageSize -> Full, 
Epilog :> 
Text["Lowest Budget", {DateList@least[[1]], 
QuantityMagnitude@least[[2]] - 1.5 10^7}, Background -> Green], 
PlotRange -> {{{1958, 1, 1}, Today}, {-3 10^7, Automatic}}, 
FrameLabel -> {{"Production Budget", None}, {"Release Dates", None}},
PlotLabel -> Style["Star Wars Movie Franchise", "Subsubsection"]]

2 Likes

An actual analysis or comparison of production costs should include the time value of money referenced to some date, otherwise the comparison is invalid… right?

Q: (I’m new to Wolfram curated datasets) Is there a document or notebook associated with each curated dataset that describes how the data was curated? And, like the “daily challenge” problem, how would we know if the money values are referenced to some year’s dollars or are just the time value of money for the given date? Besides a document/notebook describing the curation process and source for datasets, it would be nice to have a separate document/notebook that describes the particulars of a given dataset (like how money values should be interpreted), etc.