AI and DS Skills

 View Only
  • 1.  Need Help with Course Exploratory Data Analysis for Machine Learning

    Posted Mon October 18, 2021 11:23 PM

    I'm trying to work through the first Watson Studio lab step in this self-paced class.

    I'm struggling with the step to get my Jupyter Notebook to read from the sqlite3 db file.  Right now it's failing to read the file but not clear what it expects to be in place.

    These topics are new to me and it would be great to have someone more experienced I could exchange Q&A with.

    Is there anyone out there?



    ------------------------------
    MARK JEYNES
    ------------------------------

    #AIandDSSkills
    #DataandAILearning


  • 2.  RE: Need Help with Course Exploratory Data Analysis for Machine Learning

    Posted Tue October 19, 2021 11:57 AM
    Hi Mark! Let's try to troubleshoot your notebook. Did you run it cell by cell? Until what cell does it run without errors?
    Can you paste any screenshot of the part that is not working?

    Thanks!
    -Miguel

    ------------------------------
    Miguel Maldonado
    ------------------------------



  • 3.  RE: Need Help with Course Exploratory Data Analysis for Machine Learning

    Posted Tue October 19, 2021 03:56 PM
    Edited by System Fri January 20, 2023 04:28 PM
    #Assuming you uploaded database.db to assets
    # for project_lib more https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/project-lib-python.html

    from project_lib import Project
    project = Project(project_id='your_project_id', project_access_token='your_tocken')
    pc = project.project_context

    import sqlite3
    sqlitedb=project.get_file('database.db')
    conn = sqlite3.connect(sqlitedb)
    c = conn.cursor()
    c.execute("CREATE TABLE IF NOT EXISTS stuffToPlot(unix REAL, datestamp TEXT, keyword TEXT, value REAL)")
    c.execute("INSERT INTO stuffToPlot VALUES(1452549219,'2016-01-11 13:53:39','Python',6)")

    c.execute("select * from stuffToPlot")
    queryresult=c.fetchall()
    print(queryresult)
    conn.commit()
    c.close()
    conn.close()
    ​​

    ------------------------------
    John Gakhokidze
    NPO Torino SRL /CloudZBridge USA
    ------------------------------



  • 4.  RE: Need Help with Course Exploratory Data Analysis for Machine Learning

    IBM Champion
    Posted Tue October 19, 2021 07:52 PM
    Hi Mark, 
    I am also learning here, maybe I can help.
    To start Copy/Paste the bit of code that is giving you problems and show where you think the problem is. Thanks.

    ------------------------------
    Oscar Herrera
    ------------------------------