Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandas Return Cell position containing string

I am new to data analysis , I wand to find cell position which containing input string.

example:

Price   | Rate p/lot |  Total Comm|
 947.2      1.25        CAD 1.25

 129.3      2.1         CAD 1.25

 161.69     0.8         CAD 2.00

How do I find position of string "CAD 2.00". Required output is (2,2)

like image 598
Piyush S. Wanare Avatar asked Dec 18 '22 00:12

Piyush S. Wanare


1 Answers

In [353]: rows, cols = np.where(df == 'CAD 2.00')

In [354]: rows
Out[354]: array([2], dtype=int64)

In [355]: cols
Out[355]: array([2], dtype=int64)
like image 60
MaxU - stop WAR against UA Avatar answered Jun 18 '23 10:06

MaxU - stop WAR against UA