pyyaml Questions

3

I am trying to parse a helm chart YAML file using python. The file contains some curly braces, that's why I am unable to parse the YAML file. a sample YAML file apiVersion: v1 kind: ConfigMap metad...
Negotiant asked 20/8, 2020 at 7:49

4

Solved

Well, I'm playing with pyYAML. I installed the version for Python 2.7 with the Windows installer. It imports just fine: import yaml and it throws no errors. But, if I do this: import yaml f ...
Goods asked 15/2, 2012 at 1:16

6

Solved

I've been working with a the PyYAML parser for a few months now to convert file types as part of a data pipeline. I've found the parser to be quite idiosyncratic at times and it seems that today I'...
Terse asked 6/4, 2016 at 22:36

4

Solved

I just got a MacBook, cloned the project I was working on, and went to set up the python environment. After creating the environment, I updated pip and tried installing the necessary libraries usin...
Stainless asked 17/7, 2023 at 19:13

3

Solved

I am currently loading a YAML file like this import yaml yaml.load('''level0: stuff: string0 level1: stuff: string1 level2: ...''') The code above creates nested dictionaries. Instead of...
Charlottcharlotta asked 14/4, 2016 at 17:4

4

Solved

I'd like to have a YAML config file for certain analysis settings for my Python script. The YAML file looks something like this: settings: param1: 1 param2: two ... In my Python script, I wan...
Stauder asked 23/2, 2016 at 23:30

3

Solved

In the code below I created the net_plan_dict variable dictionary and converted it into a YAML format file. Inside the dictionary I have a field called addresses which is an array of three elements...
Nathalie asked 14/2, 2020 at 13:0

13

I have one script in which I am trying to execute python3 env/common_config/add_imagepullsecret.py But, I am getting the following error: [root@kevin]# python3 env/common_config/add_imagepull...
Pharmaceutical asked 15/6, 2018 at 2:20

4

Solved

I need to write the below data to yaml file using Python: {"A": "a", "B": {"C": "c", "D": "d", "E": "e"}} ...
Horseflesh asked 18/9, 2012 at 5:4

14

Solved

I have a Python program that uses YAML. I attempted to install it on a new server using pip install yaml and it returns the following: $ sudo pip install yaml Downloading/unpacking yaml Could not...
Seedy asked 10/1, 2013 at 15:42

10

Solved

I am building a django-react site and suddenly my docker-compose no longer builds despite any changes to requirements or image versions. My requirements.txt looks as follows: Django>=3.2.4,<4...
Biotechnology asked 17/7, 2023 at 21:57

5

Solved

I have a yaml file that looks like this: # The following key opens a door key: value Is there a way I can load and dump this data while maintaining the comment?
Calyptra asked 31/8, 2011 at 10:50

7

Solved

I've got an object with a short string attribute, and a long multi-line string attribute. I want to write the short string as a YAML quoted scalar, and the multi-line string as a literal scalar: m...
Cila asked 27/12, 2011 at 3:49

7

Solved

I am on ubunty 64 with python 2.7 and using PyYAML-3.10 Below is my yaml file: host:localhost username:root password:test database:test operations_database:operations treeroot: branch1: name: N...
Pulverulent asked 29/1, 2012 at 17:57

5

Solved

I am trying to do a regular import in Google Colab. This import worked up until now. If I try: import plotly.express as px or import pingouin as pg I get an error: -------------------------------...
Forgat asked 14/10, 2021 at 3:41

2

Solved

I'm using YAML for a computer and human-editable and readable input format for a simulator. For human readability, some parts of the input are mostly amenable to block style, while flow style suits...
Standpoint asked 22/12, 2012 at 7:19

4

Solved

When I load a number with e form a JSON dump with YAML, the number is loaded as a string and not a float. I think this simple example can explain my problem. import json import yaml In [1]: impo...
Jarrodjarrow asked 26/5, 2015 at 12:45

6

Solved

I have the following YAML file named input.yaml: cities: 1: [0,0] 2: [4,0] 3: [0,4] 4: [4,4] 5: [2,2] 6: [6,2] highways: - [1,2] - [1,3] - [1,5] - [2,4] - [3,4] - [5,4] start: 1 end: 4...
Headship asked 18/9, 2016 at 0:32

2

YAML appears to be more readable than a JSON formatted object, apart from readability what advantages or disadvantages does PyAML have instead of JSON? How should we make a decision between t...
Colb asked 23/8, 2013 at 5:47

3

Solved

The yaml library in python is not able to detect duplicated keys. This is a bug that has been reported years ago and there is not a fix yet. I would like to find a decent workaround to this proble...
Triplex asked 3/11, 2015 at 3:26

1

When using PyYAML to save a NumPy array in a YAML file, it by default adds a whole lot of metadata such that it can restore the actual array when loading the file. Example: import numpy as np impor...
Lidalidah asked 20/2, 2023 at 10:49

3

Solved

When I edit a YAML file in Python with PyYAML, all of my string values are saved back to the original file without quotes. one: valueOne two: valueTwo three: valueThree I wanted one of those str...
Zillion asked 7/5, 2016 at 22:2

3

Solved

I'm trying to debug an issue, and it boils down to... >>> import yaml as pyyaml >>> import ruamel.yaml as ruamel >>> ruamel.load("x: yes") == ruamel.load("x: true") Fals...
Phonemics asked 27/8, 2019 at 21:49

2

Solved

In searching around the web for usages of custom constructors I see things like this: def some_constructor(loader, node): value = loader.construct_mapping(node, deep=True) return SomeClass(value...
Unconventional asked 5/5, 2017 at 18:56

2

import yaml import pandas as pd data = ['apple','car','smash','market','washing'] bata = ['natural','artificail','intelligence','outstanding','brain'] df = pd.DataFrame(zip(data,bata),columns=['D...
Ninepins asked 17/3, 2021 at 6:18

© 2022 - 2025 — McMap. All rights reserved.