From b8ce612d91808ca90b29b9c23fb238f9a864b6a1 Mon Sep 17 00:00:00 2001 From: William Kaiser Date: Tue, 19 Mar 2024 15:08:41 -0400 Subject: [PATCH] Simplified README Examples Pandas will automatically perform fetches for paths detected as URLs. No need for `requests` and `StringIO`. A marginal change, but this makes the docs a bit simpler. --- README.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8f9e57ff3ad..3ff9704005d 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,8 @@ You can import `cudf` directly and use it like `pandas`: ```python import cudf -import requests -from io import StringIO -url = "https://github.com/plotly/datasets/raw/master/tips.csv" -content = requests.get(url).content.decode("utf-8") - -tips_df = cudf.read_csv(StringIO(content)) +tips_df = cudf.read_csv("https://github.com/plotly/datasets/raw/master/tips.csv") tips_df["tip_percentage"] = tips_df["tip"] / tips_df["total_bill"] * 100 # display average tip by dining party size @@ -36,13 +31,8 @@ supported operations and falling back to pandas when needed: %load_ext cudf.pandas # pandas operations now use the GPU! import pandas as pd -import requests -from io import StringIO - -url = "https://github.com/plotly/datasets/raw/master/tips.csv" -content = requests.get(url).content.decode("utf-8") -tips_df = pd.read_csv(StringIO(content)) +tips_df = pd.read_csv("https://github.com/plotly/datasets/raw/master/tips.csv") tips_df["tip_percentage"] = tips_df["tip"] / tips_df["total_bill"] * 100 # display average tip by dining party size