Skip to content

Commit 54347d7

Browse files
authored
Merge pull request influxdata#432 from nicolajkirchhof/jz-pandas-example
Jz pandas example
2 parents da39921 + 449d02e commit 54347d7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/tutorial_pandas.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
def main(host='localhost', port=8086):
88
user = 'root'
99
password = 'root'
10-
dbname = 'example'
10+
dbname = 'demo'
11+
# Temporarily used to avoid line protocol time conversion issues #412, #426, #431.
1112
protocol = 'json'
1213

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

2324
print("Write DataFrame")
24-
client.write_points(df, 'demo')
25+
client.write_points(df, 'demo', protocol=protocol)
2526

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

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

3233
print("Delete database: " + dbname)
33-
client.delete_database(dbname)
34+
client.drop_database(dbname)
3435

3536

3637
def parse_args():

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy