在熊猫中如何删除数字序列中的列?

时间:2018-08-09 20:23:49

标签: python pandas

在python 3和pandas中,我具有数据框:

informacao1.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 5 entries, 0 to 4
Data columns (total 36 columns):
uf_x                               5 non-null object
cargo                              5 non-null object
nome_completo_x                    5 non-null object
sequencial                         5 non-null object
numero_urna                        5 non-null int64
cpf                                5 non-null object
nome_urna                          5 non-null object
situacao_cand                      5 non-null object
partido_eleicao                    5 non-null object
ocupacao                           5 non-null object
data_nascimento                    5 non-null object
nome                               5 non-null object
nome_completo_y                    5 non-null object
partido                            5 non-null object
uf_y                               5 non-null object
cargo_parlamentar                  5 non-null object
tipo                               5 non-null object
classe                             5 non-null object
numero                             5 non-null int64
único                              5 non-null object
assunto                            5 non-null object
data_inicial                       5 non-null object
data_final                         5 non-null object
andamento                          5 non-null object
link                               5 non-null object
transparencia                      5 non-null object
conferencia                        5 non-null object
data_conferencia                   5 non-null object
resumo                             5 non-null object
observacao                         5 non-null object
link_noticia_tribunal_confiavel    3 non-null object
interessa                          5 non-null object
ministro_relator                   5 non-null object
processo_conectado                 0 non-null object
situacao                           5 non-null object
cadastro_push                      5 non-null object
dtypes: int64(2), object(34)
memory usage: 1.4+ KB

我需要从第11列中删除所有列(第一个列为零):然后删除nome,nome_completo_y,partido,(...),situacao和cadastro_push

仅保留前十个:uf_x,cargo,nome_completo_x,sequencial,numero_urna,cpf,nome_urna,situacao_cand,partido_eleicao,ocupacao和data_nascimento

请,有没有办法删除序列中的列?

0 个答案:

没有答案