1
$\begingroup$

Below is an Excel sheet with crops and countries. "1" means that the crop is grown in that country whiles "0" means it is not grown in that country.

I want to find where there is an intersection (as in I want to find similar crops that are grown in most of the countries or at least most of the countries.) How do I do this ?

Snapshot of spreadsheet with crops and the countries they are grown in

$\endgroup$
1
$\begingroup$

Suppose that you want to know the name of countries with more than ten Ginger:

# read your data using pd.read_csv and specify appropriate inputs based on your excel file in a typical variable named csvFile and transpose it
csvFile = csvFile[csvFile['Ginger'] > 10]

Also if you want to see the countries with zero Ginger:

csvFile = csvFile[csvFile['Ginger'] == 0]
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.