Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code: DatasetGenerationCastError
Exception: DatasetGenerationCastError
Message: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 2 new columns ({'intake', 'rate'})
This happened while the csv dataset builder was generating data using
hf://datasets/hyeon2525/cabbage_dataset/store/cabbage_separated.csv (at revision 4a117672d29f8b7746dcb1ef8f0cb4de4a6bb9c5)
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1831, in _prepare_split_single
writer.write_table(table)
File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 714, in write_table
pa_table = table_cast(pa_table, self._schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2272, in table_cast
return cast_table_to_schema(table, schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
raise CastError(
datasets.table.CastError: Couldn't cast
year: int64
month: int64
day: int64
intake: int64
avg_price: int64
gap: int64
rate: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 1012
to
{'year': Value('int64'), 'month': Value('int64'), 'day': Value('int64'), 'avg_price': Value('int64'), 'gap': Value('int64')}
because column names don't match
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1455, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1054, in convert_to_parquet
builder.download_and_prepare(
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 894, in download_and_prepare
self._download_and_prepare(
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 970, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1702, in _prepare_split
for job_id, done, content in self._prepare_split_single(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1833, in _prepare_split_single
raise DatasetGenerationCastError.from_cast_error(
datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 2 new columns ({'intake', 'rate'})
This happened while the csv dataset builder was generating data using
hf://datasets/hyeon2525/cabbage_dataset/store/cabbage_separated.csv (at revision 4a117672d29f8b7746dcb1ef8f0cb4de4a6bb9c5)
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
year
int64 | month
int64 | day
int64 | avg_price
int64 | gap
int64 |
|---|---|---|---|---|
2,016
| 1
| 4
| 5,163
| 0
|
2,016
| 1
| 4
| 5,716
| 553
|
2,016
| 1
| 5
| 5,180
| -536
|
2,016
| 1
| 5
| 4,683
| -497
|
2,016
| 1
| 6
| 4,722
| 39
|
2,016
| 1
| 6
| 5,233
| 511
|
2,016
| 1
| 7
| 5,099
| -134
|
2,016
| 1
| 7
| 4,634
| -465
|
2,016
| 1
| 8
| 4,586
| -48
|
2,016
| 1
| 8
| 4,893
| 307
|
2,016
| 1
| 9
| 4,618
| -275
|
2,016
| 1
| 9
| 3,917
| -701
|
2,016
| 1
| 11
| 4,972
| 1,055
|
2,016
| 1
| 11
| 4,412
| -560
|
2,016
| 1
| 12
| 4,409
| -3
|
2,016
| 1
| 12
| 5,200
| 791
|
2,016
| 1
| 13
| 4,860
| -340
|
2,016
| 1
| 13
| 5,500
| 640
|
2,016
| 1
| 14
| 4,936
| -564
|
2,016
| 1
| 14
| 5,417
| 481
|
2,016
| 1
| 15
| 5,456
| 39
|
2,016
| 1
| 15
| 4,782
| -674
|
2,016
| 1
| 16
| 5,561
| 779
|
2,016
| 1
| 16
| 4,365
| -1,196
|
2,016
| 1
| 18
| 5,102
| 737
|
2,016
| 1
| 18
| 5,600
| 498
|
2,016
| 1
| 19
| 5,976
| 376
|
2,016
| 1
| 19
| 7,265
| 1,289
|
2,016
| 1
| 20
| 6,000
| -1,265
|
2,016
| 1
| 20
| 5,247
| -753
|
2,016
| 1
| 21
| 6,123
| 876
|
2,016
| 1
| 21
| 7,087
| 964
|
2,016
| 1
| 22
| 7,200
| 113
|
2,016
| 1
| 22
| 6,841
| -359
|
2,016
| 1
| 23
| 8,100
| 1,259
|
2,016
| 1
| 23
| 6,898
| -1,202
|
2,016
| 1
| 25
| 7,549
| 651
|
2,016
| 1
| 25
| 7,102
| -447
|
2,016
| 1
| 26
| 6,671
| -431
|
2,016
| 1
| 26
| 7,246
| 575
|
2,016
| 1
| 27
| 6,722
| -524
|
2,016
| 1
| 27
| 7,342
| 620
|
2,016
| 1
| 28
| 7,015
| -327
|
2,016
| 1
| 28
| 7,780
| 765
|
2,016
| 1
| 29
| 7,643
| -137
|
2,016
| 1
| 29
| 6,920
| -723
|
2,016
| 1
| 30
| 7,453
| 533
|
2,016
| 1
| 30
| 6,996
| -457
|
2,016
| 2
| 1
| 5,889
| -1,107
|
2,016
| 2
| 1
| 6,942
| 1,053
|
2,016
| 2
| 2
| 5,936
| -1,006
|
2,016
| 2
| 2
| 6,700
| 764
|
2,016
| 2
| 3
| 6,741
| 41
|
2,016
| 2
| 3
| 7,413
| 672
|
2,016
| 2
| 4
| 7,271
| -142
|
2,016
| 2
| 4
| 6,420
| -851
|
2,016
| 2
| 5
| 6,646
| 226
|
2,016
| 2
| 5
| 7,277
| 631
|
2,016
| 2
| 6
| 6,800
| -477
|
2,016
| 2
| 6
| 6,465
| -335
|
2,016
| 2
| 11
| 7,366
| 901
|
2,016
| 2
| 11
| 8,053
| 687
|
2,016
| 2
| 12
| 8,555
| 502
|
2,016
| 2
| 12
| 7,729
| -826
|
2,016
| 2
| 13
| 9,373
| 1,644
|
2,016
| 2
| 13
| 10,000
| 627
|
2,016
| 2
| 15
| 10,247
| 247
|
2,016
| 2
| 15
| 8,890
| -1,357
|
2,016
| 2
| 16
| 10,000
| 1,110
|
2,016
| 2
| 16
| 8,551
| -1,449
|
2,016
| 2
| 17
| 9,190
| 639
|
2,016
| 2
| 17
| 7,724
| -1,466
|
2,016
| 2
| 18
| 7,518
| -206
|
2,016
| 2
| 18
| 9,000
| 1,482
|
2,016
| 2
| 19
| 8,113
| -887
|
2,016
| 2
| 19
| 10,154
| 2,041
|
2,016
| 2
| 20
| 10,386
| 232
|
2,016
| 2
| 20
| 8,431
| -1,955
|
2,016
| 2
| 22
| 10,502
| 2,071
|
2,016
| 2
| 22
| 9,465
| -1,037
|
2,016
| 2
| 23
| 8,172
| -1,293
|
2,016
| 2
| 23
| 10,319
| 2,147
|
2,016
| 2
| 24
| 10,500
| 181
|
2,016
| 2
| 24
| 8,879
| -1,621
|
2,016
| 2
| 25
| 8,324
| -555
|
2,016
| 2
| 25
| 11,535
| 3,211
|
2,016
| 2
| 26
| 11,000
| -535
|
2,016
| 2
| 26
| 9,051
| -1,949
|
2,016
| 2
| 27
| 10,627
| 1,576
|
2,016
| 2
| 27
| 9,216
| -1,411
|
2,016
| 2
| 29
| 9,641
| 425
|
2,016
| 2
| 29
| 12,037
| 2,396
|
2,016
| 3
| 1
| 12,525
| 488
|
2,016
| 3
| 1
| 9,570
| -2,955
|
2,016
| 3
| 2
| 12,809
| 3,239
|
2,016
| 3
| 2
| 10,460
| -2,349
|
2,016
| 3
| 3
| 13,057
| 2,597
|
2,016
| 3
| 3
| 10,827
| -2,230
|
2,016
| 3
| 4
| 11,232
| 405
|
2,016
| 3
| 4
| 12,987
| 1,755
|
End of preview.
YAML Metadata
Warning:
empty or missing yaml metadata in repo card
(https://huggingface.co/docs/hub/datasets-cards)
Cabbage Price Analysis
배추 가격 및 반입량 데이터 분석 프로젝트
프로젝트 개요
이 프로젝트는 배추 가격 데이터와 반입량 데이터를 통합하고 분석하여 최종 CSV 파일을 생성합니다.
데이터 파일
원본 데이터
CabbagePrice.xlsx- 배추 가격 데이터 (원본)CabbagePrice2.xlsx- 배추 가격 데이터 (추가)CabbageIntake.xlsx- 배추 반입량 데이터 (원본)CabbageIntake2.xlsx- 배추 반입량 데이터 (추가)
병합 데이터
CabbagePrice_merged.xlsx- 병합된 가격 데이터CabbageIntake_merged.xlsx- 병합된 반입량 데이터
출력 데이터
store/cabbage_separated.csv- 등급별(특, 상) 분석 데이터store/cabbage_retail.csv- 소매가격 분석 데이터
스크립트 설명
1. merge_data.py
여러 개의 배추 가격 및 반입량 엑셀 파일을 병합합니다.
기능:
- CabbagePrice.xlsx와 CabbagePrice2.xlsx를 합쳐 CabbagePrice_merged.xlsx 생성
- CabbageIntake.xlsx와 CabbageIntake2.xlsx를 합쳐 CabbageIntake_merged.xlsx 생성
- 날짜(DATE) 기준으로 정렬 및 중복 제거
실행:
python merge_data.py
2. CabbageEDA.py
등급별(특, 상) 배추 가격 및 반입량 데이터를 분석하여 CSV 파일을 생성합니다.
기능:
- 등급별 필터링 (특: 5%, 상: 35%)
- 평균가격을 정수형으로 변환
- 0원 데이터 제거
- 반입량과 가격 데이터 병합
- 등급별 반입량 계산 (총반입량 × 비율)
- 날짜 분해 (year, month, day)
- 전날 대비 가격 차이(gap) 계산
- 최종 데이터를
store/cabbage_separated.csv로 저장
출력 컬럼:
year,month,day- 날짜 정보intake- 등급별 반입량avg_price- 평균 가격gap- 전날 대비 가격 차이rate- 등급 레이블 (SPECIAL, HIGH)
실행:
python CabbageEDA.py
3. CabbageRetail.py
소매가격 데이터를 분석하여 CSV 파일을 생성합니다.
기능:
- 평균가격을 정수형으로 변환
- 0원 데이터 제거
- 날짜 분해 (year, month, day)
- 전날 대비 가격 차이(gap) 계산
- 최종 데이터를
store/cabbage_retail.csv로 저장
출력 컬럼:
year,month,day- 날짜 정보avg_price- 평균 가격gap- 전날 대비 가격 차이
실행:
python CabbageRetail.py
설치 및 실행
필수 라이브러리
pip install pandas openpyxl
실행 순서
- 데이터 병합
python merge_data.py
- 등급별 데이터 분석
python CabbageEDA.py
- 소매가격 데이터 분석
python CabbageRetail.py
출력 폴더 구조
cabbage/
├── store/
│ ├── cabbage_separated.csv # 등급별 분석 결과
│ └── cabbage_retail.csv # 소매가격 분석 결과
├── CabbagePrice_merged.xlsx # 병합된 가격 데이터
└── CabbageIntake_merged.xlsx # 병합된 반입량 데이터
데이터 처리 과정
- 데이터 병합: 원본 파일들을 합쳐 중복 제거 및 정렬
- 등급 필터링: 특(5%), 상(35%) 등급만 선택
- 반입량 계산: 총반입량에 등급별 비율을 곱하여 계산
- 가격 차이 계산: 전날 대비 가격 변화량 산출
- CSV 저장: 분석 결과를 CSV 파일로 저장
주의사항
- 엑셀 파일의 가격 컬럼명이 '평균가격' 또는 '당일'이어야 합니다.
- 날짜 컬럼명은 'DATE'여야 합니다.
- 0원 데이터는 자동으로 제거됩니다.
- Downloads last month
- 14