Welcome to the Simplilearn Community

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

Sign Up

Data Science with Python | Kanth

SUNNY BHAVEEN CHANDRA

Well-Known Member
could you please suggest the best book to start data science with python?, thanks
Hey Amit,
There are a lot of books in the market but before going through them I would like to suggest you to go through the self-learning course provided by simplilearn in your LMS for data science with python as it will help you to gain more insights into the course and also in live sessions. Most of the books like
1.Hands-on Machine Learning with Scikit-Learn and TensorFlow,
2.Python for Data Analysis: Data Wrangling with Pandas, NumPy, and Ipython,
3.Python Data Science Handbook: Essential Tools for Working with Data
etc are not that beginner friendly. So go through your current course and then you can follow these books for more insights.
I hope this helps!
Regards,
Sunny
Sr. Teaching Assistant
Simplilearn
 

Fasih Ahmed

Member
Hi Kanth,

I have been trying to filter on a date column where date in csv file >= today date.
but unfortunately, I am getting an error as below
TypeError: '>' not supported between instances of 'builtin_function_or_method' and 'builtin_function_or_method'

Here is my approach

import pandas as pd
import numpy as np
import datetime as dt
Todaysdate = dt.date.today

df = pd.read_csv("Data.csv, parse_dates=['JobIDDate'], dayfirst=True")

df1 = df[(df['JobIDDate'] >= Todaysdate)]

While printing df1 getting the same error which i mentioned above.

