# map-source-version2
**Repository Path**: qian_zehao/map-source-version2
## Basic Information
- **Project Name**: map-source-version2
- **Description**: "Influence Index Analysis of Inland Ports Along the Yangtze River" The realization of map, data analysis interface and data analysis and automation script
- **Primary Language**: Python
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2022-12-04
- **Last Updated**: 2023-02-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: Python, Steamlit, DataAnalysis, Entropy-method
## README
Influence Index Analysis of Inland Ports
Along the Yangtze River
💻Code Realization💻
# map-source-version2
Compare with the [map-source-version1](https://gitee.com/qian_zehao/map-source), this dashboard and data analytics part use pure python code to realize with the amazing Pyhton package [streamlit](https://streamlit.io/).
To realize the complex matrix calculation in the paper, we use [pandas](https://pandas.pydata.org/) and [openpyxl](https://openpyxl.readthedocs.io/en/stable/) to read the data in the excel data table and convert it into matrix form, and use Python's [numpy](https://numpy.org/) library to realize the matrix calculation in the paper.
Some data visualization generation we use a python Declarative library called [Vega-Altair](https://altair-viz.github.io/).
## Run this project (Dev mode)
```sh
$ cd path/to/map-source-version2
# create a python virtual environment through miniconda
$ conda create --name map python=3.8.15
# activate this pyhton env
$ conda activate map
# use tsinghua source
$ pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# install third part requirements
$ pip install -r requirements.txt
# run this project
$ streamlit run Input_Factor_Visualization.py
```
## Run this project (Production mode) (Docker & Recommend)
Before using docker to run this project, please make sure your computer have docker engine installed!
```sh
# build docker image
sudo docker build -t map-docker .
# run this image
sudo docker run --name map-docker -p 8501:8501 map-docker:latest
```
After running '*sudo docker run --name map-docker map-docker:latest*', there should be a output url on your terminal like this (perhaps your ip address cannot be the same as ours, just input your http://\:8501 or http://127.0.0.1:8501 to visit it!):
```
Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.
You can now view your Streamlit app in your browser.
Network URL: http://172.17.0.3:8501
External URL: http://61.181.207.9:8501
```
## Core Calculate function Dependance
```txt
# Bottom-up
init_numpy_matrix --> normalization_matrix --> entropy_p_matrix --> weight_entropy --> entropy_weight_normalized --> influence_index
```
