Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

load_data.py 565 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  1. import os
  2. from get_data import read_params, get_data
  3. import argparse
  4. def load_and_save(config_path):
  5. config = read_params(config_path)
  6. df = get_data(config_path)
  7. new_cols = [col.replace(" ", "_") for col in df.columns]
  8. raw_data_path = config["load_data"]["raw_dataset_csv"]
  9. df.to_csv(raw_data_path, sep=",", index=False, header=new_cols)
  10. if __name__=="__main__":
  11. args = argparse.ArgumentParser()
  12. args.add_argument("--config", default="params.yaml")
  13. parsed_args = args.parse_args()
  14. load_and_save(config_path=parsed_args.config)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...