My Guided Project: Pandas fundamentals

Hi, This is my work on pandas fundamental Guided Project.
I will appreciate your advice on my work.
cheers :slight_smile:

Exploring Ebay Car Sale Data | Dataquest

Basics.ipynb (185.9 KB)

Click here to view the jupyter notebook file in a new tab

1 Like

HI @reza_45, congratulations for having completed the guided project I have gone through your work and everything is well detailed. I have been impressed on how you have organized your work with the help of table of content.

Having said that, have got few suggestions;

  • your introduction is not that well digested. It would be better to add the goal or the aim of the project, and give some information on the data background .
  • Your project is also missing conclusion, which is very important when working on any project.
  • And when you apply groupby () function on a dataframe ,reset the given column back to the column using reset_index() on that dataframe, otherwise that column will be treated as an index and not as a column again. This is one of your code with groupby function
# aggregate prices by unrrepaired_damage to find mean price
dudap =autos[['unrepaired_damage', 'price']].groupby(by=['unrepaired_damage']).mean()
print(dudap)
# print the result
print('The un_repaired damaged cars are {:.0%} cheaper.'.format(1 - dudap.loc['yes','price']/dudap.loc['no','price']))

output

                         price
unrepaired_damage             
yes                2207.283669
no                 6479.250803
The un_repaired damaged cars are 66% cheaper.

You can confirm that unrepaired_damage is now considered as an index, to avoid this use
reset_index() on your dataframe like this dudap .reset_index()

2 Likes

Hi @brayanopiyo18
Thank you for your time and advice. It was a very good point to remember to reset index, although it did not affect my work at this stage, I would remember this whenever I will save groupby() output as a dataframe.
cheers

1 Like