• ipython


    启动

    set LANG=zh_CN.UTF-8 && jupyter notebook --notebook-dir=d:\jupyter\ --ip='*' --NotebookApp.token='' --NotebookApp.password=''
    

    Latex

    $x$
    
    from IPython.display import Latex
    Latex('$x$')
    

    \(x\)

    解方程

    import sympy
    x=sympy.Symbol('x')
    fx=5*x+4
    result=fx.evalf(subs={x:6})
    
    x=sympy.Symbol('x')
    y=sympy.Symbol('y')
    fx=x*x+y*y
    result=fx.evalf(subs={x:3,y:4})
    
    x=sympy.Symbol('x')
    y=sympy.Symbol('y')
    fx=x*3+9
    result=sympy.solve(fx,x)
    
    x=sympy.Symbol('x')
    y=sympy.Symbol('y')
    fx=x*3+y**2
    result=sympy.solve(fx,x,y)
    
    x=sympy.Symbol('x')
    y=sympy.Symbol('y')
    f1=x+y-3
    f2=x-y+5
    result=sympy.solve([f1,f2],[x,y])
    
    from IPython.display import Latex
    a=sympy.Symbol('a')
    b=sympy.Symbol('b')
    x=sympy.Symbol('x')
    y=sympy.Symbol('y')
    #simplify( )普通的化简
    sympy.simplify((x**3 + x**2 - x - 1)/(x**2 + 2*x + 1))
    sympy.latex(((x**3 + x**2 - x - 1)/(x**2 + 2*x + 1)))
    # #trigsimp( )三角化简
    sympy.trigsimp(sympy.sin(x)/sympy.cos(x))
    sympy.latex(sympy.sin(x)/sympy.cos(x))
    # #powsimp( )指数化简
    sympy.powsimp(x**a*x**b)
    sympy.latex(x**a*x**b)
    

    \(\frac{x^{3} + x^{2} - x - 1}{x^{2} + 2 x + 1} \Rightarrow x-1\)

    \(\frac{\sin{\left(x \right)}}{\cos{\left(x \right)}} \Rightarrow \tan{\left(x \right)}\)

    \(x^{a} x^{b} \Rightarrow x^{a + b}\)

    Hive parquet to csv

    import os
    from pathlib import Path
    
    def file_name(file_dir):
        for root, dirs, files in os.walk(file_dir):
            for file in files:
                if os.path.splitext(file)[-1] == '.parquet':
                    my_file = Path(os.path.join(root, file+".csv"))
                    if my_file.is_file()==False:
                        df=pd.read_parquet(os.path.join(root, file))
                        df.to_csv(os.path.join(root, file+".csv"))
        return
    
    file_name("data/")
    

    迭代运行命令Shell Command line

    a=["c","d"]
    cc=['']
    for b in a:
        tmp="{}:\\".format(b)
        dd=! dir {tmp}
        while dd.__class__.__name__!="SList":
            import time
            time.sleep(0.001)
        cc=cc+dd
    print('\r\n'.join(cc))
    
  • 相关阅读:
    更新Centos 8 内核
    Docker安装
    微服务学习实战笔记 4.1-系统部署篇-Centos 8 下 安装配置K8S
    安装supervisor
    微服务学习实战笔记 4.2-系统部署篇-搭建 Harbor 镜像仓库服务器
    SRS流媒体服务器安装
    微服务学习实战笔记 1.1-系统架构篇-技术选型
    .Net Core 3.0 使用 Serilog 把日志记录到 SqlServer
    IdentityServer4 自定义授权模式
    IdentityServer4 保护.net framework webapi
  • 原文地址:https://www.cnblogs.com/yzpopulation/p/16280382.html
Copyright © 2020-2023  润新知