Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python read yaml

# read_categories.py file

import yaml

with open(r'E:datacategories.yaml') as file:
    documents = yaml.full_load(file)

    for item, doc in documents.items():
        print(item, ":", doc)
Comment

read data from yaml file in python

import yaml

# Read YAML file
with open("data.yaml", 'r') as stream:
    data_loaded = yaml.safe_load(stream)
Comment

read yml file in python

{'a_key': 'a_value', 'another_key': 'another_value', 'nested_dictionary': {'nested_key': 'nested_value'}}
Comment

PREVIOUS NEXT
Code Example
Python :: remove duplicates based on two columns in dataframe 
Python :: static dirs django 
Python :: get the system boot time in python 
Python :: python number guessing game 
Python :: python download file from web 
Python :: reset index with pandas 
Python :: python get everything between two characters 
Python :: remove turtle 
Python :: python hello wrold 
Python :: remove after and before space python 
Python :: how to split string with comma in python 
Python :: mouse module python 
Python :: python pandas replace nan with null 
Python :: log base in python 
Python :: django querset group by sum 
Python :: convert categorical column to int in pandas 
Python :: python iterate over object fields 
Python :: python code to find the length of string in a list 
Python :: check if number in range 
Python :: pil image base64 
Python :: python overwrite print on same line 
Python :: cosine interpolation 
Python :: median in python 
Python :: how to make a forever loop in python 
Python :: python image to video 
Python :: remove last element from dictionary python 
Python :: python remove all except numbers 
Python :: pandas change every row to df 
Python :: openpyxl add worksheet 
Python :: python moving average time series 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =