Data_Insight.txt - Get the Data df =...

This preview shows page 1 - 2 out of 2 pages.

# Get the Data df = pd.read_csv('24_Uberdrive.csv') #View the first 5 rows of data df.head(5) #View the last 5 rows of data df.tail() # understand shape and size of data print(df.shape) print(df.size) #Get a summary of the numerical columns in the data df.describe() #get more information about data df.info() #Get the number of missing values in each column df.isnull().sum() # Get the initial data with dropping the NA values df = df.dropna() #Get the shape of the dataframe after removing the null values df.shape #get the summary of data df.describe() ------------------------------------------------------------- Lets explore the data parameter wise - 1.Destination - (starting and stopping) 2.Time - (hour of the day, day of week, month of year) 3.Categories 4.Purpose 5.Grouping two parameters to get more insights --------------------------------------------------------------- # Get the starting destination, unique destination
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

Unformatted text preview: print(df['START*'].unique()) #names of unique start points print(len(df['START*'].unique())) #count of unique start points # Get the starting destination, unique destination print(df['STOP*'].unique()) #names of unique start points print(len(df['STOP*'].unique())) #count of unique start points #Identify popular start destinations - top 10 df['START*'].value_counts().head(10) #Identify popular stop destinations - top 10 df['STOP*'].value_counts().head(10) #Find out most farthest start and stop pair -top10 #Dropping Unknown Location Value df2 = df[df['START*']!= 'Unknown Location'] df2 = df2[df2['STOP*']!= 'Unknown Location'] df2.groupby(['START*','STOP*']) ['MILES*'].sum().sort_values(ascending=False).head(10) #Find out most popular start and stop pair - top10 df2.groupby(['START*','STOP*']).size().sort_values(ascending=False).head(10)...
View Full Document

  • Fall '19
  • Column, Start, Stop consonant, START I

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors