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
    ------------------------------



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

    Posted Tue July 04, 2023 02:28 AM
    Edited by Ellis Brooks Tue July 04, 2023 02:29 AM

    I can definitely help you with your struggle to read from the sqlite3 database file in your Jupyter Notebook. Firstly, ensure that the file path to the database is correct and accessible.
    Additionally, make sure you have the necessary SQLite library installed in your environment. You can try using the sqlite3.connect() method to establish a connection to the database file.
    If you're still facing issues, please provide more details about the error message or code you're using, so I can assist you further. What specific error are you encountering?



    ------------------------------
    Ellis Brooks
    ------------------------------



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

    IBM Champion
    Posted Tue July 18, 2023 07:07 AM

    To get started, ensure that you have imported the necessary libraries, such as sqlite3 or any other required modules, in your Jupyter Notebook. Also, double-check that the sqlite3 database file is in the correct directory or path accessible to your notebook.



    ------------------------------
    Youssef Sbai Idrissi
    Software Engineer
    ------------------------------