Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have a dataset that has dates of births listed in the column (xx/xx/xxxx). How do I script a code in Python to changes these

I have a dataset that has dates of births listed in the column (xx/xx/xxxx). How do I script a code in Python to changes these to single age numbers as of 12/31/2022? (So line zero should read 89) Below is a snapshot of some of my data. I would also like to change the heading to read 'Age' versus DOB. How would I do that? 

 

image.png 

Case Number APS Filed 0 2021-10-02949 1 2022-10-03024 2 2022-10-03024 3 2021-06-01815 4 2021-08-02482 Suspicious Activity Gender Suspicious Call Female 5/5/1933 No Unusual/unexplained Activity Female 6/17/1966 No Unusual/unexplained Activity Male 11/14/1963 Fraudulent Patterns Female 6/16/1937 No 2 2 2 No Unknown Source of Funds DOB US Citizen Male 10/29/1962 Yes Yes Yes Yes Yes State Product New Mexico Life Insurance Georgia Fixed Annuity Georgia Fixed Annuity Michigan Life Insurance New York Life Insurance

Step by Step Solution

3.44 Rating (160 Votes )

There are 3 Steps involved in it

Step: 1

Python code import pandas as pd from datetime import datetime Sample data data Case Number 20... 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions