Overview - DataFrames
For Data Scientists, a common format for storing and managing data in Python is using Pandas DataFrames.
Kelvin has a convenient function to convert your Kelvin data into a Pandas DataFrame.
Example
Here is a simple example to retrieve data from the Kelvin Platform and convert it into a Pandas DataFrame for further analysis and manipulation.
| DataFrame Python Example |
|---|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 | from kelvin.api.client import Client
# Login
client = Client(url="https://<url.kelvin.ai>", username="<your_username>")
client.login(password="<your_password>")
# Get Time Series Data
response = client.timeseries.get_timeseries_range(
data={
"start_time": "2025-04-18T12:00:00.000000Z",
"end_time": "2025-04-19T12:00:00.000000Z",
"selectors": [
{
"resource": "krn:ad:pcp_01/casing_pressure",
}
]
}
)
# Convert the response into a Pandas DataFrame
df = response.to_df()
# Print the result
print(df)
|