Pandas Basic Functions
Pandas Basic Functions
Here is a list of some basic and commonly used functions in the Pandas library:
1. **Creating DataFrames:**
- `pd.DataFrame(data)`: Create a DataFrame from a dictionary,
list, or another DataFrame.
3. **Data Inspection:**
- `df.head(n)`: Return the first `n` rows of the DataFrame.
- `df.tail(n)`: Return the last `n` rows of the DataFrame.
- `df.info()`: Print a concise summary of the DataFrame.
- `df.describe()`: Generate descriptive statistics.
5. **Data Cleaning:**
- `df.dropna()`: Remove missing values.
- `df.fillna(value)`: Fill missing values with a specified value.
- `df.drop(columns=['col1', 'col2'])`: Drop specified columns.
- `df.rename(columns={'old_name': 'new_name'})`: Rename
columns.
6. **Data Manipulation:**
- `df.sort_values(by='column_name')`: Sort the DataFrame by a
specified column.
- `df.groupby('column_name')`: Group the DataFrame using a
column.
- `df.merge(other_df, on='key')`: Merge DataFrames on a key
column.
- `df.concat([df1, df2])`: Concatenate DataFrames.
10. **Visualization:**
- `df.plot()`: Basic plotting of DataFrame columns.
These functions should cover a wide range of basic operations you might need when
working with Pandas.