Git Product home page Git Product logo

pandas-ninja's Introduction

Pandas ninja

Source code of pandas ninja https://pandas.ninja.

Pandas ninja is teaching game made to become a master with the pandas python libraires. There are challenges produced by the community and player must resolve it using one python expression. This application was possible thanks to the pyodide.js library which makes possible to run python from client side.

It is my first web application made with the following technology. So feel free to fix my code and add contribution.

Challenges contribution

I invite you to create challenges and share them by making using pull request.
A challenge is a json file with an input and an expected dataframe.
All challenges are stored in the public/challenges/ folder.

Examples

{
  "title": "example",
  "author": "@author_name",
  "placeholder": "#This text will be place into the code editor \nprint(df)",
  "input": [
    {
      "count": 2,
      "fruits": "apple"
    },
    {
      "count": 4,
      "fruits": "banana"
    }
    ], 
     "expected": [
    {
      "count": 4,
      "fruits": "apple"
    },
    {
      "count": 2,
      "fruits": "banana"
    }
    ]
    

challenge.py

a python script challenge.py is available to create challenges. It depends only on simplejson and pandas.

Setup

pip install simplejson
wget https://raw.githubusercontent.com/dridk/pandas-ninja/main/challenge.py

Create a script file with the following code :

from challenge import Challenge
import pandas as pd
import numpy as np

file = "public/challenges/my_challenge.py"
c = Challenge()
c.name= "my challenge"
c.author  = "@github_account"
c.placeholder= " # A comment to put on source code editor " 

c.input_df = pd.DataFrame(...)
c.expected_df = pd.DataFrame(...)

c.show()
c.save(file)

Launch the web app

git clone https://github.com/dridk/pandas-ninja
cd pandas-ninja
npm install 
npm run dev 

pandas-ninja's People

Contributors

dridk avatar lvelosuarez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.