Removing non zero cells from pandas dataframe and also removing index | بلاگ

Removing non zero cells from pandas dataframe and also removing index

تعرفه تبلیغات در سایت

آخرین مطالب

امکانات وب

Vote count: 0

I have a dataframe looks like this

  Z1  Z2  Z3 Z4
   0   0   A  A
   0   B   0  0
   C   0   C  0
   D   0   D  0
   0   0   E  0 

I want to remove the cells whose value is 0 and make it to look like this

  Z1  Z2  Z3 Z4
  C   B   A  A
  D       C  
          D  
          E  
asked 37 secs ago
Rookie_123

...
نویسنده : استخدام کار بازدید : 9 تاريخ : سه شنبه 24 بهمن 1396 ساعت: 19:51