Welcome to the Simplilearn Community

Want to join the rest of our members? Sign up right away!

Sign Up

Data Science with Python|Apr 3-May 8|Kritika Verma

Hi Everyone,

Please use this community thread for your Data Science with Python discussion.

Regards,
Simplilearn
Kindly provide updated drive link for downloading second day class of Session 2and also share another reference e books other than mentioned in resources.
Binod Kumar
 
Kindly provide updated drive link for downloading second day class of Session 2 and also share another reference e books other than mentioned in resources.
Binod Kumar
 
Hi Kritika,

You stated in class that one can use this code to export data to a csv file : df.to_csv("submission.csv",index=False) #to save csv file. My question is, do you have to specify the path?
 
Hi Kritika,

I keep getting this error for pandas_profiling

ModuleNotFoundError Traceback (most recent call last)
<ipython-input-60-c03a24be5f20> in <module>
1 import numpy as np
2 import pandas as pd
----> 3 from pandas_profiling import ProfileReport

ModuleNotFoundError: No module named 'pandas_profiling'

Can you help?
 

Elam

Member
Hi Kritika,

I keep getting this error for pandas_profiling

ModuleNotFoundError Traceback (most recent call last)
<ipython-input-60-c03a24be5f20> in <module>
1 import numpy as np
2 import pandas as pd
----> 3 from pandas_profiling import ProfileReport

ModuleNotFoundError: No module named 'pandas_profiling'

Can you help?
you need to install pandas_profiling library, you can run it with the following command in your jupytor notebook :
!pip install pandas-profiling
 
Last edited:

Elam

Member
Hi Kritika,

You stated in class that one can use this code to export data to a csv file : df.to_csv("submission.csv",index=False) #to save csv file. My question is, do you have to specify the path?
if you do not specify any path, it will save it to the current directory that you have opened your notebook.
 
Hi Kritika,

You stated in class that one can use this code to export data to a csv file : df.to_csv("submission.csv",index=False) #to save csv file. My question is, do you have to specify the path?
You can specify the path otherwise it will save to your current location where your notebook is.
 
Hi Kritika,

I keep getting this error for pandas_profiling

ModuleNotFoundError Traceback (most recent call last)
<ipython-input-60-c03a24be5f20> in <module>
1 import numpy as np
2 import pandas as pd
----> 3 from pandas_profiling import ProfileReport

ModuleNotFoundError: No module named 'pandas_profiling'

Can you help?
Try installing the module first. You can use this - !pip install pandas-profiling
 
Hi Kritika,
please can u help me..after writing this code it is showing.........TypeError: 'list' object is not callable
can u suggest me what wrong I m doing

country=["USA","India","UK","German"]
gdp=[34,45,34,57]
for i in range(len(country)):
city=country
gdp_city=gdp
print("The country {} and gdp is {}".format(city,gdp_city))
 
Hi Kritika,
please can u help me..after writing this code it is showing.........TypeError: 'list' object is not callable
can u suggest me what wrong I m doing

country=["USA","India","UK","German"]
gdp=[34,45,34,57]
for i in range(len(country)):
city=country
gdp_city=gdp
print("The country {} and gdp is {}".format(city,gdp_city))
Hi Arti. Could you please help me with what you want to do here? Do you want to iterate over country and gdp list and print the country and its gdp?
 
Hi There,

I am going through the codes and I want to understand why the random_state = 2. Can you please explain it for me, I think I missed to understanding in class?

See codes below:

import sklearn
from sklearn.model_selection import train_test_split
X_train, X_test, Y_train, Y_test = sklearn.model_selection.train_test_split(
X,Y,random_state=2,test_size=0.3)
 
Hello Leslie - train_test_split method divides the given data into 2 groups (Train and Test) on a RANDOM basis. Now this means that every time you execute this method, the output (i mean the values in train and test) would be different.

But in case you want the output to be repeated, i.e.. same ( for testing purposes or for teaching purposes ), then you can add an optional argument called "random_state" to this function call. If you include this argument and provide a value like 2, then your output and my output (assuming that we use the same X and Y) would be the same. I hope this explanation helps you.

Warm Regards
Vijay
 

Vaishali_26

Well-Known Member
Alumni
Hi all,

I am attaching the codes and notes of May 2nd session here.
 

Attachments

  • DataVisualization.txt
    1.8 KB · Views: 22
Hi instructors, while downloading the data files I'm getting html files due to which I'm not able to proceed.
Please help me with this.
 
Hi Vijay,
I tried doing the same but getting error repeatedly.


Hi @Harsh Kandpal - That's strange. What's the error you are getting?



I have pasted the code that I used below and marked it as spoiler. If you would prefer to deduce this yourself, please feel free to ignore the spoiler section.

I have converted the Created Date and Closed Date columns to datetime using the to_datetime function in pandas, and then just subtracted the 2 datetime columns to get the time difference. I also converted the time difference to hours.


Python:
service_requests['Created Date_DT'] = pd.to_datetime(service_requests['Created Date'])
service_requests['Closed Date_DT'] = pd.to_datetime(service_requests['Closed Date'])
service_requests['Request_Closing_Time_DT'] = (service_requests['Closed Date_DT'] - service_requests['Created Date_DT'])
service_requests['Request_Closing_Time'] = service_requests['Request_Closing_Time_DT'] / np.timedelta64(1, 'h')

Warm Regards
Vijay
 

Babita Bhardwaj

New Member
Hi Vijay,
I tried doing the same but getting error repeatedly.
Hi Harsh,

I hope error is fixed for you. Just now observed the comments so thought to add inputs incase its helpful. Error is coming as in Closed date column there are app 2k null values so apply date time operation on that is causing error, get rid of nulls either by replacing those with some default values or removing and then applying date time operation will work fine.

Thanks,
Babita B
 
Can anyone help me with project 1 on the below point?

  1. Order the complaint types based on the average ‘Request_Closing_Time’, grouping them for different locations.
 
Sir,
Due to illness (Corona) I was not able to download the matter trough drive link.Therefore, I may request to provide link for Data Science with Python April 3 - May 8 Taught by the trainer Kritika Vrma
 

Rajat_Kumar

Administrator
Staff member
Simplilearn Support
Alumni
Sir,
Due to illness (Corona) I was not able to download the matter trough drive link.Therefore, I may request to provide link for Data Science with Python April 3 - May 8 Taught by the trainer Kritika Vrma.

https://drive.google.com/drive/folders/1sulInf5srPELCFEdK1loPYP8ZI0uvQZL.

Mentioned Link is no longer accessible. I have to submit the project, hence, link have to be made accessible..
Pls. look into the matter positively.
Can anyone help binod here ? Binod feel free to reach to us via help and support in case of further concerns!

Please follow the steps below to raise
"Help and support" ticket.
>Login to LMS account,
>Select "help" icon on the top right hand side of the LMS page
>Select any query example: unlocking the certificate
>Connect to "Arya" the virtual assistant
>Select "other"
>To raise a ticket select " yes"
 
Top