You are killing it. Thanks for the thorough explanation
@j8ahmed3 жыл бұрын
That was a great explanation. Thanks a ton!
@atolantis3 жыл бұрын
That was very helpful and clear, thank you
@somecrispywater11463 жыл бұрын
That was very helpful! Thank you!! :)
@standman0077 ай бұрын
This was extremely helpful. I verified with excel and my equations match perfectly. Thanks, from the bottom of my heart. with value of 1 i got the same Linear equation. with value of 2 i got the same Polynomial equation - for example curve = np.polyfit(x,y,1)
@alice-gv5ue3 жыл бұрын
Thanks, finally I understood difference between polyfit and poly1d, I was just wondering why they use 2 functions...
@nedasadati63852 жыл бұрын
it was very useful. thanks!
@martinx17832 жыл бұрын
That helps a lot, thanks
@dm32483 жыл бұрын
Very helpful!!
@mohammedthahaabdulshukoor43214 жыл бұрын
good explanation
@tomgt4283 жыл бұрын
So cool
@felipeemerson40504 жыл бұрын
Thanks
@kaaehtla3 жыл бұрын
great
@keshav3472 жыл бұрын
Could you please explain how i can use this function if i have 3 dimensions [x,y,z] how can i fit a curve in 3d. as i would like to compute the radius of curvature by fitting a curve. Thanks in advance.
@SomeOne-rx2xw2 жыл бұрын
Thank you sir
@yousfoss43673 жыл бұрын
thks a lot
@Justin-yc5jt3 жыл бұрын
tysm
@dontaskme16253 жыл бұрын
the pythonic way to create an array with the values from 1 to 20 is [x for x in range(1,21)]
@AMGaweda3 жыл бұрын
While [x for x in range(1,21)] will create the 1 to 20 list, I would not consider it the "pythonic way". Plus, for many students, they've only recently learned about lists, so adding a one-line trick for creating lists, while nice, can be confusing to some students. Its not to say you shouldn't do it, but when teaching a separate concept, its better to reduce extra complexities.
@tony_joris3 жыл бұрын
hello! I need to get the potential and logarithmic equation from a data table, what command can I use instead of polyfit? thanks!
@AMGaweda3 жыл бұрын
My biggest recommendation would be to look through NumPy's documentation: numpy.org/doc/stable/reference/routines.polynomials.html which may point you to the the particular equation you're looking for. If it is not there, then I'd recommend looking into other Python libraries that may do. Worse comes to worse, there's always the "build it yourself" approach
@Ingeniosamente Жыл бұрын
Muy interesante el video. Qué editor utilizas?. En todos los editores es posible usar esta funcion?
@AMGaweda Жыл бұрын
Disculpas por el lenguaje, estoy usando Google Translate. Utilizo GIMP con una tableta Wacom para dibujar en mi pantalla: mi paleta de colores se creó a partir de FlatUIColors.com (v1) y mi pincel es `Hardness 100` tamaño 2 con Smooth Stroke habilitado y configurado en 20. Para grabar videos, uso OBS (obsproject.com/) sin ninguna otra edición de video. Tengo mis botones F8 y F9 configurados para iniciar y detener la grabación. En este video, usé Spyder para la programación configurada desde la distribución de Anaconda (anaconda.org/), pero en el pasado también usé otros editores de texto. También uso Sublime Text con complementos de autocompletado de Python, pero VS Code también puede funcionar.
@joacimjohnsson3 жыл бұрын
Can you use this curvfit for statistical fitting, like Normal dist/ exponential dist/ ... instead of the deg 2?
@AMGaweda3 жыл бұрын
Polyfit is a "least squares polynomial fitting" algorithm, so you are able to increase (or decrease) the curve's degree as necessary. It will not do this for you, but you can adjust the number or add more code that checks the curves precision.
@aritraray25013 жыл бұрын
Hello, how can I find the area inside a curve? I have data points for a hysteresis loop and I want to calculate the area inside the curve.
@AMGaweda3 жыл бұрын
You'd want to look into the SciPy's Integrate function; here is a video that might help kzbin.info/www/bejne/sHyul6pnjNCIqpY
@Soo53013 жыл бұрын
What if the x axis is date? How can i deal with in this case?
@AMGaweda3 жыл бұрын
In this case, you'd need to create a normal list from 0 to how ever many dates you have in mind. Think of this like a graph in math class - you still need to specify what the x-axis in your graph is (even if its dates). If you then need to plot the graph, you can modify the x-axis's display with MatPlotLib's set_xlabel function.
@abigailwaring47202 жыл бұрын
Hi, how would you do this using data in a pandas data frame of two columns please?
@AMGaweda2 жыл бұрын
The quickest way I've found to extract a list from a DataFrame is to do something like x = list(df["x"]). Then you should be able to use the approach from the video
@Alpharabius993 жыл бұрын
What if i want to plot variable data sets of x but with the same y axis. İmagine 10 data sets of x's and one data set of y. İts like one data set of x toone data set of y in the video. But what if i want to fit the curve for various data sets of x axis with only one y axis? Ofcourse i can do it one by one. But there should be some quick way to do this right? İt seems pointless to run this code for 10 times for different x Data sets.
@AMGaweda3 жыл бұрын
My thoughts are that you could use a for loop to change your x, curve, and plot with your y outside of the loop. Something like: datasets = [[123],[4,5,6],[7,8,9]] # your X datasets y = [1,2,3] # your Y for x in datasets: curve = np.polyfit(x, y) # creates your curve on each X one at a time poly = np.poly1d(curve) # makes that curve an np.array # plot your datasets plt.show() # outside the for loop This would condense your code to only need to do the calculations "once" for each X dataset along the same Y. Also, since plt.show() is outside the for loop, all of your plotting would be done on the same graphic (you could also use subplots here instead depending on what you are looking for)
@Alpharabius993 жыл бұрын
@@AMGaweda Thanks for the reply man. Wasnt expecting :). İ will post again after i try it.