Dec-18-2020, 08:09 AM
Hello,
Earlier this year, I downloaded and modified a code that helps you to analyze your whatsapp chat data.
I used Anaconda and Jupyter notebook to run the codes and they ran without any issues.
My problem started when I upgraded my MacBook operating system to the new version, Catalina. My codes have stopped working since the upgrade, giving me different types of errors. I have done lot of research and have not been able tp sort this out. From what I have learned, the problem is not with the code but with the platforms of Anaconda and Jupyter notebooks. To tackle this, I uninstalled and installed Anaconda but that hasn't help.
For now, I have put my plans to fix Anaconda/Jupiter problem on MacBook Pro on hold. I have instead focus my attention to running the codes on Repl.it .
I took part of my code and ran it at Repl.it but got an error. I have researched and modified my code but that hasn't helped yet. Wondering if anyone can tell me why I am getting this error.
I am sorry there is lot of writing here. I am sure this is not clear to everyone. Please do ask questions and I will answer.
I would appreciate any help.
thank you
-YK
Earlier this year, I downloaded and modified a code that helps you to analyze your whatsapp chat data.
I used Anaconda and Jupyter notebook to run the codes and they ran without any issues.
My problem started when I upgraded my MacBook operating system to the new version, Catalina. My codes have stopped working since the upgrade, giving me different types of errors. I have done lot of research and have not been able tp sort this out. From what I have learned, the problem is not with the code but with the platforms of Anaconda and Jupyter notebooks. To tackle this, I uninstalled and installed Anaconda but that hasn't help.
For now, I have put my plans to fix Anaconda/Jupiter problem on MacBook Pro on hold. I have instead focus my attention to running the codes on Repl.it .
I took part of my code and ran it at Repl.it but got an error. I have researched and modified my code but that hasn't helped yet. Wondering if anyone can tell me why I am getting this error.
#Very good file. Third revision! import os import pandas as pd pd.set_option('display.max_rows', 500) import itertools import datetime as dt from matplotlib import pyplot as plt from IPython import get_ipython get_ipython().run_line_magic('matplotlib', 'inline') import seaborn as sns import re from collections import Counter import string import emoji import pickle import numpy as np import matplotlib.pyplot as plt import matplotlib.dates as mdates import matplotlib.cbook as cbook import pandas as pd import time import sys from wordcloud import WordCloud, STOPWORDS from PIL import Image files_groups = os.listdir('data/') def read_history(file,conv_type): f = open('data/{}/{}'.format(conv_type,file), 'r',) # Feed the file text into findall(); it returns a list of all the found strings messages = re.findall('\[(\d+-\d+-\d+, \d+:\d+:\d+ [A-Z]*)\] (.*?): (.*)', f.read()) f.close() #Convert list to a dataframe and name columns history = pd.DataFrame(messages,columns =['date','name','msg']) history['date'] = pd.to_datetime(history['date'],format="%Y-%m-%d, %I:%M:%S %p") history['date1'] = history['date'].apply(lambda x: x.date()) history['msg_len'] = history['msg'].str.len() history['conv_name'] = file[19:-4] history['conv_name'] = file[19:-4] # Get Media shared in the Message history['Media']=history['msg'].str.contains('omitted') return history history['Media'] all = [] for file in files_groups: history = read_history(file,'') history['tipo'] = 'g' all.append(history) history = pd.concat(all).reset_index() history_clean = history[history['msg']!=' <Media omitted>'].sort_values(by=['conv_name','name','date1']) history_clean.shape history.columnsThe error I am getting is this
Error:Matplotlib created a temporary config/cache directory at /tmp/matplotlib-9v71tol1 because the default path (/config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
Traceback (most recent call last):
File "main.py", line 9, in <module>
get_ipython().run_line_magic('matplotlib', 'inline')
AttributeError: 'NoneType' object has no attribute 'run_line_magic'
I got line 9 from stackoverflow. I am using this line to replace the original code of %matplotlib inline(this line was also giving me an error)
I am sorry there is lot of writing here. I am sure this is not clear to everyone. Please do ask questions and I will answer.
I would appreciate any help.
thank you
-YK