About Me

Hello, World! 👋

Introduction

Hey there! I’m Hongfeng Wang(Joseph), a passionate Data Analyst with a strong background in Computer Science and Data Science. I’m thrilled to welcome you to my blog, where I share my thoughts, experiences, and insights on data analytics, technology, and everything in between.

Read More

折翼蝴蝶——英伟达期权实战

折翼蝴蝶——英伟达期权实战

玩期权也有一段时间了,最近一直在琢磨怎么能让自己的交易策略更上一层楼。如果你也和我一样,已经厌倦了单腿期权那种“要么猜对方向赚翻,要么猜错方向归零”的简单粗暴,那么这篇文章,也许能给你一些启发。坦白说,这个NVDA的蝴蝶交易,我是跟着我超爱看的一个YouTuber——“华尔街阿宝”做的。 我觉得,对于我们这些学习者来说,先“抄作业”,再去深入研究大神为什么这么做,是一个非常高效的学习路径。下面,我就来复盘一下这个操作,看看我们到底赚的是什么钱。

目标很明确:学会传说中的“折翼蝴蝶”(Broken-Wing Butterfly)策略。

Read More

Mastering Python Web Framework -- FastAPI

Mastering Python Web Framework – FastAPI

Introduction

In the fast-paced world of web development, where efficiency and speed are paramount, developers are constantly seeking tools that can accelerate their workflow without compromising on performance. FastAPI, a modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints, has emerged as a game-changer in this domain. In this blog post, we’ll explore the key features and advantages that make FastAPI a compelling choice for developers looking to build robust and efficient APIs.

What is FastAPI

FastAPI is an asynchronous web framework that is designed to be easy to use and fast to develop with. It is built on top of Starlette for the web parts and Pydantic for the data parts, bringing together the best of both worlds. One of its standout features is its use of Python type hints, which not only make the code more readable but also enable automatic validation, serialization, and documentation.

Key Features:

1. Fast Performance:

FastAPI lives up to its name by providing exceptional performance. It is built on top of Starlette and relies on asynchronous programming, making it well-suited for handling a large number of simultaneous connections without sacrificing speed.

2. Automatic OpenAPI and JSON Schema Documentation:

FastAPI automatically generates OpenAPI and JSON Schema documentation based on your code and type hints. This not only saves time but also ensures that your documentation is always up-to-date.

3. Data Validation and Serialization:

Type hints in FastAPI are not just for documentation. They are also used for data validation and serialization. FastAPI automatically validates incoming request data and serializes outgoing response data based on the specified types, reducing the chances of errors.

4. Dependency Injection System:

FastAPI comes with a built-in dependency injection system that allows you to organize your code in a modular and maintainable way. This is particularly useful for handling authentication, database connections, and other common tasks.

5. Built-in OAuth2 and JWT Authentication:

Security is a top priority in web development, and FastAPI simplifies the implementation of OAuth2 and JWT authentication, making it easier to secure your APIs.

6. WebSocket Support:

FastAPI supports WebSocket communication out of the box, providing a seamless way to implement real-time features in your applications.

Easy Start

1
2
pip install fastapi[all]

1
2
3
4
5
6
7
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def read_root():
return {"Hello": "World"}
1
uvicorn main:app --reload

Mastering Data Analysis with Python Unleashing the Power of Pandas

Mastering Data Analysis with Python: Unleashing the Power of Pandas

Introduction

In today’s data-driven world, Python has emerged as a dominant force for data analysis, and at the heart of this prowess lies Pandas. Whether you’re a seasoned analyst or a novice explorer of datasets, mastering Pandas can elevate your data manipulation and analysis skills to new heights. In this blog, we’ll delve into the world of Python data analysis with Pandas, exploring essential skills, specific use cases, potential traps, and tips to navigate them effectively.

1. Understanding the Basics of Pandas

Before diving into the advanced techniques, ensure a strong foundation in Pandas’ basics. Learn about Series and DataFrames—the fundamental data structures that Pandas revolves around. Familiarize yourself with indexing, selecting, and filtering data.

Read More