<jupyter_start><jupyter_text>---title: "Creating a Pandas Dataframe using string data"author: "Sanjay"date: 2020-09-04description: "-"type: technical_notedraft: false---<jupyter_code># Import pandas library  
import pandas as pd
# Importing StringIO function from io module 
from io import StringIO 
# Wrap the string data in StringIO function and store it in a variable
data = StringIO("""Date;Exam;Marks 
10/2/2020;Maths;100 
11/2/2020;Physics;95
12/2/2020;Chemistry;80 
13/2/2020;ComputerScience;85 """) 
# Read the data using Pandas read_csv() function 
data = pd.read_csv(data, sep =";") 
# Print dataframe  
print(data)<jupyter_output>Date             Exam  Marks 
0  10/2/2020            Maths     100
1  11/2/2020          Physics      95
2  12/2/2020        Chemistry      80
3  13/2/2020  ComputerScience      85
{'fraction_non_alphanumeric': 0.09975669099756691, 'fraction_numerical': 0.10462287104622871, 'mean_word_length': 3.3089005235602094, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '253016', 'license': 'MIT', 'n_tokens_mistral': 341, 'n_tokens_neox': 281, 'n_words': 80, 'path': 'docs/python/pandas/Creating-a-Pandas-Dataframe-using-string-data.ipynb', 'repo_name': 'Sanjay-V/mlnotes', 'size': '822'}