Some tips with pandas, matplotlib and openpyxl
- Détails
- 1248
pandas is an excellent Python librarie to handle data. Barely started using it, it already solves some of my recurring needs. matplotlib allows to create advanced charts and openpyxl is very usefull to manage Excel files, read or generate them for example.
So here some tips for my memory and maybe for you.
Let's go learn data analysis with this 3 beautiful tools. First install or check Python and pip, then the libraries.
pip install pandas pip install matplotlib pip install openpyxl
Tutoriel avancé QGIS et Python
- Détails
- 6762
Interopérabilité Python/QGIS - Principaux concepts de Python, indentation, itération, variable, méthode, boucle, fonction, condition, tuple, paramètre, argument, chaîne formatée, importation - Fonctions géométriques - Écriture de fichiers - Fonctions SIG - Génération de cartes - Standalone - Milieu alpin
Sources et liens divers :
- Tutoriel d'initiation à Python dans QGIS3 (débutant) : http://www.qgistutorials.com/fr/docs/3/getting_started_with_pyqgis.html
- Blog spécialisé d'Underdark, aka Anita Graser : https://anitagraser.com/
- Documentation QGIS : https://docs.qgis.org/3.10/en/docs/
- Documentation Python : https://docs.python.org/fr/3/
- Documentation ArcGIS/Python : https://desktop.arcgis.com/search/?q=python&language=fr
- Processing providers and algorithms : https://docs.qgis.org/3.10/en/docs/user_manual/processing_algs/
- OSMDownloader : https://github.com/lcoandrade/OSMDownloader
- QuickOSM : https://github.com/3liz/QuickOSM
- Wikidata : https://www.wikidata.org/
- Landscape Archaeology : https://landscapearchaeology.org/
- AppDividend : https://appdividend.com/
- OpenSourceOptions: https://opensourceoptions.com/
- webgeodatavore : https://webgeodatavore.com/
Tutoriel écrit sur QGIS 3.14 'Py' et Python 3.8, mais j'ai pu constater qu'il fonctionne de façon assez similaire sur des versions précédentes, ainsi que sur QGIS 3.16.
Zones de chalandise avec QGIS, Python, l'API ORS et les données OSM, IGN et INSEE
- Détails
- 1847
Nous allons calculer les zones isochrones à 15 minutes des magasins Décathlon français, et les coupler avec les données géographiques de l'IGN croisées avec les données statistiques de l'INSEE.
L'ensemble formera de supposées zones de chalandise des magasins. Nous verrons aussi quels magasins se cannibalisent ainsi que leur proximité avec des équipements sportifs.
Pour ce faire nous n'utiliserons que des données en open-source, l'API d'openrouteservice, le logiciel libre QGIS et peut-être un peu de code Python.
Zones de chalandise avec QGIS, Python, l'API ORS et les données OSM, IGN et INSEE
SQL Automatic deduplication
- Détails
- 861
All living databases has its duplicates. Depending on their nature or number, it may be interesting to dedupe them quickly. For this goal SQL is our friend.
Below a simple example in order to describe the main concepts of the method. Then you will be able to do this in more complex situations. Because the final formula is a bit long, we will proceed iteratively, to understand the different steps.
Automate the opening of your favorite apps
- Détails
- 278
Maybe each morning you have to open some softwares, websites or any apps before to start working.
For me: my professional email box (Outlook), my personnal email box (Gmail), my testing email boxes (Thunderbird, Yahoo ...), Teams, the official CRM of my company, the unofficial CRM of my company, the marketing tools of my company, my Google shortcuts ... Hum, tired in the morning!
Thanks to Python and his libraries os and webbrowser, we can save time and neurons. Just add the code below in a Python script:
import os import webbrowser os.startfile("outlook") os.startfile("thunderbird") webbrowser.open('https://hg-map.fr/') os.startfile(r"C:\Users\Georges\Desktop\Communications\Gmail.lnk") os.startfile(r"C:\Users\Georges\Desktop\Communications\Microsoft Teams.lnk") os.startfile(r"C:\Users\Georges\Desktop\Communications\Yahoo.lnk")
Clicking into will open your favourite applications. Me I prefere store my scripts in a dedicated folder, and then add shortcuts on my desktop.
Maybe you should adapt the code according your OS and your apps subtilities. Here above for example, Outlook and Thunderbird are recognized by Python, and just need to mention their system names to the os library. A website need the webbrowser library, and the Google shortcuts need the os library but from their full paths.
Quelques regex sur Notepad
- Détails
- 12854
Les expressions régulières (regex) sur Notepad++ sont très pratiques pour standardiser un fichier de données avant import par exemple, récupérer des données, corriger des chaînes particulières, avec des conditions, etc...
Ici quelques astuces propres à mon usage personnel.
Page 1 sur 5