Import Data
Import and take a fist glimpse of the geospatial data.
We'll cover the following...
Now that we’ve gone over the theory, it’s time to get started. At the end of the day, the most important part of any data science project is the data. Our boss has already compiled the data in a .csv file and handed it over to us. Now, take a first look at the provided .csv file, which consists of three columns: Store, lat, and lon.
The MoscowMcD.csv File
Store | lat | long |
StoreA | 55.8335718446519 | 37.64083664695893 |
StoreB | 55.801166340384995 | 37.8118113719255 |
StoreC | 55.78302291327372 | 37.68066208490295 |
StoreD | 55.76873384364866 | 37.6854686032755 |
StoreE | 55.77916151917434 | 37.631910255695615 |
StoreF | 55.771823816133235 | 37.6016978544967 |
StoreG | 55.7803199775828 | 37.58590500841545 |
StoreH | 55.79769272132777 | 37.55500596173475 |
StoreI | 55.7416861350695 | 37.412183701521705 |
StoreJ | 55.65655688623046 | 37.59002488130621 |
StoreK | 55.65616951170943 | 37.74452011470974 |
StoreL | 55.74477825112604 | 37.62367050991409 |
StoreM | 55.76255316385133 | 37.63465683762279 |
No matter in which format the data is delivered to us, we’ll have to read it in Python.
Create DataFrame
An example of the pragmatic didactic approach of this course is the use of import
statements. Usually, it’s common to import all used Python packages at the beginning of a project. This course deviates from this approach, so any import
statement used will be explained right before it is used. This approach is intended to improve code understanding and simplify traceability.
We’ll use the pandas
package to import this data file via the internet. The pandas
Python library ...