“Baris drop panda” Kode Jawaban

Python: Hapus nilai spesifik dalam DataFrame

df.drop(df.index[df['myvar'] == 'specific_name'], inplace = True)
Andrea Perlato

Jatuhkan kolom dalam panda

note: df is your dataframe

df = df.drop('coloum_name',axis=1)
JAKKA9

Sumbu drop Python

df.drop(['colonna da togliere'], axis=1)
Foolish Flamingo

Jatuhkan DataFrame Kolom

df.drop(columns=['Unnamed: 0'])
Magnificent Moth

DataFrame Delete Row

df.drop(df.index[2])
Confused Cod

Baris drop panda

 current table:
  Modules	Subjects
0	DSM020	Data programming in Python
1	DSM030	Mathematics and statistics
2	DSM040	Machine learning
3	DSM010	Big data analysis
4	DSM050	Data visualisation
5	DSM060	Data science research topics
6	DSM070	Blockchain programming
7	DSM080	Mathematics of financial markets
8	DSM110	R for data science
9	DSM120	Financial data modelling
10	DSM500	Final project
11	DSM100	Artificial 

#dropping rows using indexes
list_of_subjects.drop([2,5,6,8,10,11])

output:
	Modules	Subjects
0	DSM020	Data programming in Python
1	DSM030	Mathematics and statistics
3	DSM010	Big data analysis
4	DSM050	Data visualisation
7	DSM080	Mathematics of financial markets
9	DSM120	Financial data modelling
Clever Crocodile

Jawaban yang mirip dengan “Baris drop panda”

Pertanyaan yang mirip dengan “Baris drop panda”

Lebih banyak jawaban terkait untuk “Baris drop panda” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya