Welcome to the Simplilearn Community

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

Sign Up

Data Science with Python | Aug 9-Sep 27| Nishant Saraswat

_59191

Member
Hi,
I have tried to experiment with the project # 2 (Movie Ratings). Attached is the code for the same.
I need some help with the following:
  1. Determine the features affecting the ratings of any particular movie.
  2. Develop an appropriate model to predict the movie ratings

Thank you.

Regards,
Amit
 

Attachments

  • project2-code.pdf
    180.2 KB · Views: 12

Afzal Shaikh

Active Member
I had to reduce the size because apparently 2mb is too large for a file size. So that is the reason for bad quali

Hii guys
My jupiter notebook is taking soo much time to execute my code i'm not getting where the prblm is? Any suggestions plzz..
Make sure it says "Trusted" on top right corner of your noteboook, if iy says "Not Trusted" you can change it by clicking on it. Make sure that you enough free resource's(Ram, CPU, hard disk) for your notebook to run on. if this doesn't solve your problem try to run it from command line and share the screenshot.
 

Afzal Shaikh

Active Member
Complete Project 4: Retail analysis with Walmart Data.
Sir, your feedback would be appreciated.
 

Attachments

  • Walmart4.pdf
    636.5 KB · Views: 13

AAHELI CHANDA

Member
Alumni
Checkout my posts, i have completed project 4.
If that doesn't help you let me know what you need help with.
Can you please help me with this ques:
  • Some holidays have a negative impact on sales. Find out holidays which have higher sales than the mean sales in non-holiday season for all stores together

I am getting nan for super bowl
 

Afzal Shaikh

Active Member
Can you please help me with this ques:
  • Some holidays have a negative impact on sales. Find out holidays which have higher sales than the mean sales in non-holiday season for all stores together

I am getting nan for super bowl
Thats not supposed to happen, can you share your code?
 

Afzal Shaikh

Active Member
Its because the dataset is inaccurate, for some dates it has a format of YYYY-MM-DD and for some it has YYYY-DD-MM. An easy fix would we to interchange the values of days and months.
 

Attachments

  • Query_AC1.PNG
    Query_AC1.PNG
    4.6 KB · Views: 5
  • Query_AC.PNG
    Query_AC.PNG
    10 KB · Views: 8

AAHELI CHANDA

Member
Alumni
Its because the dataset is inaccurate, for some dates it has a format of YYYY-MM-DD and for some it has YYYY-DD-MM. An easy fix would we to interchange the values of days and months.
Can you walk me through this question please? I am stuck on this particular one only.
It will be of great help
 

AAHELI CHANDA

Member
Alumni
The code you were writing is correct but you will have to swap the month and day value for superbowl1,2,3,4 in your code. It will work fine.
thank you so much. :)

another thing, if you look at this, here the dates result are not coming correct. Any idea why?
 

Attachments

  • Screenshot (12).png
    Screenshot (12).png
    246.4 KB · Views: 9
Hi Sir,

Good Evening.

How are you?. I need your help regarding the project Comcast Telecom Consumer Complaints. When I am trying with the column Date_month_year then I am able to process further. But when I have take Date field and changes into Date Time format and set the index to Date. Till here it is fine, but when I am trying to group by based on the Date then I am getting below error, can you please let me know why we cannot work on the Date field of the file.

1630415381357.png

Please let me know why I am getting this error even after changing the type to DateTime.

Regards,
M.Ramana Murthy.
 

Afzal Shaikh

Active Member
see, first 2 date format is YYYY-DD-MM but from third onwards it is YYYY-MM-DD
I dont know exactly why this is happening but i have a theory. The default format of date is MM/DD/YYYY. when the pandas first sees 5, 12 in first and second entry respectively it considers them as months instead of days. When it moves further it gets a value which is greater than 12 in the first position so it automatically changes to DD/MM/YYYY.
 

AAHELI CHANDA

Member
Alumni
I dont know exactly why this is happening but i have a theory. The default format of date is MM/DD/YYYY. when the pandas first sees 5, 12 in first and second entry respectively it considers them as months instead of days. When it moves further it gets a value which is greater than 12 in the first position so it automatically changes to DD/MM/YYYY.
oh, okay. Thanks for all the help. Much appreciated.
 
Hello I have a question The last class on python live classes I didn't get any of my time to count. Can anyone help me find out why or how this is this way ?
 
Hello Can anybody give solution to the following problem:
whenever I try to import pandas I get following error:

import pandas as pd

AttributeError Traceback (most recent call last)
<ipython-input-80-7dd3504c366f> in <module>
----> 1 import pandas as pd

~\anaconda3\lib\site-packages\pandas\__init__.py in <module>
9 for dependency in hard_dependencies:
10 try:
---> 11 __import__(dependency)
12 except ImportError as e:
13 missing_dependencies.append(f"{dependency}: {e}")

~\anaconda3\lib\site-packages\numpy\__init__.py in <module>
216 from .core import round, abs, max, min
217 # now that numpy modules are imported, can initialize limits
--> 218 core.getlimits._register_known_types()
219
220 __all__.extend(['__version__', 'show_config'])

