metaltiger775 commited on
Commit
27ef63e
·
1 Parent(s): fe46fa7

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -27
app.py DELETED
@@ -1,27 +0,0 @@
1
- import pandas as pd
2
- from tqdm import tqdm
3
- import os
4
-
5
- # Paths
6
- original_dataset_path = "dataset.csv"
7
- output_dataset_path = "cloned_dataset.csv"
8
- max_output_size = 4 * 1024 * 1024 * 1024 # 4GB
9
-
10
- # Read the original dataset
11
- original_df = pd.read_csv(original_dataset_path, encoding='utf-8')
12
-
13
- # Initialize variables
14
- cloned_df = pd.DataFrame(columns=original_df.columns)
15
- output_size = 0
16
-
17
- # Clone the dataset while keeping the output size under the limit
18
- for index, row in tqdm.tqdm(original_df.iterrows(), total=len(original_df), desc="Cloning"):
19
- cloned_df = cloned_df.append(row)
20
- output_size = cloned_df.memory_usage(deep=True).sum()
21
-
22
- if output_size >= max_output_size:
23
- break
24
-
25
- # Save the cloned dataset
26
- cloned_df.to_csv(output_dataset_path, index=False, encoding='utf-8')
27
- print(f"Cloned dataset saved to {output_dataset_path}")