# Some basic code of data\_cleaning

```python
# remove all columns with at least one missing value
sf_permits_with_na_dropped = sf_permits.dropna(axis=1)

# calculate number of dropped columns
cols_in_original_dataset = sf_permits.shape[1]
cols_in_na_dropped = sf_permits_with_na_dropped.shape[1]
dropped_columns = cols_in_original_dataset - cols_in_na_dropped
```

In the given code, `shape` is a method used to get the dimensions of a pandas DataFrame. Specifically, `sf_permits.shape[1]` returns the number of columns in the `sf_permits`DataFrame.&#x20;

The `axis` parameter in `dropna(axis=1)` specifies that the method should drop columns with missing values. In this case, `axis=1` means that the method should drop columns with missing values, rather than rows.To summarize:

* `shape` is a method used to get the dimensions of a pandas DataFrame.
* `sf_permits.shape[1]` returns the number of columns in the `sf_permits` DataFrame.
* `axis` is a parameter used in pandas methods to specify whether to operate on rows or columns.
* `dropna(axis=1)` drops columns with missing values.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yunaeecy.gitbook.io/wiki/datacleaning/some-basic-code-of-data_cleaning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
