1

I have started using pydatatable for one of my data analysis project, here i have faced few issues in making charts of pydatatable object using seaborn library.

does pydatatable support seaborn visualizations in current version of it 0.8?.

I have tried to visualise a column with a chart : histogram, boxplot etc.etc. as showed in the sample code below

np.random.seed(1)
dt_test = dt.Frame(np.random.randn(1000))
sns.boxplot(x="CO",data=dt_test)
plt.show()

On running above code chunk it should display a boxplot of the provided column, but here it's giving an error as

AttributeError: 'Frame' object has no attribute 'get'

Could you please write to me here how to solve this and have you ever tried to use these two packages together?.

Pasha
  • 6,298
  • 2
  • 22
  • 34
myamulla_ciencia
  • 1,282
  • 1
  • 8
  • 30

1 Answers1

3

The seaborn library does not support interoperating with datatable yet. On its part, a datatable Frame makes itself convertible to a numpy array. Thus, any code that does np.asarray(data) will be able to work with a datatable Frame. For this reason you'll see that datatable can currently be used in some functions but not others: it all depends on how the internal code treats the incoming data.

For example your example can be rewritten as

sns.boxplot(x=dt_test[:, "C0"])

and it will now work.

More generally, you can easily convert a datatable Frame into one of the formats that an external library can understand:

frame.to_pandas()
frame.to_numpy()
frame.to_list()
frame.to_dict()
Pasha
  • 6,298
  • 2
  • 22
  • 34