Tag Archives: python for business analysts

Python Built-in Methods – Python Set copy() Method

Python Set copy() Method Copies the set shallowly Usage The copy() method returns the Shallow copy of the specified set. Syntax set.copy() Basic Example # Copy set ‘S’ to ‘x’ S = {‘red’, ‘green’, ‘blue’} x = S.copy() print(x) # Prints {‘blue’, ‘green’, ‘red’} copy() vs Assignment statement Assignment statement does not copy objects. For example, old_Set = {‘red’, ‘green’, …

Python Built-in Methods – Python Set clear() Method

Python Set clear() Method Removes all items from the set Usage Use clear() method to remove all items from the set. The method does not return anything; it just updates the set. Syntax set.clear() Basic Example # Clear the set S = {‘red’, ‘green’, ‘blue’} S.clear() print(S) # Prints set()   Python Example for Beginners Special 95% discount …

Beginner’s Data Science Project – Data Science Project on Area and Population

Data Science Project on Area and Population   In this project we’ll use the size of points to indicate the area and populations of California cities. We would like a legend that specifies the scale of the sizes of the points, and we’ll accomplish this by plotting some labeled data with no entries. You can …

Boosting Ensemble Machine Learning algorithms in Python using scikit-learn

(Boosting Ensemble Machine Learning algorithms in Python using scikit-learn) In this Learn through Codes example, you will learn Boosting Ensemble Machine Learning algorithms in Python using scikit-learn.  Boosting_Ensemble_Machine_Learning_algorithms_in_Python_using scikit_learn   Python Example for Beginners Special 95% discount 2000+ Applied Machine Learning & Data Science Recipes Portfolio Projects for Aspiring Data Scientists: Tabular Text & …

How to compare machine learning algorithms in Python using sklearn

(How to compare machine learning algorithms in Python using sklearn) In this Learn through Codes example, you will learn How to compare machine learning algorithms in Python using sklearn.  Compare_machine_learning_algorithms_in_Python_using_sklearn Python Example for Beginners Special 95% discount 2000+ Applied Machine Learning & Data Science Recipes Portfolio Projects for Aspiring Data Scientists: Tabular Text & …

Keras Deep Learning with Grid Search using sklearn

(Keras Deep Learning with Grid Search using sklearn) In this Learn through Codes example, you will learn Keras Deep Learning with Grid Search using sklearn.  Keras_Deep_Learning_with_Grid_Search_using_sklearn 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 as …

Pandas Example – Write a Pandas program to create a monthly time period and display the list of names in the current local scope

(Python Example for Beginners)   Write a Pandas program to create a monthly time period and display the list of names in the current local scope. Sample Solution: Python Code : import pandas as pd mtp = pd.Period(‘2021-11′,’M’) print(“Monthly time perid: “,mtp) print(“nList of names in the current local scope:”) print(dir(mtp)) Sample Output: Monthly time …

Pandas Example – Write a Pandas program to calculate all Thursdays between two given days

(Python Example for Beginners)   Write a Pandas program to calculate all Thursdays between two given days.   Sample Solution: Python Code : import pandas as pd thursdays = pd.date_range(‘2020-01-01’, ‘2020-12-31’, freq=”W-THU”) print(“All Thursdays between 2020-01-01 and 2020-12-31:n”) print(thursdays.values) Sample Output: All Thursdays between 2020-01-01 and 2020-12-31: [‘2020-01-02T00:00:00.000000000’ ‘2020-01-09T00:00:00.000000000’ ‘2020-01-16T00:00:00.000000000’ ‘2020-01-23T00:00:00.000000000’ ‘2020-01-30T00:00:00.000000000’ ‘2020-02-06T00:00:00.000000000’ ‘2020-02-13T00:00:00.000000000’ ‘2020-02-20T00:00:00.000000000’ …

Machine Learning Classification Algorithms in scikit learn package

(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 as well …

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

(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 = pd.Timestamp(‘2019-01-01’, …