<jupyter_start><jupyter_text>read CSV, TSV, Excel, Zip, FWF<jupyter_code>#เรียนรู้ การอ่านไฟล์ชนิดต่างๆ
from IPython.display import IFrame, YouTubeVideo, SVG, HTML
YouTubeVideo('71wHi9O0QUQ', 400,300)<jupyter_output><empty_output><jupyter_text>---* author: <NAME>* e-mail: <EMAIL>* [Chulalongkorn Business School, Thailand](https://www.cbs.chula.ac.th/en/home/)---<jupyter_code>from IPython.display import YouTubeVideo
YouTubeVideo('71wHi9O0QUQ', width=720, height=405)
import pandas as pd
url = 'https://github.com/AddisonGauss/NbaData2015-2016/raw/master/nbasalaries.csv'
df=pd.read_csv(url)
df
url = 'https://github.com/prasertcbs/test/raw/master/top_movies.tsv'
df=pd.read_csv(url, sep='\t')
df
url = 'https://github.com/prasertcbs/test/raw/master/iris.xlsx'
df=pd.read_excel(url)
df
url = 'https://github.com/prasertcbs/test/raw/master/thai_provinces.zip'
df=pd.read_csv(url)
df<jupyter_output><empty_output><jupyter_text>fwf = fixed width format<jupyter_code>url = 'https://github.com/prasertcbs/test/raw/master/fwf_no_header.txt'
df=pd.read_fwf(url, widths=[5, 7, 1], names=['student_id', 'course_id', 'grade'])
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17202432667245873, 'fraction_numerical': 0.02693310165073849, 'mean_word_length': 7.287769784172662, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 6, 'lorem ipsum': 0, 'www.': 1, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '647697', 'license': 'MIT', 'n_tokens_mistral': 532, 'n_tokens_neox': 508, 'n_words': 63, 'path': 'learn_jupyter/2_pandas_read_file.ipynb', 'repo_name': 'langsari/ftu-artificial-intelligence', 'size': '1182'}