-
Notifications
You must be signed in to change notification settings - Fork 318
Improve Documentation: Quick Start Guide, Key Functions, and Troubleshooting Section #621
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
Open
Shoaib707
wants to merge
1
commit into
data-8:master
Choose a base branch
from
Shoaib707:documentation-update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,90 @@ For an example of usage, see the [Berkeley Data 8 class](http://data8.org/). | |
|
||
## Installation | ||
|
||
Use `pip`: | ||
|
||
Use `pip` to install the package: | ||
``` | ||
pip install datascience | ||
|
||
``` | ||
|
||
To verify that the package is installed correctly, run: | ||
``` | ||
python -c "import datascience; print(datascience.__version__)" | ||
|
||
``` | ||
|
||
## Quick Start Guide | ||
|
||
After installing the package, you can start using datascience by importing it in Python: | ||
|
||
``` | ||
from datascience import Table | ||
|
||
# Create a simple table | ||
data = Table().with_columns( | ||
"Name", ["Alice", "Bob", "Charlie"], | ||
"Age", [25, 30, 35] | ||
) | ||
|
||
# Display the table | ||
data.show() | ||
``` | ||
|
||
## Basic Data Manipulation | ||
|
||
# Adding a new column | ||
``` | ||
data = data.with_column("Height (cm)", [165, 180, 175]) | ||
``` | ||
# Sorting the table by age | ||
``` | ||
sorted_data = data.sort("Age", descending=True) | ||
sorted_data.show() | ||
``` | ||
|
||
## Key Functions and Methods | ||
|
||
# Table Creation | ||
- Table() : Creates an empty table | ||
- Table.with_columns(column_name, values, ...) : Adds multiple columns to a table | ||
|
||
# Data Manipulation | ||
- Table.with_column(column_name, values) : Adds a single column | ||
- Table.drop(column_name) : Removes a column from the table. | ||
- Table.sort(column_name, descending=False) : Sorts rows based on a column. | ||
|
||
# Data Visualization | ||
- Table.plot(column_x, column_y) : Plots a graph using two columns. | ||
- Table.hist(column) : Generates a histogram. | ||
- Table.scatter(column_x, column_y) : Creates a scatter plot. | ||
|
||
## Troubleshooting Guide | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think any of these are really useful. I'd recommend to just remove. |
||
|
||
# 1. Installation Issues | ||
Problem: ModuleNotFoundError: No module named 'datascience' | ||
Solution: Ensure the package is installed using: | ||
|
||
``` | ||
pip install --upgrade datascience | ||
``` | ||
|
||
# 2. Import Errors | ||
Problem: ImportError: cannot import name 'Table' from 'datascience' | ||
Solution: Try the following: | ||
|
||
Verify installation by running: | ||
``` | ||
python -c "import datascience; print(datascience.__version__)" | ||
``` | ||
|
||
# 3. Display Issues in Jupyter Notebook | ||
Problem: Tables are not displaying correctly in Jupyter Notebook. | ||
Solution: | ||
|
||
``` | ||
pip install ipython notebook | ||
``` | ||
|
||
|
||
|
||
|
||
A log of all changes can be found in CHANGELOG.md. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this idea of putting a Getting Started experience on the README - but I think we're better off linking to this page, which is much more visual and comprehensive: https://www.data8.org/datascience/tutorial.html#getting-started