why is jupyter notebook not accepting my csv file link?

Question:

I’m trying to visualize some data with a seaborn plot and the csv file link keeps returning the error ‘"link.csv" is not one of the example datasets.’
What am I doing wrong?

import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

df = sns.load_dataset('https://github.com/avocami/Goodreads-project/blob/main/df_goodreads.csv')

sns.jointplot(x=df["avg_rating"], y=df["num_pages"], kind='hex', marginal_kws=dict(bins=30, fill=True))

plt.show()
Asked By: avocami

||

Answers:

Seaborn load_dataset() function is used to load an example dataset from Seaborn library. It is not used to load just any data, just the data specified in their documentation (specifically data that can be found in https://github.com/mwaskom/seaborn-data).

If you want to load your own data, use pandas read_csv() function:

import pandas as pd
df = pd.read_csv('https://github.com/avocami/Goodreads-project/blob/main/df_goodreads.csv')
Answered By: dm2
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.