Question: I have the following table:

```
ID   Value
1     X
1     Y
1     X
1     X
1     X
1     Y
1     X
2     X
2     Y
2     X
2     Z
2     Y
2     X

```

I need to count the number of non-Consecutive times X appears per ID. 
So My output should be: 

```
ID    COUNT
1      3
2      3     

```

Using `Select Count(*), ID From my_table where value = 'X'` calculates every occurrence of the value and not Non-Consecutive values only. 

How do I solve this?

Answer: 
You seem to have never defined `cartopy`. Perhaps `import cartopy` at the top would solve your problem.
For me, i installed cartopy package in jupyter but still it was showing error of cartopy not defined.(I was plotting the plots with cartopy.ccrs for stereographic plots)

solution: before importing and executing cartopy.ccrs just execute 'import cartopy' in the first line itself and then run the codes.It worked for me