joweich / chat-miner

Parsers and visualizations for chats
MIT License
567 stars 56 forks source link

calender_heatmap() missing 1 required positional argument: 'year' #41

Closed Baesm closed 1 year ago

Baesm commented 1 year ago
17.11.2022 11:15:10 INFO     Initialized parser.
17.11.2022 11:15:10 INFO     Starting reading raw messages into memory...
17.11.2022 11:15:10 INFO     Finished reading 38739 raw messages into memory.
17.11.2022 11:15:10 INFO     Inferred DMY format for date.
17.11.2022 11:15:10 INFO     Starting parsing raw messages into dataframe...
100%|███████████████████████████████████| 38739/38739 [00:04<00:00, 8693.78it/s]
17.11.2022 11:15:15 INFO     Finished parsing raw messages into dataframe.
               hour         words       letters
count  38739.000000  38739.000000  38739.000000
mean      14.367691      6.338367     35.067503
std        4.371213      6.666926     39.636194
min        0.000000      1.000000      1.000000
25%       11.000000      2.000000     11.000000
50%       14.000000      5.000000     26.000000
75%       18.000000      8.000000     46.000000
max       23.000000    383.000000   2181.000000
Traceback (most recent call last):
  File XXXX, line 8, in <module>
    vis.calendar_heatmap(parser.df)
TypeError: calendar_heatmap() missing 1 required positional argument: 'year'

used date format (WhatsApp, iOS):

[DD.MM.YY, hh:mm:ss] user: message

alfonso46674 commented 1 year ago

I have not tried to use your date format, but did you use the method as follows:

from chatminer.chatparsers import WhatsAppParser
import chatminer.visualizations as vis

parser = WhatsAppParser("./chat.txt")
parser.parse_file_into_df()

vis.calendar_heatmap(parser.df, 2022)
plt.show()

I could be wrong, but from the error you posted it seems that you missed the year argument.

joweich commented 1 year ago

@Baesm as @alfonso46674 mentioned, it seems like your missing the year parameter. Please have a look at the updated readme, that also gives you a code example.