Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -73,7 +73,8 @@ def asubmit(aparam): | |
| 73 | 
             
            	from sklearn.linear_model import LinearRegression
         | 
| 74 | 
             
            # Creating a Linear Regression model on our data
         | 
| 75 | 
             
            	lin = LinearRegression()
         | 
| 76 | 
            -
            	lin.fit(adf3[['Date']].astype('int32'), adf3['Celsius'])
         | 
|  | |
| 77 | 
             
            # Creating a plot
         | 
| 78 | 
             
            	ax = adf3.plot.scatter(x='Date', y='Celsius', alpha=.1)
         | 
| 79 | 
             
            	ax.plot(adf3['Date'], lin.predict(adf3[['Date']]), c='r')
         | 
| @@ -92,4 +93,3 @@ aoption = acontainer1.selectbox( | |
| 92 | 
             
            )
         | 
| 93 | 
             
            if acontainer2.button("Submit") == True:
         | 
| 94 | 
             
            	asubmit(aparam={"aselected":aoption,"acontainer":acontainer3,"adataframe":adf,"acolumntitles":['Date','Celsius'],})
         | 
| 95 | 
            -
             | 
|  | |
| 73 | 
             
            	from sklearn.linear_model import LinearRegression
         | 
| 74 | 
             
            # Creating a Linear Regression model on our data
         | 
| 75 | 
             
            	lin = LinearRegression()
         | 
| 76 | 
            +
            #	lin.fit(adf3[['Date']].astype('float').astype('int32'), adf3['Celsius'])
         | 
| 77 | 
            +
            	lin.fit(pd.to_numeric(adf3[['Date']]), adf3['Celsius'])
         | 
| 78 | 
             
            # Creating a plot
         | 
| 79 | 
             
            	ax = adf3.plot.scatter(x='Date', y='Celsius', alpha=.1)
         | 
| 80 | 
             
            	ax.plot(adf3['Date'], lin.predict(adf3[['Date']]), c='r')
         | 
|  | |
| 93 | 
             
            )
         | 
| 94 | 
             
            if acontainer2.button("Submit") == True:
         | 
| 95 | 
             
            	asubmit(aparam={"aselected":aoption,"acontainer":acontainer3,"adataframe":adf,"acolumntitles":['Date','Celsius'],})
         | 
|  | 
