<jupyter_start><jupyter_text>Pandas In computer programming, pandas is a software library written for the Python programming language for data manipulation and analysis. Pandas DataFrame is two-dimensional heterogeneous tabular data structure with labeled axes (rows and columns). Pandas DataFrame consists of three principal components, the data, rows, and columns.<jupyter_code>import pandas as pd
import numpy as np
data = [10,100,1000]
df = pd.DataFrame(data)
df
arr = np.array([['col1', 'col2', 'col3'], [2.3, 1.1, 2.4], [0, 0.88, 13.7]])

df2 = pd.DataFrame(arr)
df2
df2 = pd.DataFrame(arr[1:,], columns = arr[0,])
df2
df.shape<jupyter_output><empty_output><jupyter_text>Creating DataFrame from dictionary<jupyter_code>data = {'Name':["Alice","Bob","Chris"],
       'Age':[21,49,43]}
df = pd.DataFrame(data)
df<jupyter_output><empty_output><jupyter_text>Reading a CSV file<jupyter_code>df = pd.read_csv('Pandas Datasets/nba.csv')
df
df = pd.read_csv('Pandas Datasets/nba.csv', index_col = "Name")
df<jupyter_output><empty_output><jupyter_text>Missing values<jupyter_code>df.isna()
df.dropna()
df
df.fillna(0)
df.iloc[0:10, 0:4]
df.iloc[[0, 2, 4, 6, 8], [3, 4, 5]]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14929107589658047, 'fraction_numerical': 0.042535446205170975, 'mean_word_length': 6.6923076923076925, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '318094', 'license': 'MIT', 'n_tokens_mistral': 487, 'n_tokens_neox': 455, 'n_words': 111, 'path': 'Workshop1-2/Pandas/pandas.ipynb', 'repo_name': 'pythonsolidity/python-workshops', 'size': '1199'}