2nd approach is
df[df'['JobIDDate'] >= Todaysdate]

Request you to please I need to read whole csv but after that i need only those records which are greater than or equal to today's date and then i would store that data into a seprate csv file.
 

Attachments

  • Data.txt
    1.8 KB · Views: 10

Fasih Ahmed

Member
Hi Kanth,

I have been trying to filter on a date column where date in csv file >= today date.
but unfortunately, I am getting an error as below
TypeError: '>' not supported between instances of 'builtin_function_or_method' and 'builtin_function_or_method'

Here is my approach

import pandas as pd
import numpy as np
import datetime as dt
Todaysdate = dt.date.today

df = pd.read_csv("Data.csv, parse_dates=['JobIDDate'], dayfirst=True")

df1 = df[(df['JobIDDate'] >= Todaysdate)]

While printing df1 getting the same error which i mentioned above.

2nd approach is
df[df'['JobIDDate'] >= Todaysdate]

Request you to please I need to read whole csv but after that i need only those records which are greater than or equal to today's date and then i would store that data into a seprate csv file.
Hi please reply.
 
Hi Armando,

Confusion matrix printed with dimensions of 5x5? unlike in sessions which is 2x2.
[[ 0 0 0 14155 0]
[ 0 0 0 27084 0]
[ 0 0 0 64852 0]
[ 0 0 0 87473 0]
[ 0 0 0 56489 0]]

Can you let me know what would have went wrong?
 

Amit_565

New Member
Hello Kanth and All,
i am fresher in coding and programming, i don't know a single word in programming , kindly help me ,how to start ,what is process i will apply ..i am so confused, i trying to understand the code logic but fails.
Anyone suggest me please ...
 
Hi Kanth..

I am not able to download the files from the google drive.
The email id associated with my simplilearn account is an outlook e-mail account.
Can you please help me with this?
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
Hi Kanth,

I have been trying to filter on a date column where date in csv file >= today date.
but unfortunately, I am getting an error as below
TypeError: '>' not supported between instances of 'builtin_function_or_method' and 'builtin_function_or_method'

Here is my approach

import pandas as pd
import numpy as np
import datetime as dt
Todaysdate = dt.date.today

df = pd.read_csv("Data.csv, parse_dates=['JobIDDate'], dayfirst=True")

df1 = df[(df['JobIDDate'] >= Todaysdate)]

While printing df1 getting the same error which i mentioned above.

2nd approach is
df[df'['JobIDDate'] >= Todaysdate]

Request you to please I need to read whole csv but after that i need only those records which are greater than or equal to today's date and then i would store that data into a seprate csv file.

Hi Fasih,

The following code will work perfectly fine-
Code:
import pandas as pd
import numpy as np
df = pd.read_csv("Data.txt", sep="\t", parse_dates = ["JobIDDate"], dayfirst=True)
Todaysdate = pd.datetime.today()
print(Todaysdate)
df1 = df[(df['JobIDDate'] >= Todaysdate)]
df1

My Comment on your code -
1. Here today is a method so instead of Todaysdate = dt.date.today use Todaysdate = dt.date.today()
2. Now no need to import datetime library separately as pandas too have the same you can check the code provided me.
3. And there were few other errors in the code that I'm sure you'll figure out. https://www.stackoverflow.com is really a good friend for many developers. :p
4. to save your CSV file you can use
Code:
 df1.to_csv("newFile.csv", index=None)

I hope this helps.

Regards,
Sunny
Sr. Teaching Assistant
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
Hi Kanth..

I am not able to download the files from the google drive.
The email id associated with my simplilearn account is an outlook e-mail account.
Can you please help me with this?
Hi Srijith,

You just need a Gmail account to access the drive whether it is registered on our website or not it doesn't matter.
I hope this helps.

Regards,
Sunny
Sr. Teaching Assistant
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
Hello Kanth and All,
i am fresher in coding and programming, i don't know a single word in programming , kindly help me ,how to start ,what is process i will apply ..i am so confused, i trying to understand the code logic but fails.
Anyone suggest me please ...
Hi Amit,

Follow our self-learning course at this URL for python programming -> https://lms.simplilearn.com/#/course/3381-Programming-with-Python-3.X
Or you can also read the following book -
Learn Python 3 The Hard Way
by Zed A.Shaw (Author)


And most importantly practice is the key! :)

I hope this will help you.

Regards,
Sunny
Sr. Teaching Assistant
 
Hi Srijith,

You just need a Gmail account to access the drive whether it is registered on our website or not it doesn't matter.
I hope this helps.

Regards,
Sunny
Sr. Teaching Assistant


Thanks Sunny for prompt reply.. I even tried with my gmail account.. But i am getting an access denied prompt.

Below is the screenshot of the prompt I get when i try to download the file from the drive.
upload_2019-6-14_20-13-4.png
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
Thanks Sunny for prompt reply.. I even tried with my gmail account.. But i am getting an access denied prompt.

Below is the screenshot of the prompt I get when I try to download the file from the drive.
View attachment 6665

Hi Srijith,

Follow these steps -
1. Press control+shift+N. This will open a new incognito window in chrome. For Firefox its control+shift+P.
2. Sign in with ur relevant account and it's done.!!! Now use that link. It should work perfectly.

And I tried this without signing in as well and I was able to access the files. Try at your end and let me know.

Regards,
Sunny
Sr. Teaching Assistant
 

Fasih Ahmed

Member
Hi Fasih,

The following code will work perfectly fine-
Code:
import pandas as pd
import numpy as np
df = pd.read_csv("Data.txt", sep="\t", parse_dates = ["JobIDDate"], dayfirst=True)
Todaysdate = pd.datetime.today()
print(Todaysdate)
df1 = df[(df['JobIDDate'] >= Todaysdate)]
df1

My Comment on your code -
1. Here today is a method so instead of Todaysdate = dt.date.today use Todaysdate = dt.date.today()
2. Now no need to import datetime library separately as pandas too have the same you can check the code provided me.
3. And there were few other errors in the code that I'm sure you'll figure out. https://www.stackoverflow.com is really a good friend for many developers. :p
4. to save your CSV file you can use
Code:
 df1.to_csv("newFile.csv", index=None)

I hope this helps.

Regards,
Sunny
Sr. Teaching Assistant
Thank you Sunny. It is working awesome.
 
Hi Srijith,

Follow these steps -
1. Press control+shift+N. This will open a new incognito window in chrome. For Firefox its control+shift+P.
2. Sign in with ur relevant account and it's done.!!! Now use that link. It should work perfectly.

And I tried this without signing in as well and I was able to access the files. Try at your end and let me know.

Regards,
Sunny
Sr. Teaching Assistant

It worked Sunny.. Thanks alot ;)
 

_54418

New Member
Can anyone help with anything related to Project 2 last part?
Project2 (Customer Service Requests Analysis) which is as follows:

Perform a statistical test for the following:

Please note: For the below statements you need to state the Null and Alternate and then provide a statistical test to accept or reject the Null Hypothesis along with the corresponding ‘p-value’.

  • Whether the average response time across complaint types is similar or not (overall)
  • Are the type of complaint or service requested and location related?
 
Hi Sunny/Kanth
Due to personal emergency i was not able to join today's class, so i am requesting for the recordings to be sent to me personal email ID tomorrow as an when ti is generated, as i have been registered from back end so did not get the option to download from website.
I also have raised the ticket for the same.
Thanks
Sanjib Ghosh
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
Hi Sunny/Kanth
Due to personal emergency i was not able to join today's class, so i am requesting for the recordings to be sent to me personal email ID tomorrow as an when ti is generated, as i have been registered from back end so did not get the option to download from website.
I also have raised the ticket for the same.
Thanks
Sanjib Ghosh

Hi Sanjib,

From now onwards all the recording links will be available in the shared google drive folder inside a spreadsheet as well.
-> https://docs.google.com/spreadsheets/d/1bZJ3DxxMCeDRtoall56wOQ3FlF35sWIWftmAhpE0CBk/edit#gid=0
you can use these links to download the recordings plus this will also help other candidates who were registered from the backend. Now no need to raise a request for this.

I hope this will help you and others.

Regards,
Sunny
Sr. Teaching Assistant
 
Hi Sanjib,

From now onwards all the recording links will be available in the shared google drive folder inside a spreadsheet as well.
-> https://docs.google.com/spreadsheets/d/1bZJ3DxxMCeDRtoall56wOQ3FlF35sWIWftmAhpE0CBk/edit#gid=0
you can use these links to download the recordings plus this will also help other candidates who were registered from the backend. Now no need to raise a request for this.

I hope this will help you and others.

Regards,
Sunny
Sr. Teaching Assistant
Thanks Sunny.
 

Neha_151

Member
Hi Sunny,

For Movie lens project

1. Top 25 movies by viewership rating-I tried this query:

Movie_Rating_User is master table

**Code**
Movie_Rating_User.groupby(["Movie_ID","User_id"])
Top_rating=Movie_Rating_User.sort_values("Rating" ,axis =0 ,ascending = False)
Top_25_Rating=print(Top_rating [0:24])

Do we need to use 'group by'on User id and Movie_id or this syntax is ok?Above code only provides top movies with rating 5 irrespective of User_id.Is this approach correct?

2. Create a separate column for each genre category with a one-hot encoding (1 and 0) whether or not the movie belongs to that genre.

My query is to split the column(GenEre) and added it back to same dataframe 'name1' but not getting expected output.

name1 = Movies[["Movie_ID","GenEre"]]
name1.set_index('Movie_ID', inplace = True)
name2 = name1["GenEre"].str.split("|", n = 4, expand = True)
 

DIVAKAR PISUPATI

Member
Alumni
Hi Sunny
I am not able access Cloud Lab as it says Limit exceeded. Please enable the same so that I can complete my project asap.

Thanks
Divakar
 
Sunny, In Project 2 Customer Service Requests Analysis, the below step is confusing to me. Can you explain what is expected

4. Order the complaint types based on the average ‘Request_Closing_Time’, grouping them for different locations.
 

_40387

Member
Hello ,

I am still struggling in Project , i was not able to create the on-hot encoding

"Create a separate column for each genre category with a one-hot encoding ( 1 and 0) whether or not the movie belongs to that genre. "

Any one managed to to the transformation to to on-hot encoding ?
 

_40387

Member
Hello ,

I am still struggling in Project , i was not able to create the on-hot encoding

"Create a separate column for each genre category with a one-hot encoding ( 1 and 0) whether or not the movie belongs to that genre. "

Any one managed to to the transformation to to on-hot encoding ?


I tried to do
sample_df = Master_df.sample(n=10) # choose sample from b publuation

G=('Adventure', 'Animation', "Children's",'Comedy','Crime','Documentary', 'Drama','Fantasy', 'Film-Noir', 'Horror','Musical','Mystery','Romance' , 'Sci-Fi','Thriller','War', 'Western')

for i in G:
sample_df= int(i in sample_df['Genres'] )

but i am getting all zeros
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
I tried to do
sample_df = Master_df.sample(n=10) # choose sample from b publuation

G=('Adventure', 'Animation', "Children's",'Comedy','Crime','Documentary', 'Drama','Fantasy', 'Film-Noir', 'Horror','Musical','Mystery','Romance' , 'Sci-Fi','Thriller','War', 'Western')

for i in G:
sample_df= int(i in sample_df['Genres'] )

but i am getting all zeros

Hi,

I'm sharing a demo code (in PDF format attached below) which will definitely help you, Try to apply this hint at your end. And if you still face this issue then connect with me over a call after 1700 hrs IST today at the toll-free no. available at the bottom of our website www.simplilearn.com

Regards,
Sunny
Sr. Teaching Assistant
 

Attachments

  • help 0 or 1 Hint_PDF.pdf
    210.7 KB · Views: 42

SUNNY BHAVEEN CHANDRA

Well-Known Member
Sunny, In Project 2 Customer Service Requests Analysis, the below step is confusing to me. Can you explain what is expected

4. Order the complaint types based on the average ‘Request_Closing_Time’, grouping them for different locations.

Hi Sandhya,

If your query is still pending then let me know a suitable time for you I will connect with you or you can also connect with me over a call at our toll-free no. available on our website.

Regards,
Sunny
Sr. Teaching Assistant
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
Hi Sunny
I am not able access Cloud Lab as it says Limit exceeded. Please enable the same so that I can complete my project asap.

Thanks
Divakar

Hi Divakar,

I checked your cloud lab and its working perfectly fine. Can you check at your end?
Although this is not the perfect place to raise this kind of issue. You can always reach out to us over a call or by raising a help and support ticket from your LMS. And also I would like to suggest you that keep a backup of your files as well on your local machine so that you don't get stuck if such technical glitch arises.

Regards,
Sunny
Sr. Teaching Assistant
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
Hi Sunny,

For Movie lens project

1. Top 25 movies by viewership rating-I tried this query:

Movie_Rating_User is master table

**Code**
Movie_Rating_User.groupby(["Movie_ID","User_id"])
Top_rating=Movie_Rating_User.sort_values("Rating" ,axis =0 ,ascending = False)
Top_25_Rating=print(Top_rating [0:24])

Do we need to use 'group by'on User id and Movie_id or this syntax is ok?Above code only provides top movies with rating 5 irrespective of User_id.Is this approach correct?

2. Create a separate column for each genre category with a one-hot encoding (1 and 0) whether or not the movie belongs to that genre.

My query is to split the column(GenEre) and added it back to same dataframe 'name1' but not getting expected output.

name1 = Movies[["Movie_ID","GenEre"]]
name1.set_index('Movie_ID', inplace = True)
name2 = name1["GenEre"].str.split("|", n = 4, expand = True)

Hi Neha,

If your query is still pending then let me know a suitable time for you I will connect with you or you can also connect with me over a call at our toll-free no. available on our website.

Regards,
Sunny
Sr. Teaching Assistant
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
I do not understand exactly about project2 Customer Service Requests Analysis
can u please help me in that?
Hi Ashok,

If your query is still pending then let me know a suitable time for you I will connect with you or you can also connect with me over a call at our toll-free no. available on our website.

Regards,
Sunny
Sr. Teaching Assistant
 

_40387

Member
Hi,

I'm sharing a demo code (in PDF format attached below) which will definitely help you, Try to apply this hint at your end. And if you still face this issue then connect with me over a call after 1700 hrs IST today at the toll-free no. available at the bottom of our website www.simplilearn.com

Regards,
Sunny
Sr. Teaching Assistant

I did something similar, your hint is much easier thank you a lot :)
 

