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

get_data.py 610 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
18
19
20
21
22
23
24
  1. import os
  2. import yaml
  3. import pandas as pd
  4. import argparse
  5. def read_params(config_path):
  6. with open(config_path) as yaml_file:
  7. config = yaml.safe_load(yaml_file)
  8. return config
  9. def get_data(config_path):
  10. config = read_params(config_path)
  11. # print(config)
  12. data_path = config["data_source"]["s3_source"]
  13. df = pd.read_csv(data_path, sep=",", encoding='utf-8')
  14. return df
  15. if __name__=="__main__":
  16. args = argparse.ArgumentParser()
  17. args.add_argument("--config", default="params.yaml")
  18. parsed_args = args.parse_args()
  19. data = get_data(config_path=parsed_args.config)
Tip!

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

Comments

Loading...