Possible errors in Data Analysis with Python Project

Hi all!
I have just managed to finally get my Page View Time Series Visualizer Project in Data Analysis with Python to work. I have, however encountered three issues on my way, 2 which could be possible bugs. I don’t want to start an issue on Github without first checking here, in case the errors are in my code after all. Link to my code is at the end.

  • EDIT: point 1. is my bad, I just noticed I did not put in ‘parse_dates=True’ parameter. With that the provided code works just fine. points 2 and 3 are still standing though. :slight_smile:
  1. in Boxplot section, the provided code (lines 60-63 in my code commented out) was just throwing errors
  • If I just tried it as , it’d return “AttributeError: ‘int’ object has no attribute ‘year’”

  • I tried converting the index to datetime, changing ‘df_box.date’ to df_box.index’, which all kept returning Attribute error.

  • Importing df with index_col = None and then converting the ‘date’ column to datetime lead to “TypeError: Cannot reset_index inplace on a Series to create a DataFrame”

  • So I gave up and did it the way I did, with bypassing the provided code. Did I miss something? I thought the ‘reset_index(inplace=True)’ would just move the ‘date’ column out of index position, but somehow it didn’t work for me. Is it a bug, or did I make a mistake in my code somewhere?

  1. in line 104 of Test, the resulting list of Y axis labels includes 200 000, which is not included in the example. Without setting the y labels, they ended at 180 000, as the example does.

  2. I’d really appreciate if someone wouldn’t mind double checking my data cleaning, as my boxplot for seasonality has a slightly different data distribution than the example. In all the other exercises, I could not see difference between test passing plots and the examples, but this one seems a bit off. I’d rather learn data cleaning properly, so any input will be much appreciated :slight_smile:

Thank you for any answers!
Have a lovely day :grinning_face_with_smiling_eyes:

MY CODE - now passing all the tests, just mind the figure size is super small because of memory issues.

There’s been several discussions about the example plot versus user plots, here in the forums. I’m not 100% sure, but I think the example was produced on a older or different dataset, an older version of one of the project dependencies, or with a different plotting library (maybe just matplotlib instead of seaborn). Regardless, if you pass the tests, and it looks close, assume it’s correct. The final plots I produced were different, but not by much when I realized my scales were slightly different than the example.

Thank you, that’s very reassuring. I am very self-conscious and so far the plots all were much closer, so I got a bit spooked there.

I’ll go practice the troubleshooting on GitHub with this, so maybe they’d include a new figure as an example. :slight_smile:

Have a great Sunday!

The provided Figure_3.png in this exercise is updated and should correspond with the data currently provided :slight_smile: (the one in my question actually also started with May data with Jan label)
Gotta love this community, such amazingly quick and kind feedback. I am very glad I’m on FCC for learning how to deal with GitHub.
Have a lovely summer everyone, and good luck in your learning!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.