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

Improve performance on dataframe to line conversion #486

Merged
merged 1 commit into from
Aug 11, 2017
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
13 changes: 3 additions & 10 deletions influxdb/_dataframe_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,17 +302,10 @@ def _convert_dataframe_to_lines(self,
tag_df = self._stringify_dataframe(
tag_df, numeric_precision, datatype='tag')

# prepend tag keys
tag_df = tag_df.apply(
lambda s: s.apply(
lambda v, l: l + '=' + v if v else None, l=s.name))

# join tags, but leave out None values
# join preprendded tags, leaving None values out
tags = tag_df.apply(
lambda r: ','.join(r.dropna()), axis=1)

# prepend comma
tags = tags.apply(lambda v: ',' + v if v else '')
lambda s: [',' + s.name + '=' + v if v else '' for v in s])
tags = tags.sum(axis=1)

del tag_df
else:
Expand Down
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