Giter Site home page Giter Site logo

markdown's Introduction

DataFrame and Series to Markdown Converter

Overview

This package provides utility functions to convert pandas DataFrames and Series into markdown-formatted tables. These functions are integrated into the pandas library as methods for seamless usage.

Installation

Ensure you have pandas installed:

pip install pandas
  1. Clone the Repository

  2. Import the Module: In you Python script or Jupyter Notebook, you can import the markDown.py module like so:

from markDown import markdownTable, markdownSeries
  1. Use the Functions: Once imported, you can use the markdownTable and markdownSeries functions directly, or you can utilize the extended functionality added to Pandas DataFrame and Series.

For example, to convert a DataFrame to a markdown table:

import pandas as pd

# Assuming 'df' is the DataFrame you want to convert
markdown_table = df.markdownTable()

Or, to convert a Series to a markdown table:

import pandas as pd

# Assuming 'series' is the Series you want to convert
markdown_table = series.markdownSeries()

Users can also specify specific columns for DataFrame conversion:

markdown_table = df.markdownTable('Column1', 'Column2', 'Column3')

Or customize the column names for Series conversion:

markdown_table = series.markdownTable(col1='Index', col2='Value')

Conclusion

These functions provide an easy way to convert pandas DataFrames and Series into markdown-formatted tables, enhancing the readability and presentation of your data in markdown-supported environments. This is simular to using to_markdown in pandas without having to install another library.

pandas, the to_markdown method is provided by the tabulate library, which needs to be installed separately. The to_markdown method is available in pandas version 1.3.0 and later.

markdown's People

Contributors

dmorton714 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.