Python for Citizen Data Scientist

How to Rescale Data with Normalization and Standarization in Python

Hits: 19 (How to Rescale Data with Normalization and Standarization in Python) In this Learn through Codes example, you will learn how to Rescale Data with Normalization and Standarization in Python.    Python Example for Beginners Special 95% discount 2000+ Applied Machine Learning & Data Science Recipes Portfolio Projects for Aspiring Data Scientists: Tabular …

Machine Learning Classification Algorithms in scikit learn package

Hits: 9 (Machine Learning Classification Algorithms in scikit learn package) In this Learn through Codes example, you will learn Machine Learning Classification Algorithms in scikit learn package.  Python Example for Beginners Special 95% discount 2000+ Applied Machine Learning & Data Science Recipes Portfolio Projects for Aspiring Data Scientists: Tabular Text & Image Data Analytics …

Pandas Example – Write a Pandas program to remove the time zone information from a Time series data

Hits: 7 (Python Example for Beginners)   Write a Pandas program to remove the time zone information from a Time series data.   Sample Solution: Python Code : import pandas as pd date1 = pd.Timestamp(‘2019-01-01′, tz=’Europe/Berlin’) date2 = pd.Timestamp(‘2019-01-01′, tz=’US/Pacific’) date3 = pd.Timestamp(‘2019-01-01′, tz=’US/Eastern’) print(“Time series data with time zone:”) print(date1) print(date2) print(date3) print(“nTime series …

Pandas Example – Write a Pandas program to create a time series object with a time zone

Hits: 3 (Python Example for Beginners)   Write a Pandas program to create a time series object with a time zone.   Sample Solution: Python Code : import pandas as pd print(“Timezone: Europe/Berlin:”) print(“Using pytz:”) date_pytz = pd.Timestamp(‘2019-01-01’, tz = ‘Europe/Berlin’) print(date_pytz.tz) print(“Using dateutil:”) date_util = pd.Timestamp(‘2019-01-01’, tz = ‘dateutil/Europe/Berlin’) print(date_util.tz) print(“nUS/Pacific:”) print(“Using pytz:”) date_pytz …

Pandas Example – Write a Pandas program to split a given dataset using group by on multiple columns and drop last n rows of from each group

Hits: 3 (Python Example for Beginners)   Write a Pandas program to split a given dataset using group by on multiple columns and drop last n rows of from each group.   Test Data: ord_no purch_amt ord_date customer_id salesman_id 0 70001 150.50 2012-10-05 3002 5002 1 70009 270.65 2012-09-10 3001 5003 2 70002 65.26 2012-10-05 …

Pandas Example – Write a Pandas program to split a given dataset using group by on specified column into two labels and ranges

Hits: 6 (Python Example for Beginners)   Write a Pandas program to split a given dataset using group by on specified column into two labels and ranges. Split the group on ‘salesman_id’, Ranges: 1) (5001…5006) 2) (5007..5012)   Test Data: salesman_id sale_jan 0 5001 150.50 1 5002 270.65 2 5003 65.26 3 5004 110.50 4 …

How to plot learning curve of an xgboost model

Hits: 10 (How to plot learning curve of an xgboost model) In this Learn through Codes example, you will learn how to plot learning curve of an xgboost model.    Python Example for Beginners Free Machine Learning & Data Science Coding Tutorials in Python & R for Beginners. Subscribe @ Western Australian Center for …

Pandas Example – Write a Pandas program to split a given dataset, group by one column and apply an aggregate function to few columns and another aggregate function to the rest of the columns of the dataframe

Hits: 10 (Python Example for Beginners)   Write a Pandas program to split a given dataset, group by one column and apply an aggregate function to few columns and another aggregate function to the rest of the columns of the dataframe.   Test Data: salesman_id sale_jan sale_feb sale_mar sale_apr sale_may sale_jun 0 5002 150.50 250.50 …

Pandas Example – Write a Pandas program to split a given dataset, group by two columns and convert other columns of the dataframe into a dictionary with column header as key

Hits: 4 (Python Example for Beginners)   Write a Pandas program to split a given dataset, group by two columns and convert other columns of the dataframe into a dictionary with column header as key. Test Data: school class name date_Of_Birth age height weight address S1 s001 V Alberto Franco 15/05/2002 12 173 35 street1 …

Pandas Example – Write a Pandas program to split a dataset, group by one column and get mean, min, and max values by group, also change the column name of the aggregated metric

Hits: 3 (Python Example for Beginners)   Write a Pandas program to split a dataset, group by one column and get mean, min, and max values by group, also change the column name of the aggregated metric. Using the following dataset find the mean, min, and max values of purchase amount (purch_amt) group by customer …

Pandas Example – Write a Pandas program to split the following datasets into groups on customer id and calculate the number of customers

Hits: 7 (Python Example for Beginners)   Write a Pandas program to split the following datasets into groups on customer id and calculate the number of customers starting with ‘C’, the list of all products and the difference of maximum purchase amount and minimum purchase amount. Test Data: ord_no purch_amt ord_date customer_id salesman_id 0 70001 …

Pandas Example – Write a Pandas program to split a given dataframe into groups with bin counts

Hits: 5 (Python Example for Beginners)   Write a Pandas program to split a given dataframe into groups with bin counts. Test Data: ord_no purch_amt customer_id sales_id 0 70001 150.50 3005 5002 1 70009 270.65 3001 5003 2 70002 65.26 3002 5004 3 70004 110.50 3009 5003 4 70007 948.50 3005 5002 5 70005 2400.60 …

Pandas Example – Write a Pandas program to split a given dataframe into groups and create a new column with count from GroupBy

Hits: 2 (Python Example for Beginners)   Write a Pandas program to split a given dataframe into groups and create a new column with count from GroupBy.   Test Data: book_name book_type book_id 0 Book1 Math 1 1 Book2 Physics 2 2 Book3 Computer 3 3 Book4 Science 4 4 Book1 Math 1 5 Book2 …

Pandas Example – Write a Pandas program to split a given dataframe into groups and list all the keys from the GroupBy object

Hits: 2 (Python Example for Beginners)   Write a Pandas program to split a given dataframe into groups and list all the keys from the GroupBy object. Test Data: school_code class name date_Of_Birth age height weight S1 s001 V Alberto Franco 15/05/2002 12 173 35 S2 s002 V Gino Mcneill 17/05/2002 12 192 32 S3 …

Pandas Example – Write a Pandas program to split the following dataframe into groups based on all columns and calculate GroupBy value counts on the dataframe

Hits: 4 (Python Example for Beginners)   Write a Pandas program to split the following dataframe into groups based on all columns and calculate GroupBy value counts on the dataframe.   Test Data: id type book 0 1 10 Math 1 2 15 English 2 1 11 Physics 3 1 20 Math 4 2 21 …

Pandas Example – Write a Pandas program to split the following dataframe into groups and calculate monthly purchase amount

Hits: 3 (Python Example for Beginners)   Write a Pandas program to split the following dataframe into groups and calculate monthly purchase amount.   Test Data: ord_no purch_amt ord_date customer_id salesman_id 0 70001 150.50 05-10-2012 3001 5002 1 70009 270.65 09-10-2012 3001 5005 2 70002 65.26 05-10-2012 3005 5001 3 70004 110.50 08-17-2012 3001 5003 …