Skip to content

nilkamalsaha/Creating-New-Columns-in-Python

Repository files navigation

Introduction

After cleaning data types & issues, you may still not have the exact data that you need, so you can create new columns from existing data to aid your analysis.

  • Numeric columns – calculating percenatges, applying conditional calculations etc.
  • Datetime columns – extracting datetime components, applying datetime calculations etc.
  • Text columns – extracting text, splitting into multuiple columns, finding patterns etc.

image

Creating-Numeric-Columns-in-Python

Hello,

I've attached the data on our JUne pen sales.

Can you create two new columns?

  • A "Total Spend" column that includes both the pen cost and shipping cost for each sale
  • A "Free Shipping" column that says yes if the sale included free shipping, and no otherwise

Thanks!

Peter

Key Objectives

  1. Read Data into Python
  2. Check the data type of each column
  3. Create a numeric column using arithmetic
  4. Create a numeric column using condition logic

Creating-DateTime-Columns-in-Python

Hello agin,

Using the data I sent over last week, can you calculate the number of days between the purchase and delivery date for each sale and save it as a new column called 'Delivery Time'?

What were the average days from purchase to delivery?

Thanks ! Peter

Key Objectives

  1. Calculate the difference between two datetime columns and save it as a new colum
  2. Take the average of the new column.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published