<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Using pymldb Tutorial
Interactions with MLDB occurs via a REST API. Interacting with a REST API over HTTP from a Notebook interface can be a little bit laborious if you're using a general-purpose Python library like requests directly, so MLDB comes with a Python library called pymldb to ease the pain.
Connections
The pymldb library includes a class called Connection. The recommended usage pattern is shown here
Step1:  Accessing the REST API
Once you have a connection object, you can easily make calls to the REST API
Step2:  Here we create a dataset and insert two rows of two columns into it
Step3:  SQL Queries
Now that we have a dataset, we can use the query() method on the connection to run an SQL query and get the results back as a Pandas DataFrame
<ASSISTANT_TASK:>
Python Code:
from pymldb import Connection
mldb = Connection("http://localhost")
Explanation: Using pymldb Tutorial
Interactions with MLDB occurs via a REST API. Interacting with a REST API over HTTP from a Notebook interface can be a little bit laborious if you're using a general-purpose Python library like requests directly, so MLDB comes with a Python library called pymldb to ease the pain.
Connections
The pymldb library includes a class called Connection. The recommended usage pattern is shown here:
End of explanation
mldb.get("/v1/types")
#keyword arguments to get() are appended to the GET query string
mldb.get("/v1/types", x="y")
#dictionaries arguments to put() and post() are sent as JSON via PUT or POST
mldb.put("/v1/datasets/sample", {"type": "sparse.mutable"} ) 
Explanation: Accessing the REST API
Once you have a connection object, you can easily make calls to the REST API:
End of explanation
mldb.put( "/v1/datasets/demo",      {"type":"sparse.mutable"})
mldb.post("/v1/datasets/demo/rows", {"rowName": "first", "columns":[["a",1,0],["b",2,0]]})
mldb.post("/v1/datasets/demo/rows", {"rowName": "second", "columns":[["a",3,0],["b",4,0]]})
mldb.post("/v1/datasets/demo/commit")
Explanation: Here we create a dataset and insert two rows of two columns into it:
End of explanation
df = mldb.query("select * from demo")
print type(df)
df
Explanation: SQL Queries
Now that we have a dataset, we can use the query() method on the connection to run an SQL query and get the results back as a Pandas DataFrame:
End of explanation
<END_TASK>