Python

Difference between np.asarray() and np.array()

In this tutorial we will discuss about difference between np.asarray() and np.array(). The main difference between both are Numpy functions used to generate arrays from array like objects but they have some difference on their behaviour. The array() method creates a copy of an existing object whereas asarray creates a new object only when needed. …

Difference between np.asarray() and np.array() Read More »

Count special characters in a string in Python

Description: To count a special characters in a string in python, we can use a string method “Regular expression”. In this ‘re’ special characters can be defined all the non-alphanumeric characters in the string. Using Regular Expression:import redef count_special_characters(s): special_characters_pattern = r'[^a-zA-Z0-9\s]’ special_characters = re.findall(special_character_pattern, s) return len(special_characters)input_string = “Hi, hello, Welcome! to @1year”count = …

Count special characters in a string in Python Read More »

Optimization of Modeling Pipeline Optimization with scikit-learn

Hello! We’re going to explore how to optimize a modeling pipeline using scikit-learn, one of the most popular machine-learning libraries in Python. Optimizing your pipeline can greatly enhance the performance of your models by automating the process of selecting the best parameters and improving the overall workflow. We will be using the famous Iris dataset, …

Optimization of Modeling Pipeline Optimization with scikit-learn Read More »

Scroll to Top