I keep getting multiple errors even though my code is exactly like those in the file. One of the errors that keeps coming up is : Error: AttributeError(“‘int’ object has no attribute ‘shape’”)
Check your indentation.
- Everything after the function definition must be indented.
- The body of every for-loop within the function also must be indented.
- The indentation must match for every line within a code block.
This is the most common issue with student’s code, so please check this carefully first.
My indentation seems to be in order. Is there something else that might be the problem?
Hi @Anna_Cereneci ,
It could be a problem with passing parameter. Please check you are passing the correct parameters with correct syntax to the calling function.
I’m actually not that familiar with python( I am a total beginner). It would be a great help if it was possible to communicate through DMs regarding this assignment, as I have it due tomorrow and I’m seeing several other errors.
The course presumes you already have programming skills and at least a basic understanding of Python. It’s a rather complicated language if you are a novice programmer.
It’s too much to learn via just commenting on a specific programming assignment.
I recommend you take a tutorial course in Python programming, then come back to this course later.
Hi @Anna_Cereneci ,
The deadline for assignment is only there to help you plan your work. It will re-adjust once you resume working on the assignment.
@TMosh 's suggestion of pausing the course is really worth considering if you are serious about building a career in AI. This specialization of courses will teach you the ML algorithms and how they work, but it requires programming skills and the basics in Computer Science.
Would I get penalized if I pause the course? I have submitted this assignment a week before an d unfortunately didn’t pass it, so I had to postpone it and the deadline was today.
Do not worry about the weekly deadlines. You can move them forward - the course web pages will prompt you for this.
I do not think you can “pause” the course, so if you’re paying by monthly subscription, you may have to pay for a longer period of time.
The coursework deadlines are for your reference only - they are very very soft lines - so don’t worry about them.
However the subscription period or the trial period are the hard deadlines, beyond which you will have to pay for the next subscription to continue or you can’t cancel it and get a refund. (refund policy)
Since you are on course 1 week 2, there is a chance that you are still on the trial period, and if you are, for the best of your interest, I don’t see why you shouldn’t cancel the subscription, use the money to take a python course or just save the money for subscribing the MLS again in the future when you are more confident in Python, unless you want to learn Python and continue with the MLS at the same time.
Good luck @Anna_Cereneci!
Can you please guide me? I am getting an error “UNQ_C1 with index line is duplicated”
Also there comes an error when i upload data from ex1data1 file.
And when i edit the code a bit then comes an error :Cell #1. Can’t compile the student’s code. Error: ModuleNotFoundError(“No module named ‘pandas’”)
Hi Raymond! I got this course with a financial aid. Would that still hinder with my progress or my scholarship?
the coursework deadlines in MLS are softlines, it helps you plan. Whether it is financial aid or not does not matter. You may check this out for about the deadlines. If you have other concerns about your financial aids or future financial aids, you may contact coursera staff.
you know the best how long the aid grant you access to the course. if you can learn python and finish the MLS within the period covered by the financial aid scheme, it’s good and I don’t have any suggestions other then “just do it”.
Hi @Ayesha_Saddiqa ,
You must have made some changes to the code cell. I suggest you get a fresh copy of the file and start again. Here is a post that will guide you how to get a fresh copy of the notebook .
Thank you so much @Kic i got a fresh copy but please could you tell me that the data which is given for this assignment ex1data1 i have to read the data file through pandas library? or i can just create the arrays of given data? And secondly i should use the code cells which are already given in workspace for code samples or i should insert new cells for my code? and i should paste the same code which is given as sample?
It would be better if you start your own thread for your questions, rather than borrowing someone else’s conversation.
You do not need to add any cells. The notebook already has the cells you need to modify.
When you run all of the cells in the notebook, it will read the data for you, and it will call the functions you are completing by adding your code.
The notebook has already got the template code for you. At each code cell here your are required to add code, you will see these comment lines:
Have you done any optional labs in Week1? Prof Ng made a separated video on Python and Jupyter notebook specially for anyone who are not familiar with the Jupyter notebook environment. Those optional labs in week1 would help to give you a feel on how to work in that environment.
@Kic yes i did those optional labs and i have passed my assignment. Thanks to you!
I was getting the same error.I tried refreshing the page, it worked, all the test cases passed but when I submit the assignment it still shows the grade as 0 even when the code is appropriate. Please help!!
The grader tests your code using a totally different set of data. Your code must work in any situation, with any size of data set.
Please start a new thread for your question - if you read the origin of this thread, the topic is whether python programming experience is required for this course. It really has very little to do with a specific practice lab.
When you start your thread, please include a screen capture image showing any error or assert
messages. Also, please include the report from the grader - it will say which functions did not work correctly.
I’m going to close this thread.