This is a comprehensive repository containing 35 notebooks on Python programming, data analysis, data visualization, classical machine learning, and much more.
With Pyplot, you can use the scatter() function to draw a scatter plot.
The scatter() function plots one dot for each observation.
💠 Result
The observation in this example is the result of 13 cars passing by.
The X-axis shows how old the car is.
The Y-axis shows the speed of the car when it passes.
💠 Compare Plots
In the example above, there seems to be a relationship between speed and age, but what if we plot the observations from another day as well? Will the scatter plot tell us something else?
🔷 Data Management - Adding & Updating Records to a Table
To fill a table in MySQL, use the "INSERT INTO" statement.
Insert a record in the "customers" table:
💠 Insert Multiple Rows
To insert multiple rows into a table, use the executemany() method.
The second parameter of the executemany() method is a list of tuples, containing the data you want to insert:
💠 Get Inserted ID
You can get the id of the row you just inserted by asking the cursor object. If you insert more than one row, the id of the last inserted row is returned.