Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas df count values less than 0

In [96]:

df = pd.DataFrame({'a':randn(10), 'b':randn(10), 'c':randn(10)})
df
Out[96]:
          a         b         c
0 -0.849903  0.944912  1.285790
1 -1.038706  1.445381  0.251002
2  0.683135 -0.539052 -0.622439
3 -1.224699 -0.358541  1.361618
4 -0.087021  0.041524  0.151286
5 -0.114031 -0.201018 -0.030050
6  0.001891  1.601687 -0.040442
7  0.024954 -1.839793  0.917328
8 -1.480281  0.079342 -0.405370
9  0.167295 -1.723555 -0.033937

[10 rows x 3 columns]
In [97]:

df[df > 1.0].count()

Out[97]:
a    0
b    2
c    2
dtype: int64
Comment

PREVIOUS NEXT
Code Example
Python :: not intersection list python 
Python :: Dictionary Cache 
Python :: airflow schedule interval timezone 
Python :: Sum of all substrings of a number 
Python :: fill column based on values of another column 
Python :: error python 
Python :: django request.data 
Python :: python change label text 
Python :: private attributes python 
Python :: df.pivot_table 
Python :: python vim auto indent on paste 
Python :: open file in os python 
Python :: for in print 
Python :: dumps function in json python 
Python :: pytesseract.image_to_data(img output_type=output.dict) 
Python :: numpy dataframe 
Python :: run python in c ++ 
Python :: read variable in a string python 
Python :: python access class variable by string 
Python :: python find dir 
Python :: django admin.py date format 
Python :: tkinter transparent background 
Python :: protected vs private python 
Python :: iterate last day of months python 
Python :: how to print python exception message 
Python :: Accessing elements from a Python Nested Dictionary 
Python :: how to make a random number generator in python 
Python :: Python difference between filter and map 
Python :: python read hex file 
Python :: save variable to use in other jupyter notebook 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =