-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:duolabmeng6/pyefun
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 教程 | ||
# https://pandas.pydata.org/pandas-docs/stable/index.html | ||
|
||
import pandas | ||
from pyefun import * | ||
|
||
|
||
class 数据分析(): | ||
def __init__(self, 文件名): | ||
扩展名 = 文件_取扩展名(文件名) | ||
if 扩展名 == "xlsx": | ||
self.pd = pandas.read_excel(文件名) | ||
elif 扩展名 == "csv": | ||
self.pd = pandas.read_csv(文件名) | ||
|
||
def __str__(self, instance, value): | ||
return self.pd | ||
|
||
|
||
def 测试函数(): | ||
data = 数据分析("../excel/test.xlsx") | ||
print(data) | ||
|
||
|
||
测试函数() |