summaryrefslogtreecommitdiff
path: root/doc/source/user
diff options
context:
space:
mode:
authorMelissa Weber Mendonça <melissawm@gmail.com>2020-06-30 23:58:59 -0300
committerGitHub <noreply@github.com>2020-06-30 19:58:59 -0700
commit99010006fabea949d13aae8caea10abf97cbaed9 (patch)
tree9e86e2d610417c9feb9e9c71f4da89b4b1170622 /doc/source/user
parentf38073be387190b7a6db3a1e064594d0c3fd695f (diff)
downloadnumpy-99010006fabea949d13aae8caea10abf97cbaed9.tar.gz
[DOC] Added tutorial about the numpy.ma module. (#15791)
Added tutorial about the numpy.ma module.
Diffstat (limited to 'doc/source/user')
-rw-r--r--doc/source/user/tutorial-ma.rst376
-rw-r--r--doc/source/user/tutorials_index.rst1
-rw-r--r--doc/source/user/who_covid_19_sit_rep_time_series.csv115
3 files changed, 492 insertions, 0 deletions
diff --git a/doc/source/user/tutorial-ma.rst b/doc/source/user/tutorial-ma.rst
new file mode 100644
index 000000000..c28353371
--- /dev/null
+++ b/doc/source/user/tutorial-ma.rst
@@ -0,0 +1,376 @@
+=======================
+Tutorial: Masked Arrays
+=======================
+
+.. currentmodule:: numpy
+
+.. testsetup::
+
+ import numpy as np
+ np.random.seed(1)
+
+**Prerequisites**
+
+Before reading this tutorial, you should know a bit of Python. If you
+would like to refresh your memory, take a look at the
+:doc:`Python tutorial <python:tutorial/index>`.
+
+If you want to be able to run the examples in this tutorial, you should also
+have `matplotlib <https://matplotlib.org/>`_ installed on your computer.
+
+**Learner profile**
+
+This tutorial is for people who have a basic understanding of NumPy and want to
+understand how masked arrays and the :mod:`numpy.ma` module can be used in
+practice.
+
+**Learning Objectives**
+
+After this tutorial, you should be able to:
+
+- Understand what are masked arrays and how they can be created
+- Understand how to access and modify data for masked arrays
+- Decide when the use of masked arrays is appropriate in some of your
+ applications
+
+**What are masked arrays?**
+
+Consider the following problem. You have a dataset with missing or invalid
+entries. If you're doing any kind of processing on this data, and want to
+`skip` or flag these unwanted entries without just deleting them, you may have
+to use conditionals or filter your data somehow. The :mod:`numpy.ma` module
+provides some of the same funcionality of
+:class:`NumPy ndarrays <numpy.ndarray>` with added structure to ensure
+invalid entries are not used in computation.
+
+From the :mod:`Reference Guide <numpy.ma>`:
+
+ A masked array is the combination of a standard :class:`numpy.ndarray` and
+ a **mask**. A mask is either ``nomask``, indicating that no value of the
+ associated array is invalid, or an array of booleans that determines for
+ each element of the associated array whether the value is valid or not.
+ When an element of the mask is ``False``, the corresponding element of the
+ associated array is valid and is said to be unmasked. When an element of
+ the mask is ``True``, the corresponding element of the associated array is
+ said to be masked (invalid).
+
+
+We can think of a :class:`MaskedArray <numpy.ma.MaskedArray>` as a
+combination of:
+
+- Data, as a regular :class:`numpy.ndarray` of any shape or datatype;
+- A boolean mask with the same shape as the data;
+- A ``fill_value``, a value that may be used to replace the invalid entries
+ in order to return a standard :class:`numpy.ndarray`.
+
+**When can they be useful?**
+
+There are a few situations where masked arrays can be more useful than just
+eliminating the invalid entries of an array:
+
+- When you want to preserve the values you masked for later processing, without
+ copying the array;
+- When you have to handle many arrays, each with their own mask. If the mask is
+ part of the array, you avoid bugs and the code is possibly more compact;
+- When you have different flags for missing or invalid values, and wish to
+ preserve these flags without replacing them in the original dataset, but
+ exclude them from computations;
+- If you can't avoid or eliminate missing values, but don't want to deal with
+ :class:`NaN <numpy.nan>` (Not A Number) values in your operations.
+
+Masked arrays are also a good idea since the :mod:`numpy.ma` module also
+comes with a specific implementation of most :term:`NumPy universal functions
+(ufuncs) <ufunc>`, which means that you can still apply fast vectorized
+functions and operations on masked data. The output is then a masked array.
+We'll see some examples of how this works in practice below.
+
+**Using masked arrays to see COVID-19 data**
+
+From `Kaggle <https://www.kaggle.com/atilamadai/covid19>`_ it is possible to
+download a dataset with initial data about the COVID-19 outbreak in the
+beginning of 2020. We are going to look at a small subset of this data,
+contained in the file ``who_covid_19_sit_rep_time_series.csv``.
+
+.. ipython:: python
+
+ import numpy as np
+ import os
+ # The os.getcwd() function returns the current folder; you can change
+ # the filepath variable to point to the folder where you saved the .csv file
+ filepath = os.getcwd()
+ @suppress
+ filepath = os.path.join(filepath, "source", "user")
+ filename = os.path.join(filepath, "who_covid_19_sit_rep_time_series.csv")
+
+The data file contains data of different types and is organized as follows:
+
+- The first row is a header line that (mostly) describes the data in each column
+ that follow in the rows below, and beginning in the fourth column, the header
+ is the date of the observation.
+- The second through seventh row contain summary data that is of a different
+ type than that which we are going to examine, so we will need to exclude that
+ from the data with which we will work.
+- The numerical data we wish to work with begins at column 4, row 8, and extends
+ from there to the rightmost column and the lowermost row.
+
+Let's explore the data inside this file for the first 14 days of records. To
+gather data from the ``.csv`` file, we will use the :func:`numpy.genfromtxt`
+function, making sure we select only the columns with actual numbers instead of
+the first three columns which contain location data. We also skip the first 7
+rows of this file, since they contain other data we are not interested in.
+Separately, we will extract the information about dates and location for this
+data.
+
+.. ipython:: python
+
+ # Note we are using skip_header and usecols to read only portions of the
+ # data file into each variable.
+ # Read just the dates for columns 3-7 from the first row
+ dates = np.genfromtxt(filename, dtype=np.unicode_, delimiter=",",
+ max_rows=1, usecols=range(3, 17),
+ encoding="utf-8-sig")
+ # Read the names of the geographic locations from the first two
+ # columns, skipping the first seven rows
+ locations = np.genfromtxt(filename, dtype=np.unicode_, delimiter=",",
+ skip_header=7, usecols=(0, 1),
+ encoding="utf-8-sig")
+ # Read the numeric data from just the first 14 days
+ nbcases = np.genfromtxt(filename, dtype=np.int_, delimiter=",",
+ skip_header=7, usecols=range(3, 17),
+ encoding="utf-8-sig")
+
+Included in the :func:`numpy.genfromtxt` function call, we have selected the
+:class:`numpy.dtype` for each subset of the data (either an integer -
+:class:`numpy.int_` - or a string of characters - :class:`numpy.unicode_`). We
+have also used the ``encoding`` argument to select ``utf-8-sig`` as the encoding
+for the file (read more about encoding in the `official Python documentation
+<https://docs.python.org/3/library/codecs.html#encodings-and-unicode>`__). You
+can read more about the :func:`numpy.genfromtxt` function from
+the :func:`Reference Documentation <numpy.genfromtxt>` or from the
+:doc:`Basic IO tutorial <basics.io.genfromtxt>`.
+
+**Exploring the data**
+
+First of all, we can plot the whole set of data we have and see what it looks
+like. In order to get a readable plot, we select only a few of the dates to
+show in our :func:`x-axis ticks <matplotlib.pyplot.xticks>`. Note also that in
+our plot command, we use ``nbcases.T`` (the transpose of the ``nbcases`` array)
+since this means we will plot each row of the file as a separate line. We choose
+to plot a dashed line (using the ``'--'`` line style). See the
+`matplotlib <https://matplotlib.org/>`_ documentation for more info on this.
+
+.. ipython:: python
+
+ import matplotlib.pyplot as plt
+ selected_dates = [0, 3, 11, 13]
+ plt.plot(dates, nbcases.T, '--');
+ plt.xticks(selected_dates, dates[selected_dates]);
+ @savefig plot_covid_1.png
+ plt.title("COVID-19 cumulative cases from Jan 21 to Feb 3 2020");
+
+.. note::
+
+ If you are executing the commands above in the IPython shell, it might be
+ necessary to use the command ``plt.show()`` to show the image window. Note
+ also that we use a semicolon at the end of a line to suppress its output, but
+ this is optional.
+
+The graph has a strange shape from January 24th to February 1st. It would be
+interesing to know where this data comes from. If we look at the ``locations``
+array we extracted from the ``.csv`` file, we can see that we have two columns,
+where the first would contain regions and the second would contain the name of
+the country. However, only the first few rows contain data for the the first
+column (province names in China). Following that, we only have country names. So
+it would make sense to group all the data from China into a single row. For
+this, we'll select from the ``nbcases`` array only the rows for which the
+second entry of the ``locations`` array corresponds to China. Next, we'll use
+the :func:`numpy.sum` function to sum all the selected rows (``axis=0``):
+
+.. ipython:: python
+
+ china_total = nbcases[locations[:, 1] == 'China'].sum(axis=0)
+ china_total
+
+Something's wrong with this data - we are not supposed to have negative values
+in a cumulative data set. What's going on?
+
+**Missing data**
+
+Looking at the data, here's what we find: there is a period with
+**missing data**:
+
+.. ipython:: python
+
+ nbcases
+
+All the ``-1`` values we are seeing come from :func:`numpy.genfromtxt`
+attempting to read missing data from the original ``.csv`` file. Obviously, we
+don't want to compute missing data as ``-1`` - we just want to skip this value
+so it doesn't interfere in our analysis. After importing the :mod:`numpy.ma`
+module, we'll create a new array, this time masking the invalid values:
+
+.. ipython:: python
+
+ from numpy import ma
+ nbcases_ma = ma.masked_values(nbcases, -1)
+
+If we look at the ``nbcases_ma`` masked array, this is what we have:
+
+.. ipython:: python
+
+ nbcases_ma
+
+We can see that this is a different kind of array. As mentioned in the
+introduction, it has three attributes (``data``, ``mask`` and ``fill_value``).
+Keep in mind that the ``mask`` attribute has a ``True`` value for elements
+corresponding to **invalid** data (represented by two dashes in the ``data``
+attribute).
+
+.. note::
+
+ Adding ``-1`` to missing data is not a problem with :func:`numpy.genfromtxt`;
+ in this particular case, substituting the missing value with ``0`` might have
+ been fine, but we'll see later that this is far from a general solution.
+ Also, it is possible to call the :func:`numpy.genfromtxt` function using the
+ ``usemask`` parameter. If ``usemask=True``, :func:`numpy.genfromtxt`
+ automatically returns a masked array.
+
+Let's try and see what the data looks like excluding the first row
+(data from the Hubei province in China) so we can look at the missing data more
+closely:
+
+.. ipython:: python
+
+ plt.plot(dates, nbcases_ma[1:].T, '--');
+ plt.xticks(selected_dates, dates[selected_dates]);
+ @savefig plot_covid_2.png
+ plt.title("COVID-19 cumulative cases from Jan 21 to Feb 3 2020");
+
+Now that our data has been masked, let's try summing up all the cases in China:
+
+.. ipython:: python
+
+ china_masked = nbcases_ma[locations[:, 1] == 'China'].sum(axis=0)
+ china_masked
+
+Note that ``china_masked`` is a masked array, so it has a different data
+structure than a regular NumPy array. Now, we can access its data directly by
+using the ``.data`` attribute:
+
+.. ipython:: python
+
+ china_total = china_masked.data
+ china_total
+
+That is better: no more negative values. However, we can still see that for some
+days, the cumulative number of cases seems to go down (from 835 to 10, for
+example), which does not agree with the definition of "cumulative data". If we
+look more closely at the data, we can see that in the period where there was
+missing data in mainland China, there was valid data for Hong Kong, Taiwan,
+Macau and "Unspecified" regions of China. Maybe we can remove those from the
+total sum of cases in China, to get a better understanding of the data.
+
+First, we'll identify the indices of locations in mainland China:
+
+.. ipython:: python
+
+ china_mask = ((locations[:, 1] == 'China') &
+ (locations[:, 0] != 'Hong Kong') &
+ (locations[:, 0] != 'Taiwan') &
+ (locations[:, 0] != 'Macau') &
+ (locations[:, 0] != 'Unspecified*'))
+
+Now, ``china_mask`` is an array of boolean values (``True`` or ``False``); we
+can check that the indices are what we wanted with the :func:`ma.nonzero` method
+for masked arrays:
+
+.. ipython:: python
+
+ china_mask.nonzero()
+
+Now we can correctly sum entries for mainland China:
+
+.. ipython:: python
+
+ china_total = nbcases_ma[china_mask].sum(axis=0)
+ china_total
+
+We can replace the data with this information and plot a new graph, focusing on
+Mainland China:
+
+.. ipython:: python
+
+ plt.plot(dates, china_total.T, '--');
+ plt.xticks(selected_dates, dates[selected_dates]);
+ @savefig plot_covid_3.png
+ plt.title("COVID-19 cumulative cases from Jan 21 to Feb 3 2020 - Mainland China");
+
+It's clear that masked arrays are the right solution here. We cannot represent
+the missing data without mischaracterizing the evolution of the curve.
+
+**Fitting Data**
+
+One possibility we can think of is to interpolate the missing data to estimate
+the number of cases in late January. Observe that we can select the masked
+elements using the ``.mask`` attribute:
+
+.. ipython:: python
+
+ china_total.mask
+ invalid = china_total[china_total.mask]
+ invalid
+
+We can also access the valid entries by using the logical negation for this
+mask:
+
+.. ipython:: python
+
+ valid = china_total[~china_total.mask]
+ valid
+
+Now, if we want to create a very simple approximation for this data, we should
+take into account the valid entries around the invalid ones. So first let's
+select the dates for which the data is valid. Note that we can use the mask
+from the ``china_total`` masked array to index the dates array:
+
+.. ipython:: python
+
+ dates[~china_total.mask]
+
+Finally, we can use the :func:`numpy.polyfit` and :func:`numpy.polyval`
+functions to create a cubic polynomial that fits the data as best as possible:
+
+.. ipython:: python
+
+ t = np.arange(len(china_total))
+ params = np.polyfit(t[~china_total.mask], valid, 3)
+ cubic_fit = np.polyval(params, t)
+ plt.plot(t, china_total);
+ @savefig plot_covid_4.png
+ plt.plot(t, cubic_fit, '--');
+
+This plot is not so readable since the lines seem to be over each other, so
+let's summarize in a more elaborate plot. We'll plot the real data when
+available, and show the cubic fit for unavailable data, using this fit to
+compute an estimate to the observed number of cases on January 28th 2020, 7 days
+after the beginning of the records:
+
+.. ipython:: python
+
+ plt.plot(t, china_total);
+ plt.plot(t[china_total.mask], cubic_fit[china_total.mask], '--', color='orange');
+ plt.plot(7, np.polyval(params, 7), 'r*');
+ plt.xticks([0, 7, 13], dates[[0, 7, 13]]);
+ plt.yticks([0, np.polyval(params, 7), 10000, 17500]);
+ plt.legend(['Mainland China', 'Cubic estimate', '7 days after start']);
+ @savefig plot_covid_5.png
+ plt.title("COVID-19 cumulative cases from Jan 21 to Feb 3 2020 - Mainland China\n"
+ "Cubic estimate for 7 days after start");
+
+**More reading**
+
+Topics not covered in this tutorial can be found in the documentation:
+
+- :func:`Hardmasks <numpy.ma.harden_mask>` vs. :func:`softmasks
+ <numpy.ma.soften_mask>`
+- :ref:`The numpy.ma module <maskedarray.generic>`
diff --git a/doc/source/user/tutorials_index.rst b/doc/source/user/tutorials_index.rst
index c5e859fad..5e9419f96 100644
--- a/doc/source/user/tutorials_index.rst
+++ b/doc/source/user/tutorials_index.rst
@@ -15,5 +15,6 @@ classes contained in the package, see the :ref:`API reference <reference>`.
misc
numpy-for-matlab-users
tutorial-svd
+ tutorial-ma
building
c-info
diff --git a/doc/source/user/who_covid_19_sit_rep_time_series.csv b/doc/source/user/who_covid_19_sit_rep_time_series.csv
new file mode 100644
index 000000000..ebf670b8c
--- /dev/null
+++ b/doc/source/user/who_covid_19_sit_rep_time_series.csv
@@ -0,0 +1,115 @@
+Province/States,Country/Region,WHO region,1/21/20,1/22/20,1/23/20,1/24/20,1/25/20,1/26/20,1/27/20,1/28/20,1/29/20,1/30/20,1/31/20,2/1/20,2/2/20,2/3/20,2/4/20,2/5/20,2/6/20,2/7/20,2/8/20,2/9/20,2/10/20,2/11/20,2/12/20,2/13/20,2/14/20,2/15/20,2/16/20,2/17/20,2/18/20,2/19/20,2/20/20,2/21/20,2/22/20,2/23/20,2/24/20,2/25/20,2/26/20,2/27/20,2/28/20,2/29/20,3/1/20,3/2/20,3/3/20
+Confirmed,Globally,,282,314,581,846,1320,2014,2798,4593,6065,7818,9826,11953,14557,17391,20630,24554,28276,31481,34886,37558,40554,43103,45171,46997,49053,50580,51857,71429,73332,75204,75748,76769,77794,78811,79331,80239,81109,82294,83652,85403,87137,88948,90870
+Confirmed,Mainland China,Western Pacific Region,278,309,571,830,1297,1985,2741,4537,5997,7736,9720,11821,14411,17238,20471,24363,28060,31211,34598,37251,40235,42708,44730,46550,48548,50054,51174,70635,72528,74280,74675,75569,76392,77042,77262,77780,78191,78630,78961,79394,79968,80174,80304
+Confirmed,Outside of China,,4,5,10,16,23,29,57,56,68,82,106,132,146,153,159,191,216,270,288,307,319,395,441,447,505,526,683,794,804,924,1073,1200,1402,1769,2069,2459,2918,3664,4691,6009,7169,8774,10566
+Suspected,Mainland China,Western Pacific Region,,,,,,,5794,6973,9239,12167,15238,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+Severe,Mainland China,Western Pacific Region,,,,,,,461,976,1239,1370,1527,1795,2110,2296,2788,3219,3859,4821,6101,6188,6484,7333,8204,,,,,,,,,,,,,,,,,,,,
+Deaths,Mainland China,Western Pacific Region,,,,,,,80,106,132,170,213,259,304,361,425,491,564,637,723,812,909,1017,1114,1260,1381,1524,1666,1772,1870,2006,2121,2239,2348,2445,2595,2666,2718,2747,2791,2838,2873,2915,2946
+Hubei ,China,Western Pacific Region,258,270,375,375,,,,,,,,7153,9074,11177,13522,16678,19665,22112,24953,27100,29631,31728,33366,34874,51968,54406,56249,58182,59989,61682,62031,62662,63454,64084,64287,64786,65187,65596,65914,66337,66907,67103,67217
+Guangdong,China,Western Pacific Region,14,17,26,32,,,,,,,,520,604,683,797,870,944,1018,1075,1120,1151,1177,1219,1241,1261,1295,1316,1322,1328,1331,1332,1333,1339,1342,1345,1347,1347,1347,1348,1349,1349,1350,1350
+Henan,China,Western Pacific Region,,1,1,1,,,,,,,,422,493,566,675,764,851,914,981,1033,1073,1105,1135,1169,1184,1212,1231,1246,1257,1262,1265,1267,1270,1271,1271,1271,1271,1272,1272,1272,1272,1272,1272
+Zhejiang,China,Western Pacific Region,,5,5,5,,,,,,,,599,661,724,829,895,954,1006,1048,1075,1104,1117,1131,1145,1155,1162,1167,1171,1172,1173,1175,1203,1205,1205,1205,1205,1205,1205,1205,1205,1205,1206,1213
+Hunan,China,Western Pacific Region,,1,1,1,,,,,,,,389,463,521,593,661,711,772,803,838,879,912,946,968,988,1001,1004,1006,1007,1008,1010,1011,1013,1016,1016,1016,1016,1017,1017,1018,1018,1018,1018
+Anhui,China,Western Pacific Region,,,,,,,,,,,,297,340,408,480,530,591,665,733,779,830,860,889,910,934,950,962,973,982,986,987,988,989,989,989,989,989,989,990,990,990,990,990
+Jiangxi,China,Western Pacific Region,,1,2,2,,,,,,,,286,333,391,476,548,600,661,698,740,771,804,844,872,900,913,925,930,933,934,934,934,934,934,934,934,934,934,935,935,935,935,935
+Shandong,China,Western Pacific Region,,1,1,1,,,,,,,,202,225,246,270,298,343,379,407,435,459,486,497,506,519,530,537,541,543,544,546,748,750,754,755,755,756,756,756,756,756,758,758
+Jiangsu,China,Western Pacific Region,,,,,,,,,,,,202,231,271,308,341,373,408,439,468,492,515,543,570,593,604,617,626,629,631,631,631,631,631,631,631,631,631,631,631,631,631,631
+Chongqing,China,Western Pacific Region,,1,5,5,,,,,,,,238,262,300,337,366,389,411,426,446,468,486,505,518,529,537,544,551,553,555,560,567,572,573,575,576,576,576,576,576,576,576,576
+Sichuan,China,Western Pacific Region,,1,2,2,,,,,,,,207,236,254,282,301,321,344,363,386,405,417,436,451,463,470,481,495,508,514,520,525,526,526,527,529,531,534,538,538,538,538,538
+Heilongjiang,China,Western Pacific Region,,,,,,,,,,,,80,95,118,155,190,227,277,282,307,331,360,378,395,418,425,445,457,464,470,476,479,479,480,480,480,480,480,480,480,480,480,480
+Beijing,China,Western Pacific Region,5,5,10,10,,,,,,,,156,183,212,228,253,274,297,315,326,337,342,352,366,372,375,380,381,387,393,395,396,399,399,399,400,400,410,410,411,413,414,414
+Shanghai,China,Western Pacific Region,1,2,9,9,,,,,,,,153,177,193,208,233,254,269,281,292,295,302,306,313,318,326,328,331,333,333,333,334,334,335,335,335,336,337,337,337,337,337,338
+Hebei,China,Western Pacific Region,,,,,,,,,,,,96,104,113,126,135,157,171,195,206,218,239,251,265,283,291,300,301,302,306,307,308,309,311,311,311,312,317,318,318,318,318,318
+Fujian,China,Western Pacific Region,,,,,,,,,,,,144,159,179,194,205,215,224,239,250,261,267,272,279,281,285,287,290,292,293,293,293,293,293,293,294,294,296,296,296,296,296,296
+Guangxi,China,Western Pacific Region,,,,,,,,,,,,100,111,127,139,150,168,172,183,195,210,215,222,222,226,235,237,238,242,244,245,246,249,249,251,252,252,252,252,252,252,252,252
+Shaanxi,China,Western Pacific Region,,,,,,,,,,,,101,116,128,142,165,173,184,195,208,213,219,225,229,230,232,236,240,240,242,245,245,245,245,245,245,245,245,245,245,245,245,245
+Yunnan,China,Western Pacific Region,,1,1,1,,,,,,,,91,99,109,117,122,128,135,138,140,141,149,154,155,162,168,169,171,172,172,172,174,174,174,174,174,174,174,174,174,174,174,174
+Hainan,China,Western Pacific Region,,,,,,,,,,,,57,63,70,79,89,100,111,123,128,136,142,145,157,157,162,162,162,163,163,168,168,168,168,168,168,168,168,168,168,168,168,168
+Guizhou,China,Western Pacific Region,,,,,,,,,,,,29,38,46,56,64,69,77,89,96,109,118,131,135,140,143,144,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146
+Tianjin,China,Western Pacific Region,,2,2,2,,,,,,,,34,40,49,63,67,70,94,81,88,91,96,106,112,119,120,122,124,125,128,130,131,133,135,135,135,135,135,136,136,136,136,136
+Shanxi,China,Western Pacific Region,,,,,,,,,,,,47,56,66,74,81,90,96,104,115,119,122,124,126,126,127,128,129,130,131,131,132,132,132,132,133,133,133,133,133,133,133,133
+Liaoning,China,Western Pacific Region,,,,,,,,,,,,60,64,70,74,81,89,94,99,105,107,108,111,116,117,119,120,121,121,121,121,121,121,121,121,121,121,121,121,121,122,122,125
+Hong Kong,China,Western Pacific Region,,,1,2,5,5,8,8,8,10,12,13,14,15,15,18,21,24,26,26,36,42,49,50,53,56,56,57,60,62,65,68,68,70,74,81,85,91,93,94,95,98,101
+Jilin,China,Western Pacific Region,,,,,,,,,,,,17,21,31,42,54,59,65,69,78,80,81,83,84,86,88,88,89,89,90,91,91,91,91,93,93,93,93,93,93,93,93,93
+Gansu,China,Western Pacific Region,,,,,,,,,,,,35,45,51,56,57,62,70,71,81,85,86,86,87,90,90,90,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91
+Xinjiang,China,Western Pacific Region,,,,,,,,,,,,18,23,24,29,32,36,39,42,45,49,55,59,63,65,70,71,73,76,76,76,76,76,75,76,76,76,76,76,76,76,76,76
+Inner Mongolia,China,Western Pacific Region,,,,,,,,,,,,23,26,33,37,42,46,49,50,54,58,58,60,61,63,68,70,72,73,75,75,75,75,75,75,75,75,75,75,75,75,75,75
+Ningxia,China,Western Pacific Region,,,,,,,,,,,,26,28,31,34,34,40,43,45,45,49,53,58,64,67,70,70,70,70,71,71,71,71,71,71,71,71,72,72,73,73,74,74
+Taiwan,China,Western Pacific Region,,1,1,1,3,3,4,7,8,8,9,10,10,10,10,11,11,16,16,17,18,18,18,18,18,18,18,20,22,23,24,26,26,23,28,31,32,32,34,39,39,40,42
+Qinghai,China,Western Pacific Region,,,,,,,,,,,,8,9,13,15,17,18,18,18,18,18,18,18,18,18,18,18,18,18,12,18,18,18,18,18,18,18,18,18,18,18,18,18
+Macau,China,Western Pacific Region,,,1,2,2,2,5,7,7,7,7,7,7,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
+Xizang,China,Western Pacific Region,,,,,,,,,,,,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
+Unspecified*,China,Western Pacific Region,,,131,384,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+,Japan,Western Pacific Region,1,1,1,1,3,3,4,6,7,11,14,17,20,20,20,33,25,25,25,26,26,26,28,29,33,41,53,59,65,73,85,93,105,132,144,157,164,186,210,230,239,254,268
+,Republic of Korea,Western Pacific Region,1,1,1,2,2,2,4,4,4,4,11,12,15,15,16,18,23,24,24,27,27,28,28,28,28,28,29,30,31,51,104,204,346,602,763,977,1261,1766,2337,3150,3736,4212,4812
+,Thailand,South-East Asia Region,2,2,2,4,4,5,5,14,14,14,14,19,19,19,19,25,25,25,32,32,32,33,33,33,33,34,34,35,35,35,35,35,35,35,35,37,40,40,40,42,42,42,43
+,United States of America,Region of the Americas,,,1,1,2,2,5,5,5,5,6,7,8,11,11,11,12,12,12,12,12,13,13,14,15,15,15,15,15,15,15,15,35,35,35,53,53,59,59,62,62,62,64
+,Vietnam,Western Pacific Region,,,,2,2,2,2,2,2,2,5,6,7,8,9,10,10,12,13,14,14,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
+,Singapore,Western Pacific Region,,,,1,3,3,4,7,7,10,13,16,18,18,18,24,28,30,33,40,43,45,47,50,58,67,72,75,77,81,84,85,86,89,89,90,91,93,96,98,102,106,108
+,Italy,European Region,,,,,,,,,,,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,9,76,124,229,322,400,650,888,1128,1689,2036
+,Nepal,South-East Asia Region,,,,,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
+,Australia,Western Pacific Region,,,,,3,3,4,5,7,7,9,12,12,12,12,13,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,17,21,21,21,22,23,23,23,24,25,27,33
+,Malaysia,Western Pacific Region,,,,,,3,4,4,4,7,8,8,8,8,10,10,12,14,15,17,18,18,18,18,19,21,22,22,22,22,22,22,22,22,22,22,22,22,24,24,24,24,29
+,Canada,Region of the Americas,,,,,,,1,2,3,3,3,4,4,4,4,5,5,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,9,9,10,10,11,11,14,19,19,27
+,Cambodia,Western Pacific Region,,,,,,,,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
+,France,European Region,,,,,3,3,3,3,4,5,6,6,6,6,6,6,6,6,6,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,18,38,57,100,100,191
+,Sri Lanka,South-East Asia Region,,,,,,,,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
+,Iran,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,5,18,28,43,61,95,141,245,388,593,978,1501
+,India,South-East Asia Region,,,,,,,,,,1,1,1,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5
+,Germany,European Region,,,,,,,,1,4,4,5,7,8,10,12,12,12,13,14,14,14,14,16,16,16,16,16,16,16,16,16,16,16,16,16,16,18,21,26,57,57,129,157
+,Philippines,Western Pacific Region,,,,,,,,,,1,1,1,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
+,Spain,European Region,,,,,,,,,,,,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,12,25,32,45,45,114
+,United Kingdom,European Region,,,,,,,,,,,,2,2,2,2,2,2,3,3,3,4,8,8,9,9,9,9,9,9,9,9,9,9,9,9,13,13,13,16,20,23,36,39
+,Sweden,European Region,,,,,,,,,,,,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,7,12,13,14,15
+,Switzerland,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,6,10,18,26,30
+,Austria,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,2,4,5,10,10,18
+,Norway,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,4,6,15,19,25
+,Kuwait,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,8,12,43,43,45,45,56,56
+,Bahrain,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,26,33,33,38,40,47,49
+,United Arab Emirates,Eastern Mediterranean Region,,,,,,,,,4,4,4,4,5,5,5,5,5,5,7,7,7,8,8,8,8,8,8,9,9,9,9,9,11,13,13,13,13,13,19,19,19,21,21
+,Israel,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,2,2,2,3,5,7,7,10
+,Iraq,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,5,6,7,8,13,19,26
+,Oman,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,4,4,6,6,6,6,6
+,Lebanon,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1,2,2,2,2,10,13
+,Pakistan,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,2,2,4,4,5
+,Egypt,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2
+,Croatia,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,3,3,5,7,7,9
+,Greece,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,3,3,3,7,7
+,Finland,European Region,,,,,,,,,,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,6,7
+,Algeria,African Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1,1,5
+,Brazil,Region of the Americas,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,2,2,2
+,Russian,European Region,,,,,,,,,,,,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3
+,Belgium,European Region,,,,,,,,,,,,,,,,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8
+,Denmark,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,2,3,4,5
+,Estonia,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1,1
+,Georgia,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,2,3,3,3
+,North Macedonia,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1,1
+,Romania,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,3,3,3,3
+,Afghanistan,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1,1,1,1
+,New Zealand,Western Pacific Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,2
+,Belarus,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1
+,Lithuania,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1
+,Netherlands,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,2,7,13,18
+,Nigeria,African Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1
+,Mexico,Region of the Americas,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,2,5,5
+,San Marino,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,8
+,Azerbaijan,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,3
+,Ireland,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1
+,Monaco,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1
+,Qatar,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,3,7
+,Ecuador,Region of the Americas,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,6
+,Czechia,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3
+,Iceland,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,9
+,Armenia,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1
+,Luxembourg,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1
+,Indonesia,South-East Asia Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,2
+,Dominican Republic,Region of the Americas,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1
+,Portugal,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2
+,Andorra,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
+,Latvia,European Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
+,Jordan,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
+,Morocco,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
+,Saudi Arabia,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
+,Tunisia,Eastern Mediterranean Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
+,Senegal,African Region,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
+Case on an international conveyance,Other,Other,,,,,,,,,,,,,,,,,20,61,64,64,70,135,175,174,218,218,355,454,454,542,621,634,634,634,695,691,691,705,705,705,706,706,706 \ No newline at end of file