<jupyter_start><jupyter_text>3.2: サンプルデータについて<jupyter_code># リスト 3.2.1　URL とファイル名を結合

from urllib.parse import urljoin

base_url = "https://raw.githubusercontent.com/practical-jupyter/sample-data/master/anime/"
anime_csv = urljoin(base_url, "anime.csv")
print(anime_csv)
# リスト 3.2.4　anime.csv の取得

import pandas as pd

anime_csv = urljoin(base_url, "anime.csv")
pd.read_csv(anime_csv).head()
# リスト 3.2.5　anime_master.csv の取得

anime_master_csv = urljoin(base_url, "anime_master.csv")
pd.read_csv(anime_master_csv).head()
# リスト 3.2.6　anime_split_genre.csv の取得

anime_split_genre_csv = urljoin(base_url, "anime_split_genre.csv")
pd.read_csv(anime_split_genre_csv).head()
# リスト 3.2.7　anime_genre_top10.csv の取得

anime_genre_top10_csv = urljoin(base_url, "anime_genre_top10.csv")
pd.read_csv(anime_genre_top10_csv).head()
# リスト 3.2.8　anime_genre_top10_pivoted.csv の取得

anime_genre_top10_pivoted_csv = urljoin(
    base_url, "anime_genre_top10_pivoted.csv"
)
pd.read_csv(anime_genre_top10_pivoted_csv).head()
# リスト 3.2.9　anime_stock_price.csv の取得

anime_stock_price_csv = urljoin(base_url, "anime_stock_price.csv")
pd.read_csv(anime_stock_price_csv, index_col=0, parse_dates=["Date"]).head()
# リスト 3.2.10　anime_stock_returns.csv の取得

anime_stock_returns_csv = urljoin(base_url, "anime_stock_returns.csv")
pd.read_csv(anime_stock_returns_csv, index_col=0, parse_dates=["Date"]).head()
# リスト 3.2.11　4816.csv の取得

t4816_csv = urljoin(base_url, "4816.csv")
pd.read_csv(t4816_csv, index_col=0, parse_dates=["Date"]).head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12987012987012986, 'fraction_numerical': 0.04285714285714286, 'mean_word_length': 7.1534391534391535, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '428576', 'license': 'MIT', 'n_tokens_mistral': 785, 'n_tokens_neox': 746, 'n_words': 91, 'path': 'notebooks/3-02.ipynb', 'repo_name': 'yohata1013/sample-code-2nd', 'size': '1540'}