- Matplotlib for Python Developers
- Aldrin Yim Claire Chung Allen Yu
- 240字
- 2021-08-27 18:48:19
pandas DataFrame
You may often see df appearing on Python-based data science resources and literature. It is a conventional way to denote the pandas DataFrame structure. pandas lets us perform the otherwise tedious operations on tables (data frames) with simple commands, such as dropna(), merge(), pivot(), and set_index().
pandas is designed to streamline handling processes of common data types, such as time series. While NumPy is more specialized in mathematical calculations, pandas has built-in string manipulation functions and also allows custom functions to be applied to each cell via apply().
Before use, we import the module with the conventional shorthand as:
pd.DataFrame(my_list_or_array)
To read data from existing files, just use the following:
pd.read_csv()
For tab-delimited files, just add '\t' as the separator:
pd.read_csv(sep='\t')
pandas supports data import from a wide range of common file structures for data handling and processing, from pd.read_xlsx() for Excel and pd.read_sql_query() for SQL databases to the more recently popular JSON, HDF5, and Google BigQuery.
pandas provides a collection of handy operations for data manipulation and is considered a must-have in a Python data scientist's or developer's toolbox.
To fully understand and utilize the functionalities, you may want to read more from the official documentation:
- 數(shù)據(jù)科學(xué)實(shí)戰(zhàn)手冊(cè)(R+Python)
- Windows系統(tǒng)管理與服務(wù)配置
- Elastic Stack應(yīng)用寶典
- 編譯系統(tǒng)透視:圖解編譯原理
- FFmpeg入門詳解:音視頻原理及應(yīng)用
- Redis Essentials
- 高級(jí)語言程序設(shè)計(jì)(C語言版):基于計(jì)算思維能力培養(yǎng)
- Swift細(xì)致入門與最佳實(shí)踐
- Haskell Data Analysis Cookbook
- Visual Basic程序設(shè)計(jì)上機(jī)實(shí)驗(yàn)教程
- TMS320LF240x芯片原理、設(shè)計(jì)及應(yīng)用
- C語言程序設(shè)計(jì)與應(yīng)用(第2版)
- Beginning C++ Game Programming
- PHP 7從零基礎(chǔ)到項(xiàng)目實(shí)戰(zhàn)
- Deep Learning with R Cookbook