修改pysp的structfield中的列

2024-10-03 09:10:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个带模式的df:

root
 |-- AddressBook: struct (nullable = true)
 |    |-- ContactInformationsList: array (nullable = true)
 |    |    |-- element: struct (containsNull = true)
 |    |    |    |-- ContactId: string (nullable = true)
 |    |    |    |-- ContactMeansDesc: string (nullable = true)
 |    |    |    |-- IsPrimaryMeans: boolean (nullable = true)
 |    |    |    |-- TypeMeansContactId: string (nullable = true)
 |    |    |    |-- Value: string (nullable = true)
 |    |-- PersonData: struct (nullable = true)
 |    |    |-- BirthDate: string (nullable = true)
 |    |    |-- CSP: string (nullable = true)
 |    |    |-- Civility: string (nullable = true)
 |    |    |-- FirstName: string (nullable = true)
 |    |    |-- Gender: string (nullable = true)
 |    |    |-- LastName: string (nullable = true)
 |    |    |-- MaritalStatus: string (nullable = true)
 |    |    |-- SBirthDate: string (nullable = true)
 |    |    |-- Title: string (nullable = true)
 |-- PublicId: string (nullable = true)
 |-- Version: long (nullable = true)

此数据帧包含prod数据,因此我想更改一些个人信息。{cd1>基本上用列的值替换。在

我试过了:

^{pr2}$

但它只是增加了另一列:

|-- AddressBook.Persondata.Lastname: int (nullable = true)

有没有一个简单的方法来修改我的数据?在


Tags: 数据truedfstring模式rootelementarray