使用熊猫创建数据帧

时间:2021-07-06 17:16:02

标签: python pandas dataframe

我在一个 txt 文件中有将近 20000 条记录,每条记录都是这种格式的字典

Plan-expiry/10_160.json b'{"userId":10,"paymentTransactionId":1602348638905}'
Plan-expiry/11_161.json b'{"userId":11,"paymentTransactionId":1612587468258}'
Plan-expiry/12_162.json b'{"userId":12,"paymentTransactionId":1623589572478}'
Plan-expiry/13_163.json b'{"userId":13,"paymentTransactionId":1634682580747}'
Plan-expiry/14_164.json b'{"userId":14,"paymentTransactionId":1642469647427}'
Plan-expiry/15_165.json b'{"userId":15,"paymentTransactionId":1652460745327}'

从这里我想创建一个有两列的数据框 - userId 和 paymentTransactionId 我怎样才能在熊猫中实现这一点?

谢谢!

1 个答案:

答案 0 :(得分:0)

这是一种方法:

-Xopt-in=kotlin.RequiresOptIn