Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
Jobreceive.com for sale
Blogerwiki
Updated:
Tuesday at 8:55 PM
Post Your Vehicle for Sale — FREE! - https://libro.lk
Kalu_Puth
Updated:
Tuesday at 7:38 PM
ඔයාගෙ Assignment හෝ Thesis එක හරියට හදාගමු
ErMurazor
Updated:
Saturday at 10:52 PM
Ad icon
BlackWall V2ray servers
hu KANNA
Updated:
Sep 23, 2026
Peppa Pig Family Plush Toy Set – 5 Characters
anil1961
Updated:
Sep 19, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Python වැඩ්ඩො ඉන්නවද?
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Heshankavindu" data-source="post: 20462292" data-attributes="member: 165669"><p><strong><span style="font-size: 18px"><span style="color: Red">Ureka Ureka </span></span></strong></p><p><strong></strong></p><p><strong># In[1]:</strong></p><p><strong></strong></p><p><strong>from numpy import *</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong># In[12]:</strong></p><p><strong></strong></p><p><strong>x = array([1,2,3,4,5,6,7,8,9,10,11,12])</strong></p><p><strong>y = array([0.783,0.211,0.120,-0.325,-0.470,-0.826,-1.043,-1.260,-1.314,-1.736,-2.109,-2.711])</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong># In[3]:</strong></p><p><strong></strong></p><p><strong>from scipy.interpolate import *</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong># In[15]:</strong></p><p><strong></strong></p><p><strong>p4 = polyfit(x,y,4) //fit our data(x,y) to a fourth degree polynomial</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong># In[16]:</strong></p><p><strong></strong></p><p><strong>print (p4)</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong># In[6]:</strong></p><p><strong></strong></p><p><strong>from matplotlib.pyplot import *</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong># In[7]:</strong></p><p><strong></strong></p><p><strong>%matplotlib inline</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong># In[17]:</strong></p><p><strong></strong></p><p><strong>plot(x,y,'o') //this is the plot of our data set</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong># In[18]:</strong></p><p><strong></strong></p><p><strong>plot(x,y,'o')</strong></p><p><strong>xp = linspace(0,12,1000) //devided the x line into 1000 parts for smooth p4 line by makeing an array </strong></p><p><strong>plot(xp,polyval(p4,xp),'b--') //plot p4 with xp, b=blue and --=dash line</strong></p><p><strong></strong></p><p><strong></strong></p></blockquote><p></p>
[QUOTE="Heshankavindu, post: 20462292, member: 165669"] [B][SIZE="5"][COLOR="Red"]Ureka Ureka [/COLOR][/SIZE] # In[1]: from numpy import * # In[12]: x = array([1,2,3,4,5,6,7,8,9,10,11,12]) y = array([0.783,0.211,0.120,-0.325,-0.470,-0.826,-1.043,-1.260,-1.314,-1.736,-2.109,-2.711]) # In[3]: from scipy.interpolate import * # In[15]: p4 = polyfit(x,y,4) //fit our data(x,y) to a fourth degree polynomial # In[16]: print (p4) # In[6]: from matplotlib.pyplot import * # In[7]: %matplotlib inline # In[17]: plot(x,y,'o') //this is the plot of our data set # In[18]: plot(x,y,'o') xp = linspace(0,12,1000) //devided the x line into 1000 parts for smooth p4 line by makeing an array plot(xp,polyval(p4,xp),'b--') //plot p4 with xp, b=blue and --=dash line [/B] [/QUOTE]
Insert quotes…
Verification
Hata thunen beduwama keeyada? (60 bedeema thuna)
Post reply
Top
Bottom