반응형
반응형

파이콘 한국 2022 - https://2022.pycon.kr/ 

 

온라인 컨퍼런스 10/1(토)~10/2(일)

 

페이스북 : https://www.facebook.com/pyconkorea

Twitter : https://twitter.com/PyConKR

반응형
반응형

가상환경에  https://github.com/lovit/customized_konlpy  들어가서 내려받은 후에 잘 적용시켜야 한다. 

 

https://inspiringpeople.github.io/data%20analysis/ckonlpy/ 에서는 이미 가상환경을 잘 알고 있다는 가정하에 작성된거 같다.

 

1. 대상 폴더에 내려받고

2. python 가상환경 들어간 후에  "  activate main " 

   - 나는  main 이라는 가상환경을 따로 만들었다.

3. 내려받은 파일의  setup.py를 실행. 

4. python 실행 시킨후 예제 구문 실행해보면 되는 것을 확인 할 수 있다.

  - 2022-07-04 다시 확인해봤는데 잘 된다. 

 

한국어 자연어처리를 할 수 있는 파이썬 패키지, KoNLPy의 customized version입니다.

customized_KoNLPy는 확실히 알고 있는 단어들에 대해서는 라이브러리를 거치지 않고 주어진 어절을 아는 단어들로 토크나이징 / 품사판별을 하는 기능을 제공합니다. 이를 위해 template 기반 토크나이징을 수행합니다.

사전: {'아이오아이': 'Noun', '는': 'Josa'}
탬플릿: Noun + Josa

위와 같은 단어 리스트와 탬플릿이 있다면 '아이오아이는' 이라는 어절은 [('아이오아이', 'Noun'), ('는', 'Josa')]로 분리됩니다.

Install

$ git clone https://github.com/lovit/customized_konlpy.git

$ pip install customized_konlpy

Requires

  • JPype >= 0.6.1
  • KoNLPy >= 0.4.4

 

반응형
반응형

[python] Pandas 데이터프레임(Dataframe)을 txt로 저장하기

 

.to_csv를 이용하면 된다. 

import pandas as pd



#dictionary형 자료형을 판다스 데이터프레임으로 만들어줌 
#orient=index를 넣어야 행으로 쭉 나열이 됨 
df=pd.DataFrame.from_dict(count, orient='index')

df.to_csv('bigKeyword_all.txt')
df.head(100).to_csv('bigKeyword_top100.txt')


# Dataframe의 내용을 csv로 생성
## DataFrame.to_csv(path_or_buf=None, sep=',', na_rep='', float_format=None, columns=None, header=True, index=True, index_label=None, mode='w'
#                    , encoding=None, compression='infer', quoting=None, quotechar='"', line_terminator=None, chunksize=None, date_format=None
#                    , doublequote=True, escapechar=None, decimal='.', errors='strict')
df.to_csv('output/word_ex_note_1.csv', index = False, header=False, line_terminator=False, encoding='utf-8-sig')
df.head(100).to_csv('output/word_ex_note_100.csv', header=False, line_terminator=False, encoding='utf-8-sig')
df.to_csv('output/word_ex_note_1.txt', sep = '\t', index = False,header=False, line_terminator=False, encoding='utf-8-sig')

 

 

반응형
반응형

PyScript -  Run Python in Your HTML

 

https://pyscript.net/

 

Pyscript.net

Run Python code in your HTML.

pyscript.net

Examples: https://pyscript.net/examples

PyScript

What is PyScript

Summary

PyScript is a Pythonic alternative to Scratch, JSFiddle, and other "easy to use" programming frameworks, with the goal of making the web a friendly, hackable place where anyone can author interesting and interactive applications.

To get started see the getting started tutorial.

For examples see the pyscript folder.

Longer Version

PyScript is a meta project that aims to combine multiple open technologies into a framework that allows users to create sophisticated browser applications with Python. It integrates seamlessly with the way the DOM works in the browser and allows users to add Python logic in a way that feels natural both to web and Python developers.

Try PyScript

To try PyScript, import the appropriate pyscript files to your html page with:

<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>

You can then use PyScript components in your html page. PyScript currently implements the following elements:

  • <py-script>: can be used to define python code that is executable within the web page. The element itself is not rendered to the page and is only used to add logic
  • <py-repl>: creates a REPL component that is rendered to the page as a code editor and allows users to write executable code

Check out the pyscriptjs/examples folder for more examples on how to use it, all you need to do is open them in Chrome.

How to Contribute

Read the contributing guide to learn about our development process, reporting bugs and improvements, creating issues and asking questions.

Resources

https://github.com/pyscript/pyscript

 

GitHub - pyscript/pyscript: Home Page: https://pyscript.net Examples: https://pyscript.net/examples

Home Page: https://pyscript.net Examples: https://pyscript.net/examples - GitHub - pyscript/pyscript: Home Page: https://pyscript.net Examples: https://pyscript.net/examples

github.com

Anaconda Engineering Blog

 

Anaconda Engineering Blog

Sat 30 April 2022 By Fabio Pliger - pandas One of the main reasons I joined Anaconda seven and a half years ago was the company’s commitment to the data science and Python communities by creating tools that enable people to do more with less. Today I'm h

engineering.anaconda.com

 

반응형
반응형

초보자를 위한 파이썬 300제 

https://wikidocs.net/book/922

 

초보자를 위한 파이썬 강의/기초 300 문제 같이 풀어보기

https://www.youtube.com/watch?v=SiK4iYt_7-s&list=PLNPt2ycoheHqhS_OP4XA8nWycWQWnQtki&index=1

 

반응형
반응형
#가상환경 만들기및 실행 

conda create -n jupiter-env python

# To activate this environment, use
#
#     $ conda activate jupiter-env
#
# To deactivate an active environment, use
#
#     $ conda deactivate

conda info --env
# conda environments:
#
base                     C:\ProgramData\Anaconda3
jupiter-env           *  C:\ProgramData\Anaconda3\envs\jupiter-env
main                     C:\ProgramData\Anaconda3\envs\main

(jupiter-env) D:\python\jupyter_data> conda install -y jupyter
(jupiter-env) D:\python\jupyter_data> conda install -y bokeh
(jupiter-env) D:\python\jupyter_data> conda install -y pandas
(jupiter-env) D:\python\jupyter_data> conda install -y matplotlib


(jupiter-env) D:\python\jupyter_data>mkdir notebook
(jupiter-env) D:\python\jupyter_data>cd notebook

# jupyter notebook 실행
(jupiter-env) D:\python\jupyter_data\notebook>jupyter notebook

 

VScode :

이름: Jupyter
ID: ms-toolsai.jupyter
버전: 2022.2.1030672458
게시자: Microsoft VS Marketplace 

링크: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter

Jupyter notebook support, interactive programming and computing that supports Intellisense, debugging and more.

 


# Config 파일 생성 - Jupyter Notebook의 기본 설정
(jupiter-env) D:\python\jupyter_data\notebook>jupyter notebook --generate-config
Writing default config to: C:\Users\pydata\.jupyter\jupyter_notebook_config.py

반응형

+ Recent posts