In [1]:
#ecom = pd.read_csv('Ecommerce.csv')
import pandas as pd
ecom=pd.read_csv("Ecommerce.csv")
Hard: How many people have a credit card that expires in 2025?
In [44]:
ecom['CC Exp Date'].iloc[0][3:]
Out[44]:
In [47]:
sum(ecom['CC Exp Date'].apply(lambda X: X[3:]) == '25')
Out[47]:
In [37]:
sum(ecom['CC Exp Date'].apply(lambda x: x[3:]) == '25')
Out[37]:
In [6]:
ecom['CC Exp Date'].apply(lambda x: x[3:]).head(5)
Out[6]:
In [8]:
ecom['CC Exp Date'].head(1)
Out[8]:
In [35]:
ecom['CC Exp Date'].iloc[0]
Out[35]:
In [36]:
ecom['CC Exp Date'].iloc[0][3:]
Out[36]:
Hard: What are the top 5 most popular email providers/hosts (e.g. gmail.com, yahoo.com, etc...)
ecom['Email'].apply(lambda x: x.split('@')[1]).value_counts().head(5)¶
In [53]:
ram=ecom["Email"].iloc[0]
ram.split('@')[1]
Out[53]:
In [30]:
ecom["Email"].iloc[0]
Out[30]:
In [31]:
ep=ecom["Email"].iloc[0]
In [32]:
ep.split('@')
Out[32]:
In [33]:
ep.split('@')[1]
Out[33]:
In [56]:
ecom['Email'].apply(lambda x: x.split('@')[1]).value_counts().head(5)
Out[56]:
No comments:
Post a Comment