You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I try to parse activity.txt file using Pandas, I get the output in a weird format.
Even though the columns are separate in activity.txt file, after parsing it through pandas all the columns are merged as one.
Is there a workaround to separate out the columns/clean the data so that it can be processed further ?
The text was updated successfully, but these errors were encountered:
I came up with my solution to parse the data so that we can perform some data analysis on it.
I converted the activity.log file into a pandas DataFrame. (refer the image in the first post for the initial output).
Please do have a look. Will hardly take 5 mins. Do share your comments.
This is no more than 2 lines of code to convert the file to a DataFrame.
def psrecord2df(path):
data = open(path).read().splitlines()[1:]
data = [[float(c) for c in l.split()] for l in data]
return pd.DataFrame(
data=data,
columns=['Elapsed time', 'CPU (%)', 'Real (MB)', 'Virtual (MB)'])
Hi,
If I try to parse activity.txt file using Pandas, I get the output in a weird format.
Even though the columns are separate in activity.txt file, after parsing it through pandas all the columns are merged as one.
Is there a workaround to separate out the columns/clean the data so that it can be processed further ?
The text was updated successfully, but these errors were encountered: