[Swlug] help with text manipulation

bascule asura at theexcession.co.uk
Fri Jun 22 15:32:19 UTC 2018


On Thursday, 21 June 2018 16:58:35 BST bascule via Swlug wrote:
> in extract_index
>     raise ValueError('Mixing dicts with non-Series may lead to '
> ValueError: Mixing dicts with non-Series may lead to ambiguous ordering.
right, i got rid of that message by lopping off the top and bottom of the json 
file which are not of interest.

i then removed all but two entries in the json file to see if i could get the 
script to run without error, unfortunately unless i removed the (subset=....) 
part of the script i would always get:
KeyError: 'FormID'

which my googling says means that 'FormID' isn't found!
here is the test.json i'm using, note it has no duplicates in, i'm just trying 
to get the script to run without error

{
	"items" : 
	[
		{
			"ConnectedObjects" : "",
			"ExtraData" : "",
			"FormID" : "239530",
			"FormID_dec" : 2331952,
			"RemoveHavok" : 0,
			"Scale" : 1.0,
			"idx" : 0,
			"isActor" : 0,
			"isAssignable" : 0,
			"isCreated" : 0,
			"isFarmAnimal" : 0,
			"isFood" : 0,
			"isGenerator" : 1,
			"isPowered" : 0,
			"isTamedCreature" : 0,
			"isTurret" : 0,
			"isWater" : 0,
			"name" : "Generator - Windmill",
			"plugin_name" : "Fallout4.esm",
			"posX" : 48868.17578125,
			"posY" : 39018.88671875,
			"posZ" : 371.94830322265625,
			"rotX" : 0.0,
			"rotY" : 0.0,
			"rotZ" : 94.794990539550781
		},
		{
			"ConnectedObjects" : "",
			"ExtraData" : "",
			"FormID" : "030386",
			"FormID_dec" : 197510,
			"RemoveHavok" : 0,
			"Scale" : 1.0,
			"idx" : 1,
			"isActor" : 0,
			"isAssignable" : 0,
			"isCreated" : 0,
			"isFarmAnimal" : 0,
			"isFood" : 0,
			"isGenerator" : 1,
			"isPowered" : 0,
			"isTamedCreature" : 0,
			"isTurret" : 0,
			"isWater" : 0,
			"name" : "Generator - Small",
			"plugin_name" : "Fallout4.esm",
			"posX" : 48012.734375,
			"posY" : 40694.76953125,
			"posZ" : 630.52374267578125,
			"rotX" : 0.0,
			"rotY" : 0.0,
			"rotZ" : 204.53659057617187
        }
		
	]
}

bascule





More information about the Swlug mailing list