1# install pandas (basic, if path is not set yet)
2py -m pip install pandas
3# or set PATH to use pip:
4setx PATH "%PATH%;C:\<path\to\python\directory\>\Scripts"
5pip install pandas
6# if "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed" [!]:
7py -m pip install --trusted-host pypi.python.org pip pandas
8# if PermissionError: [WinError 5] Access is denied
9py -m pip install --user pandas
10# or via creating a virtual environment venv:
11py -m venv c:\path\to\new\environment
12# then execute:
13c:\path\to\new\environment\Scripts\activate.bat
1If you use Anaconda then it is preinstalled
2otherwise: pip install pandas
3
4import pandas as pd
5pd.__version__
1#for dropping a column in a dataframe
2df = df.drop(['PassengerId'], axis = 1)
3
4#for selecting all columns except one
5df.iloc[:, df.columns != "Survived"]
6
7#for checking nan values is a column
8df['your column name'].isnull()
1df = pd.DataFrame(np.random.randn(1000, 4), index=ts.index,
2 .....: columns=['A', 'B', 'C', 'D'])
3 .....:
4
5In [137]: df = df.cumsum()
6
7In [138]: plt.figure()
8Out[138]: <Figure size 640x480 with 0 Axes>
9
10In [139]: df.plot()
11Out[139]: <matplotlib.axes._subplots.AxesSubplot at 0x7f53723daa10>
12
13In [140]: plt.legend(loc='best')
14Out[140]: <matplotlib.legend.Legend at 0x7f5369d93dd0>