Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Jz pandas example #432

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions examples/tutorial_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
def main(host='localhost', port=8086):
user = 'root'
password = 'root'
dbname = 'example'
dbname = 'demo'
# Temporarily used to avoid line protocol time conversion issues #412, #426, #431.
protocol = 'json'

client = DataFrameClient(host, port, user, password, dbname)
Expand All @@ -21,16 +22,16 @@ def main(host='localhost', port=8086):
client.create_database(dbname)

print("Write DataFrame")
client.write_points(df, 'demo')
client.write_points(df, 'demo', protocol=protocol)

print("Write DataFrame with Tags")
client.write_points(df, 'demo', {'k1': 'v1', 'k2': 'v2'})
client.write_points(df, 'demo', {'k1': 'v1', 'k2': 'v2'}, protocol=protocol)

print("Read DataFrame")
client.query("select * from demo")

print("Delete database: " + dbname)
client.delete_database(dbname)
client.drop_database(dbname)


def parse_args():
Expand Down