
Python Data Science Cookbook
Practical solutions across fast data cleaning, processing, and machine learning workflows with pandas, NumPy, and scikit-learn
PAYBACK Punkte
26 °P sammeln!
This book's got a bunch of handy recipes for data science pros to get them through the most common challenges they face when using Python tools and libraries. Each recipe shows you exactly how to do something step-by-step. You can load CSVs directly from a URL, flatten nested JSON, query SQL and NoSQL databases, import Excel sheets, or stream large files in memory-safe batches. Once the data's loaded, you'll find simple ways to spot and fill in missing values, standardize categories that are off, clip outliers, normalize features, get rid of duplicates, and extract the year, month, or weekday ...
This book's got a bunch of handy recipes for data science pros to get them through the most common challenges they face when using Python tools and libraries. Each recipe shows you exactly how to do something step-by-step. You can load CSVs directly from a URL, flatten nested JSON, query SQL and NoSQL databases, import Excel sheets, or stream large files in memory-safe batches. Once the data's loaded, you'll find simple ways to spot and fill in missing values, standardize categories that are off, clip outliers, normalize features, get rid of duplicates, and extract the year, month, or weekday from timestamps. You'll learn how to run quick analyses, like generating descriptive statistics, plotting histograms and correlation heatmaps, building pivot tables, creating scatter-matrix plots, and drawing time-series line charts to spot trends. You'll learn how to build polynomial features, compare MinMax, Standard, and Robust scaling, smooth data with rolling averages, apply PCA to reduce dimensions, and encode high-cardinality fields with sparse one-hot encoding using feature engineering recipes. As for machine learning, you'll learn to put together end-to-end pipelines that handle imputation, scaling, feature selection, and modeling in one object, create custom transformers, automate hyperparameter searches with GridSearchCV, save and load your pipelines, and let SelectKBest pick the top features automatically. You'll learn how to test hypotheses with t-tests and chi-square tests, build linear and Ridge regressions, work with decision trees and random forests, segment countries using clustering, and evaluate models using MSE, classification reports, and ROC curves. And you'll finally get a handle on debugging and integration: fixing pandas merge errors, correcting NumPy broadcasting mismatches, and making sure your plots are consistent. Key Learnings You can load remote CSVs directly into pandas using read_csv, so you don't have to deal with manual downloads and file clutter. Use json_normalize to convert nested JSON responses into simple tables, making it a breeze to analyze. You can query relational and NoSQL databases directly from Python, and the results will merge seamlessly into Pandas. Find and fill in missing values using IGNSA(), forward-fill, and median strategies for all of your data over time. You can free up a lot of memory by turning string columns into Pandas' Categorical dtype. You can speed up computations with NumPy vectorization and chunked CSV reading to prevent RAM exhaustion. You can build feature pipelines using custom transformers, scaling, and automated hyperparameter tuning with GridSearchCV. Use regression, tree-based, and clustering algorithms to show linear, nonlinear, and group-specific vaccination patterns. Evaluate models using MSE, R², precision, recall, and ROC curves to assess their performance. Set up automated data retrieval with scheduled API pulls, cloud storage, Kafka streams, and GraphQL queries. Table of Content Data Ingestion from Multiple Sources Preprocessing and Cleaning Complex Datasets Performing Quick Exploratory Analysis Optimizing Data Structures and Performance Feature Engineering and Transformation Building Machine Learning Pipelines Implementing Statistical and Machine Learning Techniques Debugging and Troubleshooting Advanced Data Retrieval and Integration