Advertisement
lcsjuniorsi

csv pandas

Dec 31st, 2021
1,568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. df = pd.read_csv(
  4.   "f.txt",
  5.   sep = '\s+',
  6.   header = None,
  7.   names=range(1818)
  8. )
  9.  
  10. print((df > 0.05).values.sum())
  11.  
  12. x = 0
  13. for i in range(df.shape[0]):
  14.   for j in range(df.shape[1]):
  15.     value = df.at[i, j]
  16.     if value > 0.05:
  17.       x = x+1
  18.     #print(value)
  19.   #print()
  20. print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement