Skip to content

Commit 472de65

Browse files
dragoshenronxginn8
authored andcommitted
Update _dataframe_client.py (influxdata#593)
Permanent error "NameError: name 'to_datetime' is not defined". Reason: to_datetime is a function defined in pandas not a method on a DataFrame. (see: https://stackoverflow.com/questions/48387878/attributeerror-dataframe-object-has-no-attribute-to-datetime) Tested with Python 3.5.3 and Pandas 0.23.0
1 parent f3c6acf commit 472de65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

influxdb/_dataframe_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def _convert_dataframe_to_json(dataframe,
236236
field_columns = list(
237237
set(dataframe.columns).difference(set(tag_columns)))
238238

239-
dataframe.index = dataframe.index.to_datetime()
239+
dataframe.index = pd.to_datetime(dataframe.index)
240240
if dataframe.index.tzinfo is None:
241241
dataframe.index = dataframe.index.tz_localize('UTC')
242242

0 commit comments

Comments
 (0)