我有一个数据框df,其架构看起来像 -
root
|-- users: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- id: string (nullable = true)
| | |-- ok: boolean (nullable = true)
| | |-- attributes: struct (nullable = true)
| | | |-- array1: array (nullable = true)
| | | | |-- element: string (containsNull = true)
| | | |-- groupid: string (nullable = true)
| | | |-- array2: array (nullable = true)
| | | | |-- element: string (containsNull = true)
| | | |-- array3: array (nullable = true)
| | | | |-- element: string (containsNull = true)
| | | |-- array4: array (nullable = true)
| | | | |-- element: string (containsNull = true)
我想访问和分析array1,array2,array3,array4的值。 我正在努力:
df.users.attributes.array1
它给了我一个错误 -
AttributeError: 'Series' object has no attribute 'attributes'
我如何能够访问这些数组中的值/数据 - array1,array2,array3和array4?