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)
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