lucasrodes / whatstk

WhatsApp chats as dataframes. Python toolkit to analyse and parse WhatsApp chats.
https://whatstk.lcsrg.me/
GNU General Public License v3.0
121 stars 23 forks source link

Figure Builder Error #148

Open Somtochukwu-Achikanu opened 5 months ago

Somtochukwu-Achikanu commented 5 months ago
from whatstk import FigureBuilder
from plotly.offline import plot
fb = FigureBuilder(chat)
fig = fb.user_interventions_count_linechart(cumulative=True, title='User inteventions count (cumulative)')
plot(fig)

The error it is throwing..

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-103-c1b1c4d66314> in <cell line: 4>()
      2 from plotly.offline import plot
      3 fb = FigureBuilder(chat)
----> 4 fig = fb.user_interventions_count_linechart(cumulative=True, title='User inteventions count (cumulative)')
      5 plot(fig)

4 frames
/usr/local/lib/python3.10/dist-packages/pandas/core/indexes/accessors.py in __new__(cls, data)
    510             return PeriodProperties(data, orig)
    511 
--> 512         raise AttributeError("Can only use .dt accessor with datetimelike values")

AttributeError: Can only use .dt accessor with datetimelike values

please note the name of my dataframe is chat.

lucasrodes commented 2 months ago

Hi @Somtochukwu-Achikanu, thanks for the interest in whatstk.

It seems like your dataframe might not have the appropriate data types? It should have column date of type datetime. Could you verify this? Maybe if you share a snippet (with modified texts if needed)