Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the month_name() function instead of month to show the month names instead of the month numbers in python Sample data purchase_date product_type 01/01/2020 Canvas

Use the month_name() function instead of month to show the month names instead of the month numbers in python

Sample data

purchase_date

product_type

01/01/2020

Canvas Painting

02/01/2020

Framed Poster

03/01/2020

Framed Poster

04/01/2020

Framed Poster

05/01/2020

Canvas Painting

06/01/2020

Poster Print

07/01/2020

Framed Poster

08/01/2020

Framed Poster

09/01/2020

Canvas Painting

10/01/2020

Framed Poster

My code isn't working

import pandas as pd

import numpy as np

from datetime import datetime

df = pd.read_csv('sales.csv')

df['month'] = pd.DatetimeIndex(df['purchase_date']).month_name()

df['month'].value_counts()

print(df.month_name.value_counts())

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

b. Where did they come from?

Answered: 1 week ago

Question

c. What were the reasons for their move? Did they come voluntarily?

Answered: 1 week ago

Question

5. How do economic situations affect intergroup relations?

Answered: 1 week ago