Spaces:
Paused
Paused
Download app/modules/load_boost_data.py from elopezlopez/socialboost: direct link, hf CLI and curl.
- Browser
- Download file 354 Bytes
-
https://huggingface.co/spaces/elopezlopez/socialboost/resolve/main/app/modules/load_boost_data.py
- Command line
-
hf download hf://spaces/elopezlopez/socialboost/app/modules/load_boost_data.py
-
curl -L -o load_boost_data.py https://huggingface.co/spaces/elopezlopez/socialboost/resolve/main/app/modules/load_boost_data.py
354 Bytes
| def load_csv_to_dict(filename): | |
| """Loads a CSV file into a list of dictionaries.""" | |
| with open(filename, mode='r', newline='', encoding='utf-8') as file: | |
| # Create a DictReader object | |
| dict_reader = csv.DictReader(file) | |
| # Convert DictReader to a list of dictionaries | |
| data_list = list(dict_reader) | |
| return data_list |