_34601

Data Analyst
Alumni
Hi Sunny,

For the Movielens Project, should we be;
1 Using the Dataframe with Each column Genres (0/1) plus the entire Master_data to build our model
2 Should we use Logistic or Linear Regression to build the model
2. Should "Rating" be considered as Discrete or Continous variable?
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
Hi All,

Kindly reach out to us to resolve your specific query on our toll-free no. available at our website www.simplilearn.com at the bottom and connect with me or any teaching assistant available for python, they will surely help you. I have also attached a screenshot for your reference.

Note: Toll-free no. is region specific so it may change based on your geographic location. Hence for correct location follow the above-mentioned step.

Regards,
Sunny
Sr. Teaching Assistant
Simplilearn

t45.PNG
 

SUNNY BHAVEEN CHANDRA

Well-Known Member
I'm sharing a demo code (in PDF format attached below)

I'm sharing a demo code (in PDF format attached below)
Sunny , Please share your demo code as above. I could not find it in the community page.
Hi Shyam,

Greetings!

You can find all the demo code and every project mentoring session recording at the following link -
https://community.simplilearn.com/threads/ds-python-mentoring-session-sunny.47849/

Apart from this I have also pinned that thread on top of Big data and analytics forum So that it wont get lost among the other threads -
#Screenshot for your reference -
upload_2019-11-10_2-7-10.png

I hope this helps you and all others who are having any doubts in any of the projects.

Thanks and Regards,
Sunny,
Ex.Teaching Assistant
 
Top