Reputation: 95
I have been taking a course that shows how to use Seaborn and matplotlib on Jupiter in order to create various data visualization models. I also just learned how to import excel files into Jupiter but the problem I am having is that the data cannot be taken out of the excel file as it is not a data frame.
Does anyone know how to extract data from an imported excel file so that it can be used in data visualization? I appreciate any help.
Upvotes: 0
Views: 3033
Reputation: 411
You can use Pandas library. There is a method called pandas.read_excel that reads .xls files easily.
import pandas as pd
import seaborn as sns
df = pd.read_excel('name.xlsx') # reads the excel file
sns.scatterplot(x="xvar",y="yvar",data=df) # creates a scatter plot with columns xvar and yvar
Then you can directly use pandas data frames to visualize data using seaborn library.
Upvotes: 1