1

# `group` must be one of 'I', 'O', 'T', 'Dn', 'Cn'

Package:
scipy
8546
Exception Class:
ValueError

## Raise code

``````    if group in ['I', 'O', 'T']:
symbol = group
order = 1
elif group[:1] in ['C', 'D'] and group[1:].isdigit():
symbol = group[:1]
order = int(group[1:])
else:
raise ValueError("`group` must be one of 'I', 'O', 'T', 'Dn', 'Cn'")

if order < 1:
raise ValueError("Group order must be positive")

axis = 'xyz'.index(axis.lower())
if symbol == 'I':
return icosahedral(cls)``````
😲  Walkingbet is Android app that pays you real bitcoins for a walking. Withdrawable real money bonus is available now, hurry up! 🚶

## Ways to fix

2

The method scipy.spatial.transform.Rotation.create_group() is used to create  a 3D rotation group.

The valid value of the group parameters are:

```'I', 'O', 'T', 'Dn', 'Cn', # here n is a postive intger.
```

These values stand for:

• I: Icosahedral group
• O: Octahedral group
• T: Tetrahedral group
• D: Dicyclic group
• C: Cyclic group

## Reproducing the error:

```\$ pipenv install scipy
```

```\$ pipenv shell
```

```from scipy.spatial.transform import Rotation
rotation = Rotation.create_group('W',axis ="X")
```

```---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-11-0135faf3e4c9> in <module>()  1 from scipy.spatial.transform import Rotation ----> 2 rotation = Rotation.create_group('W',axis ="X")
/usr/local/lib/python3.7/dist-packages/scipy/spatial/transform/rotation.py in create_group(cls, group, axis)  1653 on Wikipedia.  1654 """ -> 1655 return create_group(cls, group, axis=axis)  1656   1657 def __getitem__(self, indexer):
/usr/local/lib/python3.7/dist-packages/scipy/spatial/transform/_rotation_groups.py in create_group(cls, group, axis)  121 order = int(group[1:])  122 else: --> 123 raise ValueError("`group` must be one of 'I', 'O', 'T', 'Dn', 'Cn'")  124   125 if order < 1:
ValueError: `group` must be one of 'I', 'O', 'T', 'Dn', 'Cn'
```

## Fixed version of the code:

```from scipy.spatial.transform import Rotation
rotation = Rotation.create_group('C3',axis ="X")
```
Sep 18, 2021
kellemnegasi 31.6k