As a senior software engineer who enjoys helping more people learn to code, I appreciate python's accessibility and ease. Side note- I'm pretty sure 'j' is python's default imaginary value indicator, rather than just what that package uses. Additionally, I suspect 'j' is used because 'i' is commonly used as a incrementor/indexing variable.
how do you make python accessible with all this mutable/immutable craziness? How do you explain the available data structures? As a Fortran/C/C++/Perl programmer i find Python to be the definition of unintuitive : ( I've tried three times, each time with different resources, each time i bounced back like a ball from a wall.
@@empireempire3545 By "accessible", I mean- 1) you don't need special software to compile and run python scripts, 2) you don't have to rely on external assemblies being present/intalled just to get started, and 3) it is truly cross platform- there's no need to re-compile your program/script for different platforms/architectures. By the same token, I appreciate the accessibility of JavaScript, but I'm not overly fond of how "loose" it allows developers to be. I've had to resolve problems, and re-educate devs, due to bad practices they've gotten used to thanks to how loose JS can be.
To add a little to your explanation for the choice of _j_ over _i_ ; I presume the reason it insists on _1j_ rather than simply _j_ is syntax: variable names can't start with a digit, so it eliminates any ambiguity (for example, _j_ might be chosen as an index variable for a nested loop). The solution is a compromise between what's familiar from maths notation and what's practical for the interpreter to parse.
@@ericgoldman7533 I fail to understand point 1 and 2. Either you're on linux, in which case the same is true for c/c++/fortran/perl/younameit or you're on windows in which case it isnt true for anything. Besides, its just one time standard setup. Usually i just guide people through it step by step and we're done very quickly. The problems most people new to programming have are, in most experience, shit ton of mental constructs one has to assimilate. I have no idea how a person new to programming can not get lost in all the weirdness with which python slaps you from the beginning.
Professional software dev here... there's nothing wrong with that code Ben! Lots of the "ceremony" (tests, comments) depends on the intended audience, and in this case that was you. Also, nothing wrong with a "no tools" development process. There's always a balance between tools/setup and getting things done, just like there's always a balance between spending time on theory vs. actually building something. Seems like you nailed it - neat results in record time.
Hi Ben, I love these videos - so natural. You're clearly a Geogebra expert but when it comes to Python, I think we're in a similar situation: neither of us are experts, but it enables us to do useful stuff with the aid of some Googling. You're a braver man than I to show your efforts online, but well done. For those seeking careers in STEM, make sure you understand the maths, but proficiency in Python (or R) will be a valuable additional skill. I'd definitely value that as an employer.
@@SparksMaths That's something I really enjoy about the channel Coding Train - the host Daniel is working it out as he goes along (though he does sometimes have notes), which gives people a more realistic idea of what it's like to code (at least for someone like me). If things are too perfectly prepared beforehand it make an inexperienced viewer feel totally hopeless in comparison.
Factorial, Gamma, and double factorial (factdouble) are used in SERIESSUM function of Taylor or Maclaurin series expansion which you can also find in UA-cam.
Y'know what Ben, I'll sleep easy thinking back to this video and knowing that I'm not the only botching code together 😅 thank you for easing my imposter syndrome
Ben, I've been doing "actual" coding for 7-8 years now and when I see these programs on UA-cam I too feel like I don't know anything it's perfectly normal to feel that way
I've worked in data science and done some viz work, and I don't think you should be at all ashamed of just throwing together things until they work. It's infinitely better than spinning your wheels while you fret about problems you'll never encounter. As long as you grasp the math enough to know what sort of erroneous results to look out for (i.e. realizing what it gives you has something wrong with it that you need to figure out and correct), the rest doesn't matter so much. It seems to me like you've got that.
I came here for the colors because I read that matplotlib changed default from 'jet' to something they called 'viridis' and this is the first time I saw it in the wild. As you said at 12:13 it's easy to add a colormap, you just need to add an import and a parameter to plot_surface() from matplotlib import cm surf = ax.plot_surface(X, Y, Z, cmap=cm.viridis)
Pro(-ish) Tip: When you have to fight the brackets, split things across multiple lines... ... either as multiple intermediate formulas, or one (or more) multi-line expressions. Consider: Z = np.clip( abs( gamma( X + 1j * Y ) ), 0, 10 ) Books have been written on writhing solid code (in fact, I have a book with that as a title). There are many ways to guard yourself from the pitfalls of misplace punctuation. There have to be; misplaced punctuation can be quite painful. Oh, and then there are editors that highlight and make it easy to jump between matching brackets.
Wonderful video. Thanks!! FYI: Another way to write a+bi in python is complex(a,b). You can write any constant followed by j (like 4j) to get the imaginary part of a number, but you can't put a variable there, because bj would be a different variable name.
It's from Richard Feynman (it was left written on his office blackboard after he died). I actually slightly misquoted: "What I cannot create, I do not understand" - a quick google will find the image of his blackboard - e.g. www.quora.com/What-did-Richard-Feynman-mean-when-he-said-What-I-cannot-create-I-do-not-understand
I've rarely started code from scratch in practice. I usually open something related in some way and edit it down and copy paste it up. That's also how I write homework and exams :p
Yes, when I started recording the python bit I was realising it was probably the first (and likely only) time I ever typed in the import commands, rather than copying them from another file...
People think I'm crazy, but I came to Perl from the Bash world, and the two overlap. So, I do my math stuff in Perl (Mandelbrot lately), which people think is nutz. But, so be it. Cheers.
"The internet exists, go look it up" truer words were never spoken!
That's great. I didn't realise you have your own channel. Thanks for sending me, Matt
I like the phrase that I've seen some other content creators use, "This is a 'what did', not a 'how to'"
Thanks JBLewis! I like this. Mentioned it in the next vid (and in the notes, but it won't let me tag you for some reason...)
As a senior software engineer who enjoys helping more people learn to code, I appreciate python's accessibility and ease.
Side note- I'm pretty sure 'j' is python's default imaginary value indicator, rather than just what that package uses. Additionally, I suspect 'j' is used because 'i' is commonly used as a incrementor/indexing variable.
In electrical engineering, j is often used instead of i, as i is used for current.
how do you make python accessible with all this mutable/immutable craziness? How do you explain the available data structures? As a Fortran/C/C++/Perl programmer i find Python to be the definition of unintuitive : ( I've tried three times, each time with different resources, each time i bounced back like a ball from a wall.
@@empireempire3545 By "accessible", I mean-
1) you don't need special software to compile and run python scripts,
2) you don't have to rely on external assemblies being present/intalled just to get started, and
3) it is truly cross platform- there's no need to re-compile your program/script for different platforms/architectures.
By the same token, I appreciate the accessibility of JavaScript, but I'm not overly fond of how "loose" it allows developers to be. I've had to resolve problems, and re-educate devs, due to bad practices they've gotten used to thanks to how loose JS can be.
To add a little to your explanation for the choice of _j_ over _i_ ; I presume the reason it insists on _1j_ rather than simply _j_ is syntax: variable names can't start with a digit, so it eliminates any ambiguity (for example, _j_ might be chosen as an index variable for a nested loop).
The solution is a compromise between what's familiar from maths notation and what's practical for the interpreter to parse.
@@ericgoldman7533
I fail to understand point 1 and 2. Either you're on linux, in which case the same is true for c/c++/fortran/perl/younameit or you're on windows in which case it isnt true for anything.
Besides, its just one time standard setup. Usually i just guide people through it step by step and we're done very quickly.
The problems most people new to programming have are, in most experience, shit ton of mental constructs one has to assimilate.
I have no idea how a person new to programming can not get lost in all the weirdness with which python slaps you from the beginning.
Professional software dev here... there's nothing wrong with that code Ben!
Lots of the "ceremony" (tests, comments) depends on the intended audience, and in this case that was you.
Also, nothing wrong with a "no tools" development process. There's always a balance between tools/setup and getting things done, just like there's always a balance between spending time on theory vs. actually building something. Seems like you nailed it - neat results in record time.
Hi Ben, you get my thumbs up, because you are not asking for it. Clearly, you very much enjoy what you do! Keep sharing your passion for math!
Hi Ben, I love these videos - so natural. You're clearly a Geogebra expert but when it comes to Python, I think we're in a similar situation: neither of us are experts, but it enables us to do useful stuff with the aid of some Googling. You're a braver man than I to show your efforts online, but well done. For those seeking careers in STEM, make sure you understand the maths, but proficiency in Python (or R) will be a valuable additional skill. I'd definitely value that as an employer.
I'm glad, and relieved. It's important for us to show that this stuff is a human (and sometimes slow and frustrating, if also exciting) endeavour!
@@SparksMaths That's something I really enjoy about the channel Coding Train - the host Daniel is working it out as he goes along (though he does sometimes have notes), which gives people a more realistic idea of what it's like to code (at least for someone like me). If things are too perfectly prepared beforehand it make an inexperienced viewer feel totally hopeless in comparison.
Factorial, Gamma, and double factorial (factdouble) are used in SERIESSUM function of Taylor or Maclaurin series expansion which you can also find in UA-cam.
Thank you!
Y'know what Ben, I'll sleep easy thinking back to this video and knowing that I'm not the only botching code together 😅 thank you for easing my imposter syndrome
Ben, I've been doing "actual" coding for 7-8 years now and when I see these programs on UA-cam I too feel like I don't know anything it's perfectly normal to feel that way
This is a very clear and easy to follow geogebra tutorial. You rock!
I've worked in data science and done some viz work, and I don't think you should be at all ashamed of just throwing together things until they work. It's infinitely better than spinning your wheels while you fret about problems you'll never encounter. As long as you grasp the math enough to know what sort of erroneous results to look out for (i.e. realizing what it gives you has something wrong with it that you need to figure out and correct), the rest doesn't matter so much. It seems to me like you've got that.
I came here for the colors because I read that matplotlib changed default from 'jet' to something they called 'viridis' and this is the first time I saw it in the wild. As you said at 12:13 it's easy to add a colormap, you just need to add an import and a parameter to plot_surface()
from matplotlib import cm
surf = ax.plot_surface(X, Y, Z, cmap=cm.viridis)
Pro(-ish) Tip: When you have to fight the brackets, split things across multiple lines... ... either as multiple intermediate formulas, or one (or more) multi-line expressions.
Consider:
Z = np.clip(
abs(
gamma( X + 1j * Y )
),
0,
10
)
Books have been written on writhing solid code (in fact, I have a book with that as a title). There are many ways to guard yourself from the pitfalls of misplace punctuation. There have to be; misplaced punctuation can be quite painful. Oh, and then there are editors that highlight and make it easy to jump between matching brackets.
Wonderful video. Thanks!!
FYI: Another way to write a+bi in python is complex(a,b). You can write any constant followed by j (like 4j) to get the imaginary part of a number, but you can't put a variable there, because bj would be a different variable name.
"If I cannot build it, I don't understand it."
- Richard Furman
Thank you so much for this. Where did you hear it?
It's from Richard Feynman (it was left written on his office blackboard after he died). I actually slightly misquoted: "What I cannot create, I do not understand" - a quick google will find the image of his blackboard - e.g. www.quora.com/What-did-Richard-Feynman-mean-when-he-said-What-I-cannot-create-I-do-not-understand
I've rarely started code from scratch in practice. I usually open something related in some way and edit it down and copy paste it up. That's also how I write homework and exams :p
Yes, when I started recording the python bit I was realising it was probably the first (and likely only) time I ever typed in the import commands, rather than copying them from another file...
AFAIK meshgrid is like a cartesian product so you get all the different xy pairs, which you can then use as inputs to your function.
Thanks Ben, great video
Omg learned so much. Thanks!!!
Nice work as always 😊
Very interesting and insightful video!
19:25 that's a third of all pros
People think I'm crazy, but I came to Perl from the Bash world, and the two overlap. So, I do my math stuff in Perl (Mandelbrot lately), which people think is nutz. But, so be it. Cheers.
In engineering, imaginary numbers use 'j' and not i, because 'i' is for electrical current.
Nice little info nugget!
And in physics, we use 'j' for electrical current because 'i' is the imaginary unit!
Engineering is cursed with traditions like this, similar to the fact that we consider current to flow opposite the direction of electron movement
@@nikolausluhrs I think "cursed" is the wrong word, but I get what you mean.
madlad Ben writing python on IDLE lol
Wha'chu got against IDLE? I've written C# and SQL in notepad before xD
Ben sparks has his own channel and only now finding out ? Disgraceful!
Don't apologise for your (working!) code. I don't apologise for my (working!) noob math.