Comments (3)
This should work:
list(zip(data.index, data))
See this StackOverflow question: https://stackoverflow.com/a/38468711/4398595
from piconnect.
The recorded_values
method returns a pandas.Series
of the data, where the timestamps of the events are the index of the series.
The way you retrieve values from the series returns only the data at that location, but not its index. More information on getting subsets of pandas
objects can be found on this page: Indexing and selecting data. If you would like to see the first 10 items of the data you could do this:
with PI.PIAFDatabase(server=servers[0],
database="Test") as database:
element = database.descendant(
r'Europe\A\B')
attribute = element.attributes['DD']
print(type(attribute))
data = attribute.recorded_values('*-5mo', '*')
print(data.head(10))
This is therefore not a bug in PIconnect
, and I will close the issue. Feel free to comment if you think the way PIconnect
returns the data is actually wrong.
from piconnect.
subset = data.head(10) is of type <class 'PIconnect.PIData.PISeries'>
cmd_output is as follows:
2017-01-12 15:04:47+01:00 204.395
2017-01-13 15:04:48+01:00 204.395
Name: Rate, dtype: object
How to convert them to (datetime, float) pairs? I tried several solutions from the internet, but it fails.
from piconnect.
Related Issues (20)
- Open PI Connection without context manager HOT 3
- _time.to_af_time_range does not parse relative times correctly
- Search for attribute by providing entire Path as String in PIAF HOT 1
- Was able to connect for a while, until the server was migrated. HOT 4
- Create Point
- Get dataset from an event frame based on time period and choose attributes
- Search PI points by name and description using queries HOT 2
- Checking that status of Multiple PI Tag HOT 1
- Error when trying to fetch the highest value of the last 30 days
- PIData.py PISeriesContainer summary
- PIAuthenticationException
- Attribute Error: AFBufferOption, tried venv, also local download how fix? HOT 1
- Time Filtered Function as in Pidatalink
- Can not connect to PI server
- Connecting to All Known Data Archive and Asset Framework Servers on Import HOT 3
- Access PI Library Tables HOT 6
- recorded_values: exists a limit for output HOT 1
- duplicate name exists on network HOT 1
- PIAFServer search not working for AF element attributes of format "BaseElement|Attribute" HOT 3
- Allow for string values for filter expressions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from piconnect.