Tag Archives: python data science

Loops in Python for Business Analyst

Loops in Python for Business Analyst Choosing the Right Loop Construct Python offers a variety of constructs to do loops. This article presents them and gives advice on their specific usage. Furthermore, we will also have a look at the performance of each looping construct in your Python code. It might be surprising for you. …

TensorFlow Neural Network Tutorial in Python

  TensorFlow Neural Network Tutorial in Python TensorFlow is an open-source library for machine learning applications. It’s the Google Brain’s second generation system, after replacing the close-sourced DistBelief, and is used by Google for both research and production applications. TensorFlow applications can be written in a few languages: Python, Go, Java and C. This post …

Python Exception Handling

  Python Exception Handling This tutorial will give an introduction to what Python exceptions are, the most common types of exceptions, and how to handle raised exceptions with the try and except clauses. What is a Python Exception? A Python exception is a construct used to signal an important event, usually an error, that occurs when executing a program. …

How to List Files in a Directory using Python

How to List Files in a Directory using Python Using os.walk() The os module contains a long list of methods that deal with the filesystem, and the operating system. One of them is walk(), which generates the filenames in a directory tree by walking the tree either top-down or bottom-up (with top-down being the default setting). os.walk() returns a list …

How to Save and Restore scikit learn Models

  How to Save and Restore scikit learn Models On many occasions, while working with the scikit-learn library, you’ll need to save your prediction models to file, and then restore them in order to reuse your previous work to: test your model on new data, compare multiple models, or anything else. This saving procedure is also known …

Machine Learning Mastery: Linear Regression Using Tensorflow

Linear Regression Using Tensorflow   Brief Summary of Linear Regression Linear Regression is a very common statistical method that allows us to learn a function or relationship from a given set of continuous data. For example, we are given some data points of x and corresponding y and we need to learn the relationship between them that is called …

Data Wrangling in Python – How to Do Random Sampling Dataframe

Random Sampling Dataframe import modules import pandas as pd import numpy as np Create dataframe raw_data = {‘first_name’: [‘Jason’, ‘Molly’, ‘Tina’, ‘Jake’, ‘Amy’], ‘last_name’: [‘Miller’, ‘Jacobson’, ‘Ali’, ‘Milner’, ‘Cooze’], ‘age’: [42, 52, 36, 24, 73], ‘preTestScore’: [4, 24, 31, 2, 3], ‘postTestScore’: [25, 94, 57, 62, 70]} df = pd.DataFrame(raw_data, columns = [‘first_name’, ‘last_name’, ‘age’, …