Questions tagged [coursera-api]

For questions about the Coursera App Platform, accessed programmatically.

Use this tag if you have questions about programming against the Coursera App Platform.

Do not use this tag for any problem you may have with homework for a Coursera course. Just use language and technology specific tags, there is no need to tag your question with the site you are using to learn.

74 questions
0
votes
0 answers

i am getting bad input in line 8. I am able to run it in Atom but its showing an error in py4e site which i have to use in my coursera

largest = None smallest = None while True: num = input("Enter a number: ") try: numm = int(num) if largest is None: largest = numm elif numm>largest: largest = numm if smallest is…
0
votes
0 answers

Problem faced in reading an xlsx file in R

I am currently using R on a Windows 10 laptop. I have downloaded an xlsx file in the working directory. After loading the xlsx package, whenever I am trying to read the file using the read.xlsx, it is showing me this error : Error in…
0
votes
0 answers

"Unknown signal 11" problem while submitting the code to coursera. Problem gets resolved if I use a 2-D vector instead of a 2-D array

Task. Given gold bars, find the maximum weight of gold that fits into a bag of capacity . Input Format. The first line of the input contains the capacity of a knapsack and the number of bars of gold. The next line contains integers 0,1, . . .…
0
votes
1 answer

Code works well on my computer but I am getting unknown signal 11 problem while submitting it to coursera

Task. Given a set of segments {[0, 0], [1, 1], . . . , [−1, −1]} with integer coordinates on a line, find the minimum number of points such that each segment contains at least one point. That is, find a set of integers of the minimum size such…
0
votes
1 answer

Use the trained k-NN classifier model to classify new, previously unseen objects

fruit_prediction = knn.predict([[20, 4.3, 5.5]]) lookup_fruit_name[fruit_prediction[0]] I am not able to run above two lines. I am getting this kind of error ValueError: query data dimension must match training data dimension
0
votes
1 answer

have a question in sql in coursera. the following code is showing an error

question-Write and run a query, with no starter code or hints to answer this question: What is the step for Union Code 990 and a Set ID of SFMTA or COMMN? name of the table- salary_range_by_job_classification my answer code- SELECT…
user13299024
0
votes
1 answer

AttributeError: 'module' object has no attribute 'PROTOCOL_TLSv1_2' on windows when using coursera-dl package

i wanted to download from coursera using coursera-dl package on windows it kept giving that message AttributeError: 'module' object has no attribute 'PROTOCOL_TLSv1_2' so i searched through stackoverflow and found this here which says that i have…
user11045864
0
votes
1 answer

JSONDecodeError: Expecting value: line 1 column 1 (char 0)"

Here is the code.. address_input = input("Enter location: ") params = {"sensor": "false", "address": address_input} serviceurl = "http://py4e-data.dr-chuck.net/json?" url = serviceurl + urllib.parse.urlencode(params) print("Retrieving ", url) data =…
user8487038
0
votes
0 answers

Sbt cannot synchronize the project because it cannot be compiled

I am quite at the beginner level so I would gladly accept some help to solve this problem... I am using IntelliJ IDEA 2018.2.5 Sbt version: 1.2.6 JDK version: 1.8.0_191-b12 Scala is used as IntelliJ plugin (the most recent). When I load the sbt…
0
votes
0 answers

Pyspark dataproc job failure

I got below error log while submitting the pyspark dataproc job on creating recommendations. 18/09/15 06:11:36 INFO org.spark_project.jetty.server.Server: jetty-9.3.z-SNAPSHOT 18/09/15 06:11:36 …
0
votes
3 answers

calculates highest count words across lines error in ruby coursera

it's almost 2 weeks now I can't remove this from my head. I'm a newbie in ruby and I'm stuck with this last bit of Ruby on Rails an introduction course on coursera. It'll certainly be easy to figure out what's wrong here but I need help to finish…
0
votes
1 answer

Angular jsonp request coursera api giving error

The following error is given when I try to request coursera api with jsonp method in Angular. Refused to execute script from 'https://api.coursera.org/api/courses.v1?callback=angular.callbacks._0' because its MIME type ('application/json') is…
Invictus
  • 139
  • 3
  • 16
0
votes
0 answers

To save files after changing the name using Java - with methods from edu.duke library

I have recently started learning how to code in Java from coursera.org. But I am unable to progress further as I am not able to figure out my code doesnt work. This code changes the name and saves the file with the new name. public class Copyfile…
0
votes
1 answer

Dynamically assign unique id value to hyperlink onclick event

I am trying to iterate through a JSON response object to create a list of Category Items. I am trying to assign the unique Category ID value to each hyperlink so that when a user clicks on the hyperlink they will go to a page 2 and the page will…
0
votes
1 answer

Convert a document with Play Json

I have a list of courses from coursera api: {"elements":[ {"id":69, "shortName":"contraception", "name":"Contraception: Choices, Culture and Consequences", "links":{} }, ... ] } I want to convert it to a document that look…
Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272