Weijie1996
commited on
Commit
•
0d7fdda
1
Parent(s):
b7757df
Update README.md
Browse files
README.md
CHANGED
@@ -6,4 +6,62 @@ language:
|
|
6 |
- en
|
7 |
size_categories:
|
8 |
- n<1K
|
9 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
- en
|
7 |
size_categories:
|
8 |
- n<1K
|
9 |
+
---
|
10 |
+
|
11 |
+
|
12 |
+
# Timeseries Data Processing
|
13 |
+
|
14 |
+
This repository contains a script for loading and processing timeseries data using the `datasets` library and converting it to a pandas DataFrame for further analysis.
|
15 |
+
|
16 |
+
## Dataset
|
17 |
+
|
18 |
+
The dataset used in this example is `Weijie1996/load_timeseries`, which contains timeseries data with the following features:
|
19 |
+
- `id`
|
20 |
+
- `datetime`
|
21 |
+
- `target`
|
22 |
+
- `category`
|
23 |
+
|
24 |
+
## Requirements
|
25 |
+
|
26 |
+
- Python 3.6+
|
27 |
+
- `datasets` library
|
28 |
+
- `pandas` library
|
29 |
+
|
30 |
+
You can install the required libraries using pip:
|
31 |
+
|
32 |
+
```sh
|
33 |
+
pip install datasets pandas
|
34 |
+
```
|
35 |
+
|
36 |
+
## Usage
|
37 |
+
|
38 |
+
The following example demonstrates how to load the dataset and convert it to a pandas DataFrame.
|
39 |
+
|
40 |
+
```python
|
41 |
+
import datasets
|
42 |
+
import pandas as pd
|
43 |
+
|
44 |
+
# Load the dataset
|
45 |
+
ds = datasets.load_dataset("Weijie1996/load_timeseries", split="train")
|
46 |
+
|
47 |
+
# Convert the dataset to a pandas DataFrame
|
48 |
+
df = ds.to_pandas()
|
49 |
+
|
50 |
+
# Display the first few rows of the DataFrame
|
51 |
+
print(df.head())
|
52 |
+
|
53 |
+
# Optional: Display basic info about the DataFrame
|
54 |
+
print(df.info())
|
55 |
+
print(df.describe())
|
56 |
+
```
|
57 |
+
|
58 |
+
## Output
|
59 |
+
``` data
|
60 |
+
id datetime target category
|
61 |
+
0 NL_1 2013-01-01 00:00:00 0.117475 60m
|
62 |
+
1 NL_1 2013-01-01 01:00:00 0.104347 60m
|
63 |
+
2 NL_1 2013-01-01 02:00:00 0.103173 60m
|
64 |
+
3 NL_1 2013-01-01 03:00:00 0.101686 60m
|
65 |
+
4 NL_1 2013-01-01 04:00:00 0.099632 60m
|
66 |
+
```
|
67 |
+
|