Feb-04-2020, 02:04 PM
(This post was last modified: Feb-04-2020, 02:04 PM by AndreasMavro.)
Hello everyone,
I am trying to plot a regression from the Seaborn library in Pycharm, and unfortunately I stumble upon an error which I feel may be due to my system (I am on a Windows 10, 64-bit OS). The part of my code that causes the issue is as follows:
Any help would be much appreciated!
I am trying to plot a regression from the Seaborn library in Pycharm, and unfortunately I stumble upon an error which I feel may be due to my system (I am on a Windows 10, 64-bit OS). The part of my code that causes the issue is as follows:
import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt path = "https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DA0101EN/automobileEDA.csv" df = pd.read_csv(path) width = 12 height = 10 plt.figure(figsize=(width, height)) sns.regplot(x="highway-mpg", y="price", data=df) plt.ylim(0,) plt.show()
Error:TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'
This error also appears if I try to use the lmplot function sns.lmplot(x="highway-mpg", y="price", data=df)Other Seaborn functions that I have tried work properly.
Any help would be much appreciated!