For those who used the provided script and received the AttributeError: 'DataFrame' object has no attribute 'append', here is an alternative (paste after components=pd.DataFrame(zip(X.columns,coef),columns=['component','value'])): # Create a DataFrame for the intercept intercept_df = pd.DataFrame({'component': ['intercept'], 'value': [lin.intercept_]}) # Concatenate the intercept DataFrame with the components DataFrame components = pd.concat([components, intercept_df], ignore_index=True)
Excelente contenido . Estoy intentando replicar el ejercicio pero en las 3 ultimas lineas del codigo : 20-23 # Create Coefficients.... Me arroja el siguiente error "AttributeError: 'DataFrame' object has no attribute 'append' " Esto se debe a que mi version de Pandas es 2.0.1 y no permite el append ? Me puede ayudar con esto 🙏 Saludos
Very well explained. Do you know how can we simulate the results of a black box model (such as random forest, which do not have a formula unlike linear regression) in order to predict the y variable by changing the new x variables?
I used to connect to SQL with Python using ODBC connection on my local PC. Maybe you could use that to connect in PowerBi, but I would suggest connecting directly to ODBC within PowerBI. import pandas as pd import pyodbc server = 'server adres' database = 'database name' username = 'username' with open ('pw.txt', 'r') as f: pw = f.read() #store the credentials in a pw text file in the same folder. conn = pyodbc.connect('DRIVER={SQL Server };SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ pw) sql = 'SELECT * from TABLE;' # enter your query here data = pd.read_sql_query(sql, conn)
Thanks -that is good. However, u move so fast, I could not tell how u created that dashboard??? Is it in Python? Also, u didn't show the standard errors and t-stats for the regression nor R-square - how can u do that? Thanks
When I run the python script in Power BI I get two columns. Column 1 has Components, Dataset, X, X_test and X_train and the second value has "Table" written in front of each Column 1 items. In the video it show TV, Podcast, RU-vid and intercept. Please help!
Can I have the PBIX file please . The content of the video is really awesome. If I can get the PBIX then it may help me in clearing one of the interview scheduled on day after tomorrow.
@@absentdata : Well I can do it. But the thing is I don't have any clue for the individual indicators for each and every category where we are displaying certain value associated with each and every category. EX - TV, RU-vid. Can you tell me is there any formula you are using to display or what is the field you are using there to display and any filter associated with it. Kindly make the full video as you have not explained the entire report.
I ha seen your sentiment code which motivated me to work on the translation of message we receive. Following python code i used which worked well: import pandas as pd from googletrans import Translator translator = Translator() dataset['City_English'] = dataset['Message'].map(lambda x: translator.translate(x, src="zh-TW", dest="ur").text) I need your help now, I want to detect language column which just give the language detection. I worked a lot but vain full. I am using this code but not working: import pandas as pd langdetect import detect word5= detect() #f=word5.detect_language() dataset['City English'] = dataset['Message'].apply(lambda x: word5.detect_language(x)) Please guide me to resolve the issue. Regards, Jamal Qamar