~\anaconda3\lib\site-packages\numpy\core\getlimits.py in _register_known_types()
160 with numeric.errstate(all='ignore'):
161 huge_f128 = (ld(1) - epsneg_f128) / tiny_f128 * ld(4)
--> 162 float128_ma = MachArLike(ld,
163 machep=-112,
164 negep=-113,

~\anaconda3\lib\site-packages\numpy\core\getlimits.py in __init__(self, ftype, eps, epsneg, huge, tiny, ibeta, **kwargs)
51 self.precision = int(-log10(self.eps))
52 self.resolution = float_to_float(float_conv(10) ** (-self.precision))
---> 53 self._str_eps = float_to_str(self.eps)
54 self._str_epsneg = float_to_str(self.epsneg)
55 self._str_xmin = float_to_str(self.xmin)

~\anaconda3\lib\site-packages\numpy\core\getlimits.py in <lambda>(v)
39 float_conv = lambda v: array([v], ftype)
40 float_to_float = lambda v : _fr1(float_conv(v))
---> 41 float_to_str = lambda v: (params['fmt'] % array(_fr0(v)[0], ftype))
42
43 self.title = params['title']

~\anaconda3\lib\site-packages\numpy\core\arrayprint.py in _array_str_implementation(a, max_line_width, precision, suppress_small, array2string)
1513 # for which indexing with () returns a 0d instead of a scalar by using
1514 # ndarray's getindex. Also guard against recursive 0d object arrays.
-> 1515 return _guarded_repr_or_str(np.ndarray.__getitem__(a, ()))
1516
1517 return array2string(a, max_line_width, precision, suppress_small, ' ', "")

AttributeError: module 'numpy' has no attribute 'ndarray'
 
Hi, can anyone upload the 13th-day video? The past class has disappeared and I missed downloading the 13th-day video. Want to review the class before attempting the questions. And do anyone know if we can attempt the test multiple times?
 
Hello Can anybody give solution to the following problem:
whenever I try to import pandas I get following error:

import pandas as pd

AttributeError Traceback (most recent call last)
<ipython-input-80-7dd3504c366f> in <module>
----> 1 import pandas as pd

~\anaconda3\lib\site-packages\pandas\__init__.py in <module>
9 for dependency in hard_dependencies:
10 try:
---> 11 __import__(dependency)
12 except ImportError as e:
13 missing_dependencies.append(f"{dependency}: {e}")

~\anaconda3\lib\site-packages\numpy\__init__.py in <module>
216 from .core import round, abs, max, min
217 # now that numpy modules are imported, can initialize limits
--> 218 core.getlimits._register_known_types()
219
220 __all__.extend(['__version__', 'show_config'])

~\anaconda3\lib\site-packages\numpy\core\getlimits.py in _register_known_types()
160 with numeric.errstate(all='ignore'):
161 huge_f128 = (ld(1) - epsneg_f128) / tiny_f128 * ld(4)
--> 162 float128_ma = MachArLike(ld,
163 machep=-112,
164 negep=-113,

~\anaconda3\lib\site-packages\numpy\core\getlimits.py in __init__(self, ftype, eps, epsneg, huge, tiny, ibeta, **kwargs)
51 self.precision = int(-log10(self.eps))
52 self.resolution = float_to_float(float_conv(10) ** (-self.precision))
---> 53 self._str_eps = float_to_str(self.eps)
54 self._str_epsneg = float_to_str(self.epsneg)
55 self._str_xmin = float_to_str(self.xmin)

~\anaconda3\lib\site-packages\numpy\core\getlimits.py in <lambda>(v)
39 float_conv = lambda v: array([v], ftype)
40 float_to_float = lambda v : _fr1(float_conv(v))
---> 41 float_to_str = lambda v: (params['fmt'] % array(_fr0(v)[0], ftype))
42
43 self.title = params['title']

~\anaconda3\lib\site-packages\numpy\core\arrayprint.py in _array_str_implementation(a, max_line_width, precision, suppress_small, array2string)
1513 # for which indexing with () returns a 0d instead of a scalar by using
1514 # ndarray's getindex. Also guard against recursive 0d object arrays.
-> 1515 return _guarded_repr_or_str(np.ndarray.__getitem__(a, ()))
1516
1517 return array2string(a, max_line_width, precision, suppress_small, ' ', "")

AttributeError: module 'numpy' has no attribute 'ndarray'
You seems to be using ipython? Please use Jupyter notebook it has preloaded Pandas, you can use import pandas and it will work.
In case you are facing problem in jupyter notebook , you can use conda to update jupyter to new version. Go to Anaconda prompt and type conda update jupyter or if jupyter is not installed use pip install -U jupyter.
 

Revathi_17

Administrator
Simplilearn Support
Customer
Hi, can anyone upload the 13th-day video? The past class has disappeared and I missed downloading the 13th-day video. Want to review the class before attempting the questions. And do anyone know if we can attempt the test multiple times?
It will be uploaded soon.
 
In Project 2 unable to open the .dat file for movies.dat, opened other movies file is not uploading
here is my code
movies = pd.read_csv(r'C:\Users\sony\Desktop\PAssign\movies.dat', sep ='::' , names=['movieid','title','genre'])
 
Earlier error solved by pasting ,encoding="ISO-8859-1"
movies = pd.read_csv(r'C:\Users\sony\Desktop\PAssign\movies.dat', sep ='::' , names=['movieid','title','genre'] ,encoding="ISO-8859-1")
I was getting utf-8 error
 
df=df.sort_values(by='Date')

--------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-71-465db0aeff88> in <module>
----> 1 df=df.sort_values(by='Date')

AttributeError: 'AxesSubplot' object has no attribute 'sort_values'

Hi Sir,

Please help me with this error, I am trying to sort values from date column but it says AxesSubplot object has no attribute i am using only sort_values, kindly help with this ..
 

Afzal Shaikh

Active Member
Okay but to where to get a grade on what iv done?? to get the certifications I need before it ends. Thank you for keeping in touch!
When you submit a project, pass the test, watch the recorded videos and have a good live class attendance you will get your certificate. You can check what you have not completed by clicking on certificate tab in the course.
 
Top