Professional Documents
Culture Documents
Project 1
DESCRIPTION
- Provide the trend chart for the number of complaints at monthly and daily
granularity levels.
Extracting just Month and Year separately from Pandas Datetime column
df["date_index"] = df["Date_month_year"] + " " + df["Time"]
df["date_index"] = pd.to_datetime(df["date_index"])
df["Date_month_year"] = pd.to_datetime(df["Date_month_year"])
Now find the data types for better understanding of the data.
df.dtypes
Now use the Indexing function to get the date and time in the index column
/ 1st column
df = df.set_index(df["date_index"])
In the above screen shot, June has huge count 1046 and in that if we try to
find the 1st top 3 items in descending order highest being the first, then
we have the below details
Now using the plot method
df["Date_month_year"].value_counts().plot();
- Provide a table with the frequency of complaint types.
So we verify the same in the pivot table to get the items listed below
So using the groupby function, try to sort out the items coming under Open
& Closed
- Provide state wise status of complaints in a stacked bar chart. Use the
categorized variable from Q3. Provide insights on:
So all defined functions will have return value, so here we are returning
the value in % format by multiplying the same to 100.