Skip to content

Commit b47362c

Browse files
techaddictedxginn8
authored andcommitted
Fix pandas example (influxdata#547)
Current example code raises KeyError: '[0] not in index' and can be fixed by adding columns=['0'] to the DataFrame creation. Fixed issue influxdata#497
1 parent a26b39f commit b47362c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/tutorial_pandas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def main(host='localhost', port=8086):
2020
print("Create pandas DataFrame")
2121
df = pd.DataFrame(data=list(range(30)),
2222
index=pd.date_range(start='2014-11-16',
23-
periods=30, freq='H'))
23+
periods=30, freq='H'), columns=['0'])
2424

2525
print("Create database: " + dbname)
2626
client.create_database(dbname)

0 commit comments

Comments
 (0)