Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

57 update our usage section in readme #65

Merged
merged 4 commits into from
Jan 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<img src="https://i.ibb.co/djVdtn9/ttp-logo.png" width="350">
</h1>

[![Documentation Status](https://readthedocs.org/projects/tidyversetopandas/badge/?version=latest)](https://tidyversetopandas.readthedocs.io/en/latest/?badge=latest)

## 💪 Bringing the Power of tidyverse to Pandas!

**tidyversetopandas** is a Python package designed for users familiar with R's tidyverse who are transitioning to Python. It bridges the syntax gap between R and Python by offering pandas equivalents to popular tidyverse functions. This package is particularly beneficial for data scientists and analysts who seek to leverage pandas' robust capabilities with the familiar syntax of tidyverse.

- **Installation:** 🏗 WIP
- **Installation:** [installation](#⚙️-installation)
- **Documentation:** [https://tidyversetopandas.readthedocs.io/en/latest/example.html](https://tidyversetopandas.readthedocs.io/en/latest/example.html)
- **Source code:** [https://github.com/UBC-MDS/TidyverseToPandas](https://github.com/UBC-MDS/TidyverseToPandas)
- **Bug reports:** [https://github.com/UBC-MDS/TidyverseToPandas/issues](https://github.com/UBC-MDS/TidyverseToPandas/issues)
Expand All @@ -24,28 +26,47 @@ While pandas is a powerful tool for data manipulation in Python, it can be chall

## ⚙️ Installation

_Note: This package is currently under development and not yet available on PyPI. To install, please clone the repository and install the package locally. Follow the instructions in [Developer Guide](#Developer-Guide) to install the package in development mode._

```bash
$ pip install tidyversetopandas
```

## 🏃 Usage

Currently, the package is under development so follow [Developer Guide](#Developer-Guide) to install the package in development mode.
Lets try to use `tidyversetopandas`.

### Import package
Import the package into your Python environment after installation:

```python
from tidyversetopandas import tidyversetopandas
from tidyversetopandas import tidyversetopandas as ttp
```
### Loading Data
Begin by loading your data into a pandas dataframe. This package assumes that you have a dataframe ready for manipulation named `df`.

# Load your dataframe in pandas
### Mutate
Use `mutate` to create new columns or modify existing ones. The function allows lambda expressions for complex operations. For example, to double the values in column 'B'

# Use the functions:
```
df = ttp.mutate(df, b=lambda x: x["B"] * 2)
```
### Filter
The `filter` function is used to subset dataframes based on specified conditions. For instance, to select rows where 'A' is greater than 1 and 'B' is less than 6
```
df = ttp.filter(df, "A > 1 and B < 6")
```
### Arrange

Sort your dataframe with `arrange`. You can sort by multiple columns and specify ascending or descending order. For example, to sort by 'A' in ascending order and then by 'C'
```
df = ttp.arrange(df, True, "A", "C")
```
### Select
To keep only certain columns, use the `select` function. For example, to keep only the column 'A'
```
df = ttp.select(df, "A")
```


## 📖 Developer Guide

### 🛠️ Installation in Development Mode
Expand Down
Loading