[WSG21] Daily Study Group: Wolfram Language Basics

A new study group for Wolfram Language Basics begins Monday, Feb 15, 2021!

Join this three-week study group to build or refresh your knowledge of the Wolfram Language. We will start slow but try to cover a broad variety of topics. No prior experience in Wolfram Language is needed to join this study group. We will provide study materials along with self-learning exercises so you can review topics on your own beyond the study group sessions.

Sign up here: https://wolfr.am/T4GiU9ch

5 Likes

Looking forward to seeing you and @Arben K co-leading this study group!

2 Likes

The “Wolfram Language basics” study group begins today. See you there!

1 Like

Happy to be a part of this study session cohort!

1 Like

For all the new folks who attended Study Group today: Feel free to try Wolfram One (Wolfram|One: Cloud-Desktop Computation Platform) to open up the notebook we shared with you.

1 Like

We ran into some issues with a couple of examples during today’s session. Here are possible resolutions to those issues:

  • First 500 digits of Pi: ResourceFunction["NthDigit"][\[Pi], #] & /@ Range[500]
  • Example of using lists in the same way (domain of input values) in two different Wolfram Language functions: Table[Sin[x],{x,1,10}] and Plot[Sin[x],{x,1,10}]

Here is the example of processing the DNA sequence from the BRCA 1 gene (with the nucleotides as chemical entities instead of just string characters):

Counts[Characters[Entity["Gene", {"BRCA1",  {"Species" -> "HomoSapiens"}}]["ReferenceSequence"]] /. 
     {"A" -> Entity["Chemical", "Adenine"], 
      "T" ->  Entity["Chemical", "Thymine"], 
      "G" ->  Entity["Chemical", "Guanine"], 
      "C" -> Entity["Chemical", "Cytosine"]}]

Alternative for first 500 digits of π

N[Pi, 500] // RealDigits // First

While Table[Sin[x],{x,1,10}] and Plot[Sin[x],{x,1,10}] use the same x range, the points used by Plot are chosen so that the plot is “smooth”.

tablePoints = Table[Sin[x], {x, 1, 10}];

plot = Plot[Sin[x], {x, 1, 10}];
plotPoints = Cases[plot, Line[p_] :> p, All] // First;

ListPlot[{plotPoints, tablePoints}, 
 PlotStyle -> {Automatic, Directive[PointSize[Medium], Red]}]

1 Like

Thank you for showing the replacement to turn the strings into entities in the nucleotides example. Ron

Good day, everyone!

I’ve got a small noobie question. I declare a function using Module to hide local variable x. And I expect x to be local. But when I check what is x with question mark, it is says, x is global.

Are things to be that way? What don’t I understand?

Hi Fedor,
The syntax coloring is giving us a hint that the “?” is not working on the local symbol x but on the global symbol (since x appears black, not green). So it is correctly informing us of the status of the global “x”.
Perhaps you could try replacing “?x” with Information[x] which would ensure the right “x” was being used for information.

In slide 31 of the notebook for the second day, it looks like there is a small error in coding for the function FixMatrix. The code works fine for square matrices (as in the examples given), but not for general matrices, because the mapping over the column numbers is taken over the row numbers instead. It can be fixed by replacing

Range[Length[mat]] (*the list of row numbers*) 

by either

Range[Length[Transpose[mat]]] 

or

Range[Last[Dimensions[mat]]] (*the list of column numbers*)

Ron Goetz

Thanks Ron, for the catching the issue and sharing the resolution.

May I get a link to the first session on Monday? I have the 2nd one from Tuesday and 3rd one from Thursday. Thank you

Hi Michael, We’re re-sending the link to you via email.

Great talks by Abrita and Arben. How can I find my way to the quiz?
Thanks,
Roger

1 Like

I can’t seem to download the data1D.dat data1D2.dat files in the data folder.

Hi Ron,
Selecting the two .dat files and clicking on Download from the “… Actions” menu should allow you to download a zip containing the two data files.

Hi Roger, The link to the quiz that was shared in the study group session today, will alsol be included in the next reminder email for the webinar.

With the free basic plan, I am unable to find a way to upload the notebooks you have shared with the Study Group into Wolfram One/Cloud.

Have I missed something?

Thank you.
Yeu Wen

That was what I did, among other variations, but nothing worked in Chrome. I switched to a different browser and had no trouble. I’m guessing there is a way of telling Chrome it’s OK to download DAT files, but I couldn’t find it on a first pass through the settings.