Skip to content

Commit 39e7a0f

Browse files
committed
Corrects tables and indents
1 parent 2d44bba commit 39e7a0f

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

docs/Pandas/pd_data_analysis.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Once you have loaded your data into a DataFrame, Pandas offers simple and powerf
77
Before performing any analysis, you must first understand the structure and quality of your dataset.
88
This step helps identify data types, missing values, and potential anomalies.
99

10-
```markdown
1110
|Method|Description|
1211
|:-----|:----------|
1312
|`df.head()`|Displays the first n rows (default 5) for a quick look at the data.|
@@ -17,53 +16,48 @@ This step helps identify data types, missing values, and potential anomalies.
1716
|`df.shape`|Returns a tuple (rows, columns).|
1817
|`df.dtypes`|Displays data types of all columns.|
1918

20-
```
2119

2220
2. **Handling Missing Data (NaN)**
2321

2422
Real-world data often has missing or incomplete entries.
2523
Handling them correctly is essential to avoid biased or invalid results.
2624

27-
```markdown
2825
|Method|Description|
2926
|:-----|:----------|
3027
|`df.isnull().sum()`|Counts missing (NaN) values per column.|
3128
|`df.dropna()`|Removes rows with missing values.|
3229
|`df.fillna(value)`|Fills missing values with a specific value.|
3330
|`df.fillna(df.mean())`|Fills missing values with the mean (for numeric columns).|
34-
```
31+
3532

3633
3. **Data Selection and Filtering**
3734

3835
Once the data is clean, you often need to focus on specific rows or columns to analyze relevant subsets.
3936

40-
```markdown
4137
|Method|Description|
4238
|:-----|:----------|
4339
|`df['col']`|Selects a single column (returns a Series).|
4440
|`df[['col1','col2']]`|Selects multiple columns.|
4541
|`df.loc[row_labels, col_labels]`|Selects by label (rows and columns).|
4642
|`df.iloc[row_index, col_index]`|Selects by integer index position.|
4743
|`df[df['col'] > value]`|Filters rows based on a condition.|
48-
```
44+
4945

5046
4. **Grouping and Aggregation**
5147

5248
After filtering, you often need to summarize or compare groups within your data.
5349

54-
```markdown
5550
|Method|Description|
5651
|:-----|:----------|
5752
|`df.groupby('col').agg()`|Groups data by the specified column, then applies an aggregate function (e.g., `mean()`, `sum()`, `count()`).|
5853
|`df.describe()`|Generates descriptive statistics (mean, std, min, max, etc.) for numerical columns.|
5954
|`df['col'].value_counts()`|Counts the frequency of unique values in a column.|
60-
```
55+
6156

6257
5. **Data Transformation & Cleaning**
6358

6459
Data transformation involves reshaping, reformatting, or correcting data to make it more consistent and analysis-ready.
6560

66-
```markdown
6761
|Method|Description|
6862
|:-----|:----------|
6963
|`df.rename(columns={'old':'new'})`|Renames columns.|
@@ -72,19 +66,17 @@ Data transformation involves reshaping, reformatting, or correcting data to make
7266
|`df.astype('type')`|Changes the data type of a column.|
7367
|`df.sort_values(by='col')`|Sorts rows by column values.|
7468
|`df.reset_index(drop=True)`|Resets the DataFrame index.|
75-
```
69+
7670

7771
***Quick Statistics***
7872

7973
Once the data is ready, you can compute summary statistics to get insights about its distribution and relationships.
8074

81-
```markdown
8275
|Method|Description|
8376
|:-----|:----------|
8477
|`df.rename(columns={'old':'new'})`|Renames columns.|
8578
|`df.drop(columns=['col'])`|Removes one or more columns.|
8679
|`df.replace(old, new)`|Replaces specific values.|
8780
|`df.astype('type')`|Changes the data type of a column.|
8881
|`df.sort_values(by='col')`|Sorts rows by column values.|
89-
|`df.reset_index(drop=True)`|Resets the DataFrame index.|
90-
```
82+
|`df.reset_index(drop=True)`|Resets the DataFrame index.|

docs/Pandas/pd_dataframes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Key Data Structures: Series and DataFrame
1+
# Key Data Structures: Series and DataFrame
22

33
Pandas introduces two primary data structures: the Series and the DataFrame. Understanding these is crucial, as they form the basis of nearly all operations in the library.
44

docs/Pandas/pd_input_output.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
# Data Input/Output (I/O)
1+
# Data Input/Output
22

33
One of the greatest strengths of Pandas is its ability to effortlessly read data into and write data out of a DataFrame from various file formats. This is achieved primarily through the functions prefixed with `pd.read_` and the methods prefixed with `df.to_`.
44

55
## Reading Data into a DataFrame
66
To load data into a Pandas DataFrame, you use the appropriate `pd.read_...()` function. The most common input format is CSV.
77

8-
```
98
|Function|File Type|Example Usage|
109
|:-------|:--------|:------------|
1110
|`pd.read_csv()`|Comma-Separated Values (Text files)|`df = pd.read_csv('data.csv')`|
1211
|`pd.read_excel()`|Microsoft Excel files|`df = pd.read_excel('data.xlsx')`|
1312
|`pd.read_json()`|JavaScript Object Notation|`df = pd.read_json('data.json')`|
1413
|`pd.read_sql()`|SQL database tables|`df = pd.read_sql(query, connection)`|
15-
```
14+
1615

1716
**Example**: Reading a CSV File
1817

@@ -27,13 +26,12 @@ df_sales = pd.read_csv('sales_data.csv')
2726

2827
After you've cleaned, transformed, or analyzed your data, you'll use a `.to_...()` method on the DataFrame object to save the results.
2928

30-
```
3129
|Method|File Type|Example Usage|
3230
|:-----|:--------|:------------|
3331
|`df.to_csv()`|Comma-Separated Values|`df.to_csv('cleaned_data.csv', index=False)`|
3432
|`df.to_excel()`|Microsoft Excel files|`df.to_excel('analysis.xlsx', sheet_name='Summary')`|
3533
|`df.to_json()`|JavaScript Object Notation|`df.to_json('data_output.json')`|
36-
```
34+
3735

3836
**Example**: Writing to a CSV File
3937

docs/Pandas/pd_intro.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ Pandas is a powerful, open-source Python library essential for data analysis and
66
At its core, Pandas is designed to make working with labeled and relational data (like data found in spreadsheets or SQL tables) both intuitive and fast. It is built on top of the NumPy library and is the standard tool used by data professionals for critical tasks such as:
77

88
- Data Cleaning: Handling missing data, filtering, and correcting errors.
9-
109
- Data Transformation: Grouping, merging, reshaping, and pivoting datasets.
11-
1210
- Data Exploration: Calculating descriptive statistics and inspecting data structure.
1311

1412
### Installation and Setup 🛠️
@@ -44,5 +42,4 @@ print(pd.__version__)
4442
It's helpful for users to know that Pandas is deeply integrated with the wider Python data science ecosystem:
4543

4644
- Built on NumPy: Internally, Pandas relies heavily on the NumPy library for fast array-based computation, which is why it performs complex operations so quickly.
47-
4845
- Data Visualization: Pandas data structures work seamlessly with popular visualization libraries like Matplotlib and Seaborn.

0 commit comments

Comments
 (0)