Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install and use pandas in python

Shulou Source: shulou.com Published: 2022-05-31 17:51:14 09月26日 Update

This article mainly introduces the relevant knowledge of how to install and use pandas in python, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will have something to gain after reading this article on how to install and use pandas in python. Let's take a look.

Description

1. The combined abbreviation of python+data+analysis is a third-party data analysis library based on numpy and matplotlib in python.

2. Together constitute the basic toolkit for python data analysis, with the names of three swordsmen.

Installation

Open cmd and enter the following three commands in turn.

Pip install pandas-I https://pypi.tuna.tsinghua.edu.cn/simplepip install numpy-I https://pypi.tuna.tsinghua.edu.cn/simplepip install matplotlib-I https://pypi.tuna.tsinghua.edu.cn/simple

Pandas selection data

Import pandas as pdimport numpy as npdates = pd.date_range ('20210301, periods=6) df1 = pd.DataFrame (np.arange (24). Reshape ((6, 4)), index=dates, columns= [' A', 'Bao,' C,'D']) print (df1)

Pandas assignment and operation

Import pandas as pdimport numpy as npdates = pd.date_range ('20210301, periods=6) df1 = pd.DataFrame (np.arange (24). Reshape ((6, 4)), index=dates, columns= [' A', 'Bao,' C,'D']) print (df1)

How to deal with empty data in pandas

Import pandas as pdimport numpy as npdates = pd.date_range ('20210301, periods=6) df1 = pd.DataFrame (np.arange (24). Reshape ((6, 4)), index=dates, columns= [' A','B','C','D']) df2 = pd.DataFrame (df1, index=dates, columns= ['A','B','C','E','F']) S1 = pd.Series ([3,4,6,7]) Index=dates [: 4]) # assign the first to the fourth data S2 = pd.Series ([32, 5, 2, 1], index=dates [2:]) # assign the third data to the last data df2 ['E'] = s1df2 ['F'] = s2print (df2) this is the end of the article on "how to install and use pandas in python" Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to install and use pandas in python". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Data three knowledge content data analysis article analysis value swordsman name command foundation tool kit easy to operate article easy to understand more see third party Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft vpn MariaDB Apple Docker