File size: 3,206 Bytes
7a0a9ba
 
 
 
 
 
 
cffe56d
 
7a0a9ba
cffe56d
 
7a0a9ba
cffe56d
 
7a0a9ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---

pretty_name: YouTube Trending Video Statistics 2019-04-15 to 2020-04-15 TsFile
language:
- en
tags:
- tabular
- youtube
- tsd
- trending videos
- tsfile
- modality:timeseries
modality:
- timeseries
size_categories:
- 1M<n<10M
---


# youtube_trending_2019_2020



This repository contains a TsFile conversion of the Hugging Face dataset

[`jettisonthenet/timeseries_trending_youtube_videos_2019-04-15_to_2020-04-15`](https://huggingface.co/datasets/jettisonthenet/timeseries_trending_youtube_videos_2019-04-15_to_2020-04-15).



The source dataset card / Viewer identifies the dataset as a YouTube trending

video time-series dataset. The source repository contains `videostats.csv` and

the Hugging Face Viewer exposes the `default/train` split with about 1.54M rows.

The locally downloaded source file used for this conversion contains 1,541,128

rows.



## Original Dataset



- Original dataset: <https://huggingface.co/datasets/jettisonthenet/timeseries_trending_youtube_videos_2019-04-15_to_2020-04-15>

- Source file used for conversion: `videostats.csv`

- Split used: `train`

- Local downloaded rows: 1,541,128

- Distinct `ytvideoid` values in the downloaded file: 11,369

- Time range in the downloaded file: `2019-04-15 04:42:49` to `2020-04-14 23:31:06`



The original columns are:



| Column | Description used in this conversion |

|---|---|

| `videostatsid` | Source row/statistics identifier |

| `ytvideoid` | YouTube video identifier |

| `views` | View count |

| `comments` | Comment count |

| `likes` | Like count |

| `dislikes` | Dislike count |

| `timestamp` | Source timestamp |



The source dataset does not contain video files, frames, audio, thumbnails, or

other media binaries. `ytvideoid` is an identifier only.



## TsFile Conversion



The conversion was performed from the source CSV into staged Parquet and then

into TsFile using the repository workflow.



Generated files:



- `youtube_trending_2019_2020_1.tsfile`

- `youtube_trending_2019_2020_2.tsfile`



Schema-level conversion choices:



- `timestamp` was parsed into the TsFile `Time` column at millisecond precision.

- The original timestamp value was preserved as `source_timestamp_ms`.

- `ytvideoid` was declared as a TAG, so each YouTube video ID is represented as

  a separate device series.

- `views`, `comments`, `likes`, and `dislikes` were retained as `INT64` fields.

- `videostatsid` was retained as an `INT64` field for traceability.

- No original source columns were dropped.



Duplicate timestamp handling:



The source CSV contains 89 duplicate `(ytvideoid, timestamp)` pairs. TsFile

requires timestamps within one device series to be unique/ordered for reliable

import. For those duplicate pairs only, the converted `Time` value was

disambiguated by adding a zero-based millisecond offset ordered by

`videostatsid`. The unadjusted source timestamp remains available in

`source_timestamp_ms`.



## Validation



The staged Parquet file contains:



- 1,541,128 rows

- 11,369 distinct `ytvideoid` tag values

- 0 duplicate `(ytvideoid, Time)` pairs after conversion



Both generated `.tsfile` files were validated locally as present and non-empty.