Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/321.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 熊猫多索引数据帧中的计数_Python_Python 3.x_Pandas_Dataframe_Multi Index - Fatal编程技术网

Python 熊猫多索引数据帧中的计数

Python 熊猫多索引数据帧中的计数,python,python-3.x,pandas,dataframe,multi-index,Python,Python 3.x,Pandas,Dataframe,Multi Index,我有以下df2: df2 Out[94]: Symbols ADANIPORTS.NS ASIANPAINT.NS ... WIPRO.NS ZEEL.NS Date ... 2015-06-15 NaN NaN ... NaN NaN 2015-06-16 0.010160

我有以下df2:

df2
Out[94]: 
Symbols     ADANIPORTS.NS  ASIANPAINT.NS  ...  WIPRO.NS   ZEEL.NS
Date                                      ...                    
2015-06-15            NaN            NaN  ...       NaN       NaN
2015-06-16       0.010160       0.009162  ... -0.001109  0.016949
2015-06-17      -0.007024       0.008086  ...  0.011564  0.017681
2015-06-18       0.000000       0.025751  ...  0.017477 -0.011678
2015-06-19      -0.020579       0.015159  ...  0.009797 -0.019885
                  ...            ...  ...       ...       ...
2020-06-04      -0.001031      -0.048236  ...  0.023184  0.050588
2020-06-05       0.005749       0.002938  ...  0.011561  0.002918
2020-06-08       0.006302      -0.002624  ...  0.035200 -0.044374
2020-06-09       0.008010       0.004773  ... -0.035769 -0.023598
2020-06-10       0.001445      -0.003715  ... -0.006183 -0.013513

[1226 rows x 50 columns]
如何获得每天大于0.050的符号数?

用于轴1上的总和

df2.gt(0.5).sum(1)