본문 바로가기

Python9

구구단 문제만들기 (feat. python) 대략 5년? 전 즈음에 딸냄이 덧셈 문제 내달라고 해서 만들었던 코드가 있는데, 구구단 문제로 바꾸려 했더니 왜 안되는지 안되길래 chat gpt에게 코드 수정해달라고 했다-_-그래서 나온 결과가 아래..from random import randintfor i in range(30): num1 = randint(5, 5) num2 = randint(1, 12) print(f"{num1} x {num2} =") 결과는 다음과 같다.5 x 11 = 5 x 5 = 5 x 7 = 5 x 8 = 5 x 8 =...이렇게 30문제를 뽑아낸다. 2024. 11. 8.
csv 읽기(pandas? csv? read?) 뭐가 이렇게 많지;; 뭔가 편리함이 다른듯. 1. pandas import pandas as pd pre_pd = pd.read_csv('fnl_list.csv') print(pre_pd) xn mon lt p var lats latn lonw lone lats2 latn2 lonw2 lone2 0 tx90 4 1 19 tsfc 70 90 10 65 NaN NaN NaN NaN 1 tx90 4 1 20 tsfc -5 20 105 140 NaN NaN NaN NaN 2 tx90 4 2 1 h500 45 55 125 150 NaN NaN NaN NaN 3 tx90 4 2 5 u850 60 65 145 195 NaN NaN NaN NaN 2. csv import csv pre_csv = csv.reader('.. 2023. 9. 21.
대기과학과 해양학을 위한 파이썬 https://carpentries-lab.github.io/python-aos-lesson/ 2021. 11. 26.
NetCDF4-python 1. Documentation https://unidata.github.io/netcdf4-python/ netCDF4 API documentation __init__(self, group, name, datatype, dimensions=(), zlib=False, complevel=4, shuffle=True, fletcher32=False, contiguous=False, chunksizes=None, endian='native', least_significant_digit=None,fill_value=None,chunk_cache=None) Variable constructor. group: Gr unidata.github.io 2021. 7. 10.