Tech

Linear regression is a fundamental method in data analysis to understand the relationship between two variables. Here, I summarize four reusable Python functions for performing and visualizing linear fitting:

  1. Matplotlib: with and without intercept
  2. Plotly: with and without intercept

All methods:

  • Drop NaN values in x and y
  • Plot a scatter graph
  • Fit a linear line
  • Annotate the equation and correlation coefficient (R)

Read More

In this post, I document the full procedure for turning a personal Python project into a public package, available on both GitHub and the Python Package Index (PyPI).

As a demonstration, I create a small package named PalAniSh (Palette of Animation of Shanghai), which extracts and displays color palettes from classical Chinese animations produced by the Shanghai Animation Film Studio.

Read More

Geojson provides several advantages compared to shapefiles:

  1. lightweight, text-based, and easily readable format that can be easily shared, transmitted and used on the web.

  2. It supports a wider range of data types compared to shapefile and can be used across multiple platforms and programming languages.

  3. Additionally, geojson files have smaller file sizes, making them easier to store and process. These benefits make geojson a popular choice for geographic information data storage and exchange.

Read More

The National Oceanic and Atmospheric Administration (NOAA) Integrated Surface Database (ISD) provides one of the richest sources of historical weather data consisting of hourly and synpoptic observation. This blog will introuce the simple way to retrieve and process the raw data into Python dataframe.

Read More

在国外新购置了一台PC,性能比从国内带来的Mac笔记本要好,也可以继续玩Steam上的游戏。决定将个人学习工作环境迁移至Windows系统。在此记录相关配置步骤,以便未来之需。

Read More

提要:Altair是强大的可视化库,其基于Vega-lite,可快速生成简洁、美观、可互动的统计图形。本文介绍个人相关学习经历,具体包括:(1)数据载入与基本图形绘制; (2)基于web端呈现

Read More

In this post, I address an common problem in geoscience research: how to arrange the original geodata into pre-defined grid system. Sometimes, we need to unify the resolution of various dataset or summary the scatter data to raster one.

Specifically, this brief tutorial will look at two different original data, and allow you to creat gridded data in python. For better illustration, two practial cases with detailed code are shown:

  • Creating an emission inventory based on the emissions from point sources (e.g., power plants, cement plants)
  • Remapping a population density map to a coarser resolution

Read More

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×