python - 删除顶行 2 行并将成绩单放在下面

标签 python pandas group-by nlp

处理大型数据集。我卡在数据清理阶段

这是我到目前为止所拥有的..我只想删除看起来像前两行的“问题组和反馈”

                                    Feedback
Out[39]: Issuegroup
         Accessories                Nope, just make a longer charging cord :),Everything was very helpful and nice handled,Nope, you guys are doing great,From the customer's side, th...
         Connectivity               no suggestions. Chat experience was great!,Jane was wonderful and would recommend her to a friend, she helped me get through some troubleshooting...


and output of below and if i can view the entire content of Accessories or Connectivity since i have 4,200 comments underneath           


Out[39]:                            transcript   
         Accessories                Nope, just make a longer charging cord :),Everything was very helpful and nice handled,Nope, you guys are doing great,From the customer's side, th...
         Connectivity               no suggestions. Chat experience was great!,Jane was wonderful and would recommend her to a friend, she helped me get through some troubleshooting...

最佳答案

IIUC 使用:

df = df.rename_axis(None).rename(columns={'Feedback':'transcript'})

列名称在DataFrame中始终是必需的,因此可以将其重命名为空字符串 - 但这确实是一个糟糕的技巧,不要使用它。

关于python - 删除顶行 2 行并将成绩单放在下面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59464851/

相关文章:

python - 是否可以禁用跳转到列表末尾?

python - 如何将具有空值的列转换为日期时间格式?

python - 通过 pandas 操作访问组中的特定组

ruby-on-rails - 如何将符号或数字列表分组为 # 符号

python - Pandas : Proper way to set values based on condition for subset of multiindex dataframe

python - 查找包含任何列表的 NumPy 数组行

python - 双索引 python pandas

sql - 使用 COUNT/Group By 时需要选择所有列

python退出阻塞线程?

python - 如何使用 pandas 在 ndarray 上创建索引