Python for Data Analysis: A Step-By-Step Guide to Master the Basics of Data Science and Analysis in Python Using Pandas, Numpy And Ipython (Data Science Mastery Book 2) by Park Andrew
Author:Park, Andrew [Park, Andrew]
Language: eng
Format: epub
Published: 2020-07-05T16:00:00+00:00
Chapter 6
Pandas
Pandas are built on NumPy and they are meant to be used together. This makes it extremely easy to extract arrays from the data frames. Once these arrays are extracted, they can be turned into data frames themselves. Let’s take a look at an example:
In: import pandas as pd
import numpy as np
marketing_filename = 'regression-datasets-marketing.csv'
marketing = pd.read_csv(marketing _filename, header=None)
In this phase, we are uploading data to a data frame. Next, we’re going to use the “values” method to extract an array that is of the same type as those contained inside the data frame.
In: marketing_array = marketing.values
marketing_array.dtype
Out: dtype('float64')
We can see that we have a float type array. You can anticipate the type of the array by first using the “dtype” method. This will establish which types are being used by the specified data frame object. Do this before extracting the array. This is how this operation would look:
In: marketing.dtypes
Out: 0float64
1int64
2float64
3int64
4float64
5float64
6float64
7float64
8int64
9int64
10int64
11float64
12float64
13float64
dtype: object
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Access | Data Mining |
Data Modeling & Design | Data Processing |
Data Warehousing | MySQL |
Oracle | Other Databases |
Relational Databases | SQL |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8264)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6434)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6393)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6284)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6058)
Driving Data Quality with Data Contracts by Andrew Jones(6022)
Learning SQL by Alan Beaulieu(5967)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(5789)
Weapons of Math Destruction by Cathy O'Neil(5728)
Big Data Analysis with Python by Ivan Marin(5194)
Data Engineering with dbt by Roberto Zagni(4216)
Solidity Programming Essentials by Ritesh Modi(3857)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3705)
Pandas Cookbook by Theodore Petrou(3420)
Blockchain Basics by Daniel Drescher(3280)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2893)
Feature Store for Machine Learning by Jayanth Kumar M J(2803)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2785)
Mastering Python for Finance by Unknown(2737)
