並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 49件

新着順 人気順

python for loop in range floatの検索結果1 - 40 件 / 49件

  • 遅くないpandasの書き方 - ML_BearのKaggleな日常

    これは何? この記事は Kaggle Advent Calendar 2021 の7日目の記事です。 pandasはデータ分析ライブラリとして非常に便利ですが、書き方を間違えると簡単に処理が遅くなってしまうという欠点があります。そこで、この記事では遅くならない書き方をするために気をつけたいポイントをいくつかご紹介したいと思います。 この Colab Notebookの実行結果をエクスポートした上で、不要な部分を一部削って記事にしています。colab notebook をコピーして実行してもらえれば再現することが可能なはずです。(colabにコメント等をいただいても返すことはできないと思います、すみません。) 前提条件 この記事ではあくまで「遅くない(なりづらい)書き方を紹介する」ことに努めます。よって、以下のような改善点はあるが一旦考慮の外におくものとして話を進めます。 並列化ライブラリ

      遅くないpandasの書き方 - ML_BearのKaggleな日常
    • プロと読み解くRuby 3.4 NEWS - STORES Product Blog

      プロと読み解くRuby 3.4 NEWS テクノロジー部門技術基盤グループの笹田(ko1)と遠藤(mame)です。Ruby (MRI: Matz Ruby Implementation、いわゆる ruby コマンド) の開発をしています。お金をもらって Ruby を開発しているのでプロの Ruby コミッタです。 本日 12/25 に、恒例のクリスマスリリースとして、Ruby 3.4.0 がリリースされました(Ruby 3.4.0 リリース )。今年も STORES Product Blog にて Ruby 3.4 の NEWS.md ファイルの解説をします(ちなみに、STORES Advent Calendar 2024 の記事になります。他も読んでね)。NEWS ファイルとは何か、は以前の記事を見てください。 プロと読み解く Ruby 2.6 NEWS ファイル - クックパッド開発者

        プロと読み解くRuby 3.4 NEWS - STORES Product Blog
      • Python×株式投資:従来の100倍!銘柄選抜のバックテストを高速化した話 - Qiita

        # ----------------------------- # 2nd Screening V1 # ----------------------------- import time global_start_time = time.time() from google.colab import drive drive.mount('/content/drive') import pandas as pd import numpy as np import os from tqdm.notebook import tqdm import yfinance as yf from curl_cffi import requests # -------------------------------------------------- # ヘルパー関数定義セクション # --------

          Python×株式投資:従来の100倍!銘柄選抜のバックテストを高速化した話 - Qiita
        • GPT in 60 Lines of NumPy | Jay Mody

          January 30, 2023 In this post, we'll implement a GPT from scratch in just 60 lines of numpy. We'll then load the trained GPT-2 model weights released by OpenAI into our implementation and generate some text. Note: This post assumes familiarity with Python, NumPy, and some basic experience with neural networks. This implementation is for educational purposes, so it's missing lots of features/improv

          • The Scary Thing About Automating Deploys - Engineering at Slack

            Most of Slack runs on a monolithic service simply called “The Webapp”. It’s big – hundreds of developers create hundreds of changes every week. Deploying at this scale is a unique challenge. When people talk about continuous deployment, they’re often thinking about deploying to systems as soon as changes are ready. They talk about microservices and 2-pizza teams (~8 people). But what does continuo

            • Gamedev in Lisp. Part 1: ECS and Metalinguistic Abstraction - cl-fast-ecs by Andrew

              Gamedev in Lisp. Part 1: ECS and Metalinguistic Abstraction In this series of tutorials, we will delve into creating simple 2D games in Common Lisp. The result of the first part will be a development environment setup and a basic simulation displaying a 2D scene with a large number of physical objects. It is assumed that the reader is familiar with some high-level programming language, has a gener

                Gamedev in Lisp. Part 1: ECS and Metalinguistic Abstraction - cl-fast-ecs by Andrew
              • Golang Mini Reference 2022: A Quick Guide to the Modern Go Programming Language (REVIEW COPY)

                Golang Mini Reference 2022 A Quick Guide to the Modern Go Programming Language (REVIEW COPY) Harry Yoon Version 0.9.0, 2022-08-24 REVIEW COPY This is review copy, not to be shared or distributed to others. Please forward any feedback or comments to the author. • feedback@codingbookspress.com The book is tentatively scheduled to be published on September 14th, 2022. We hope that when the release da

                • CohereLabs/c4ai-command-r-plus · Hugging Face

                  ","chat_template":[{"name":"default","template":"{{ bos_token }}{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif false == true %}{% set loop_messages = messages %}{% set system_message = 'You are Command-R, a brilliant, sophisticated, AI-assistant trained to assist human users by providing thorough responses. You

                    CohereLabs/c4ai-command-r-plus · Hugging Face
                  • Modular: Mojo🔥 - It’s finally here!

                    Since our launch of the Mojo programming language on May 2nd, more than 120K+ developers have signed up to use the Mojo Playground and 19K+ developers actively discuss Mojo on Discord and GitHub. Today, we’re excited to announce the next big step in Mojo’s evolution: Mojo is now available for local download – beginning with Linux systems, and adding Mac and Windows in coming releases. While the Mo

                      Modular: Mojo🔥 - It’s finally here!
                    • 【Python】四分木の中で最も複雑な領域を分割し続けるアートを実装してみた - Qiita

                      はじめに 数ヶ月前に、このツイートが目に留まりました。 非常に魅力的で、自分でも作りたいと思ったのですが、アルゴリズムや実装が公開されているにもかかわらず、実際にやっている人が少ないようでした。 そこで、本記事では、Pythonの画像処理ライブラリPillow(PIL)を使用して、四分木の中で最も複雑な領域を分割し続けるアートの実装方法について解説します。 アルゴリズム 以下の操作を再帰的に繰り返します。 キャンバス上のすべての矩形領域の中から、最も複雑な領域を選んで四分割する。 新しくできた矩形領域において画像の複雑度(score)と平均色を求め、領域を平均色で塗りつぶす。 詳しくは元記事を参照してください。 実装 Rectクラス Rectクラスは、長方形のフレームの座標情報を保持するクラスです。 calc_areaは長方形のフレームの面積を計算するメソッドです。 class Rect:

                        【Python】四分木の中で最も複雑な領域を分割し続けるアートを実装してみた - Qiita
                      • Why I use attrs instead of pydantic

                        This post is an account of why I prefer using the attrs library over Pydantic. I'm writing it since I am often asked this question and I want to have something concrete to link to. This is not meant to be an objective comparison of attrs and Pydantic; I'm not interested in comparing bullet points of features, nor can I be unbiased since I'm a major contributor to attrs (at time of writing, second

                        • python_modules.pdf

                          Python3 OpenCV / Pillow / pygame / Eel / PyDub / NumPy / matplotlib / SciPy / SymPy / gmpy2 / hashlib, passlib / Cython / Numba / ctypes / PyInstaller / curses / tqdm / JupyterLab / json / psutil / urllib / zenhan / jaconv Copyright © 2017-2025, Katsunori Nakamura 2025 8 19 Python ‘ .py’ Python Python Windows PSF Python py .py Enter macOS Linux PSF Python python3 .py Enter Anaconda Prompt Python p

                          • What's new in Python 3.11?

                            What's new in Python 3.11?Built-in TOML support, better exceptions, and typing improvements. By Tushar·InsightsPython The first beta release of Python 3.11 is out, bringing some fascinating features for us to tinker with. This is what you can expect to see in 2022's release of Python later this year. Even better error messagesPython 3.10 gave us better error messages in various regards, but Python

                              What's new in Python 3.11?
                            • 0.8.0 Release Notes ⚡ The Zig Programming Language

                              Tier 4 Support § Support for these targets is entirely experimental. If this target is provided by LLVM, LLVM may have the target as an experimental target, which means that you need to use Zig-provided binaries for the target to be available, or build LLVM from source with special configure flags. zig targets will display the target if it is available. This target may be considered deprecated by

                              • So You Want To Remove The GVL?

                                I want to write a post about Pitchfork, explaining where it comes from, why it is like it is, and how I see its future. But before I can get to that, I think I need to share my mental model on a few things, in this case, Ruby’s GVL. For quite a long time, it has been said that Rails applications are mostly IO-bound, hence Ruby’s GVL isn’t that big of a deal and that has influenced the design of so

                                • ​Getting Started with Python

                                  Python is a powerful programming language that provides many packages that we can use. Using the versatile Python programming language, we can develop the following: AutomationDesktop applicationAndroidWebIoT home automationData Science and the list goes on.In this article, our primary focus will be knowing how to start learning Python and the essentials required to be a data scientist. Below is t

                                    ​Getting Started with Python
                                  • OBS Studio に関するメモ - すたいるのOBS情報メモブログ

                                    OBS Studioに関する情報メモを書いてる記事 ※「OBS Studioに関する個人的メモ」を移転しました。(現在は閲覧不可) 記事投稿日 2021年10月6日 本記事は文字数が非常に多いため、ブラウザの検索機能をご活用ください。 ブラウザ検索のショートカットキー ・Windows : Ctrl + F ・macOS : Command + F 見づらくて申し訳ありません。 将来的には内容を分割して投稿したいと考えていますが、分けても長くなってしまうため、当面はこのページにまとめています。 この記事は以下の環境を使用して作成しています。 ※Linux、特定のデバイスが無いと表示されないソースのことはメモしていません。 ■Windowsの場合 OBS Studio 31.1.2 (それ以前のバージョン、および開発版も含む) OS : Windows 11 Pro 64bit (バージョン

                                      OBS Studio に関するメモ - すたいるのOBS情報メモブログ
                                    • 0.10.0 Release Notes ⚡ The Zig Programming Language

                                      Tier 4 Support § Support for these targets is entirely experimental. If this target is provided by LLVM, LLVM may have the target as an experimental target, which means that you need to use Zig-provided binaries for the target to be available, or build LLVM from source with special configure flags. zig targets will display the target if it is available. This target may be considered deprecated by

                                      • PytorchのTransformersのT5を使って要約モデルを作る - 見習いデータサイエンティストの隠れ家

                                        インターネットの世界にニュースが溢れる昨今、満足度が高いものを的確に読みたいという方も多いかと思います。そのためには、見るニュースをどれにするか判断することが必要になります。そこで、ニュース全体の主旨を短い文章で表す要約の価値が高まっています。 自然言語処理における要約は、大きく2つに分けられます。それは、抽出型と抽象型です。抽出型は、文章の中から重要な文を抜き出すことで要約を作ります。要約として選ばれた文は元の文章にあるものなので、方向性が大きく異ることや誤字脱字がうまれる可能性は低いです。しかし、要約として選ばれた文のそれぞれは関係があるわけではないので、流暢な要約にならないことも多いです。それに対して、抽象型は人間が作るように要約としての文章の流暢さを考慮しながら作ります。本来人間がほしい要約はこちらになりますが、抽出型に比べると難易度が上がり、全く意味がわからない文章になる可能性も

                                          PytorchのTransformersのT5を使って要約モデルを作る - 見習いデータサイエンティストの隠れ家
                                        • Accelerate Python code 100x by import taichi as ti | Taichi Docs

                                          Python has become the most popular language in many rapidly evolving sectors, such as deep learning and data sciences. Yet its easy readability comes at the cost of performance. Of course, we all complain about program performance from time to time, and Python should certainly not take all the blame. Still, it's fair to say that Python's nature as an interpreted language does not help, especially

                                          • 【時間-周波数解析の基礎】特異スペクトル解析を用いた時系列データの成分分析【SSA】 - LabCode

                                            時系列データの特異スペクトル解析 特異値分解 まず,特異スペクトル解析で用いられる特異値分解について説明します。線形代数の言葉が出てきますので,難しいと思う方は飛ばしてもらっても大丈夫です。 階数 $r$ の $m\times n$ 行列 $\mathsf{A}$ に対して,次のような分解 (特異値分解 (singular value decomposition: SVD)といいます) が存在します: $$ \mathsf{A} = \mathsf{U}\mathsf{\Sigma} \mathsf{V}^\top $$ ここに,$\mathsf{U}$ と $\mathsf{V}$ はそれぞれ,$m$ 次と $n$ 次の直交行列 (複素行列の場合は,エルミート行列) で,$\mathsf{\Sigma}$ は $$ \mathsf{\Sigma} = \left(\begin{array

                                              【時間-周波数解析の基礎】特異スペクトル解析を用いた時系列データの成分分析【SSA】 - LabCode
                                            • 【GROMACS】Umbrella samplingによるMD simulation 【In silico創薬】【SMD】 - LabCode

                                              Windows 11 Home, 13th Gen Intel(R) Core(TM) i7-13700, 64 ビット オペレーティング システム、x64 ベース プロセッサ, メモリ:32GB Umbrella Samplingの概要と目的Umbrella Samplingは、分子がめったに起こさないような状態変化(たとえば、タンパク質同士が離れるなど)を詳しく調べるための計算手法です。通常の分子動力学(MD)では、エネルギー的に安定な状態にとどまりやすく、重要な変化が起こる確率が低いため、十分な情報が得られません。 たとえば、タンパク質AとBがくっついている状態から、少しずつ離れていく様子を観察したいとき、まずAとBを少しずつ引き離すSteered Molecular Dynamics(SMD)などのシミュレーションで、さまざまな距離の構造を取得します。その中から、0.5nm、0.7

                                              • prompts.chat

                                                Welcome to the “Awesome ChatGPT Prompts” repository! While this collection was originally created for ChatGPT, these prompts work great with other AI models like Claude, Gemini, Hugging Face Chat, Llama, Mistral, and more. ChatGPT is a web interface created by OpenAI that provides access to their GPT (Generative Pre-trained Transformer) language models. The underlying models, like GPT-4o and GPT-o

                                                • Python: Polars で各種エンコーダを実装したライブラリ「Shirokumas」を作った - CUBE SUGAR CONTAINER

                                                  最近は Polars が気に入っていて、主にプライベートで使っている。 ただ、エコシステムという観点では Pandas に比べて発展途上の段階にあると思う。 そこで、今回は発展の一助として「Shirokumas」というライブラリを作ってみた。 github.com どんなライブラリかというと、現時点の機能では Pandas の category_encoders 1 のサブセットに相当する。 より具体的には、scikit-learn のスタイルで書かれた特徴量抽出をするための基本的なエンコーダを実装してある。 特徴としては、同じ処理を完了するまでにかかる時間が短いこと。 Pandas のエコシステムで使われるフレームワークとパフォーマンスを比較したグラフを以下に示す。 グラフから、比較対象の概ね 1/10 以下の時間で処理を完了できることが分かる。 詳細については、このエントリの後半に記述

                                                    Python: Polars で各種エンコーダを実装したライブラリ「Shirokumas」を作った - CUBE SUGAR CONTAINER
                                                  • What's New in Emacs 28.1?

                                                    Try Mastering Emacs for free! Are you struggling with the basics? Have you mastered movement and editing yet? When you have read Mastering Emacs you will understand Emacs. It’s that time again: there’s a new major version of Emacs and, with it, a treasure trove of new features and changes. Notable features include the formal inclusion of native compilation, a technique that will greatly speed up y

                                                    • Vim9 script for Python Developers · GitHub

                                                      vim9script4pythondevelopers.md Vim9 script for Python Developers Vim9 script�Vim script��������������������������������������������������系��� def������義����������Vim script��vim9script�����使����������(vim9script���

                                                        Vim9 script for Python Developers · GitHub
                                                      • 最適化モデリング入門@新人研修

                                                        はじめに 2023年10月にシニアリサーチャーとして入社したアドバンスドテクノロジーラボ(ATL)の梅谷俊治です。 2023年9月まで、大阪大学大学院情報科学研究科にて数理最適化寄附講座教授を務めていました。 本記事では、データ推進室に配属される新人を対象とした「最適化モデリング入門」をご紹介します。 データ推進室の新人は、部署に配属される前に「BootCamp」と呼ばれる研修を受けます。 この研修は約3ヶ月にわたり、エンジニアリング技術の向上だけでなく、ヒューマンスキルの育成や事業理解を深めるための幅広いプログラムが用意されています。 具体的には、データサイエンスの基礎、プログラミング、データベース管理の分野で徹底的なトレーニングが行われます。 例えば、PythonやRを使用したデータ解析の手法を学び、SQLを用いたデータベースの操作方法を習得します。 また、実際のデータ分析の問題を解決

                                                          最適化モデリング入門@新人研修
                                                        • 同時タイムラプスのGUIをpythonでつくってみた - Qiita

                                                          import PySimpleGUI as sg import datetime import time import os import numpy as np import cv2 import glob from time import sleep mport schedule import mojimoji import sys # class def cam_2(create_directory1,create_directory2): # global create_directory1 cap1 = cv2.VideoCapture(1,cv2.CAP_DSHOW) time.sleep(1) cap1.set(cv2.CAP_PROP_EXPOSURE,-6) ret1, frame1 = cap1.read() print(ret1) if ret1 == False:

                                                            同時タイムラプスのGUIをpythonでつくってみた - Qiita
                                                          • Node.js — Node.js v22.10.0 (Current)

                                                            Or if the package is only meant to be run on Node.js and wants to fallback to CJS on older versions that don't have require(esm): { "type": "module", "exports": { // On new version of Node.js, both require() and import get the ESM version "module-sync": "./index.js", // On older version of Node.js, where "module-sync" and require(esm) are // not supported, use the CJS version to avoid dual-package

                                                              Node.js — Node.js v22.10.0 (Current)
                                                            • Basic facts about GPUs

                                                              Basic facts about GPUs last updated: 2025-06-18 I’ve been trying to get a better sense of how GPUs work. I’ve read a lot online, but the following posts were particularly helpful: Making Deep Learning Go Brrrr From First Principles What Shapes Do Matrix Multiplications Like? How to Optimize a CUDA Matmul Kernel for cuBLAS-like Performance: a Worklog This post collects various facts I learned from

                                                              • Seaborn Objects ~ グラフィックの文法で強化された Python 可視化ライブラリの新形態 ~ - GMOインターネットグループ グループ研究開発本部

                                                                2023.02.10 Seaborn Objects ~ グラフィックの文法で強化された Python 可視化ライブラリの新形態 ~ お久しぶりです。グループ研究開発本部・AI研究開発質の T.I. です。色々あって久しぶりの Blog となりました。今回は、趣向を変え、最近大幅に改良された Python のデータ可視化ライブラリである Seaborn の新しい機能を紹介します。昨年9月にリリースされたばかりということもあるのか、本邦どころか英語で検索しても解説資料は公式サイト以外はほぼ皆無(当方調べ)というレアな情報となります。 はじめに データ分析・機械学習などにおいて、データの様々な特徴を可視化しながらの調査・探索(Exploratory Data Analysis (EDA))は、対象の正確で深い理解には不可欠なアプローチと言えます。Python のデータ可視化ライブラリとしては、

                                                                  Seaborn Objects ~ グラフィックの文法で強化された Python 可視化ライブラリの新形態 ~ - GMOインターネットグループ グループ研究開発本部
                                                                • The Alkyne GC · mcyoung

                                                                  Alkyne is a scripting language I built a couple of years ago for generating configuration blobs. Its interpreter is a naive AST walker1 that uses ARC2 for memory management, so it’s pretty slow, and I’ve been gradually writing a new evaluation engine for it. This post isn’t about Alkyne itself, that’s for another day. For now, I’d like to write down some notes for the GC I wrote3 for it, and more

                                                                    The Alkyne GC · mcyoung
                                                                  • Node.js — Node.js v23.0.0 (Current)

                                                                    2024-10-16, Version 23.0.0 (Current), @RafaelGSS We’re excited to announce the release of Node.js 23! Key highlights include: Enabling require(esm) by default for Node.js applications Removing support for Windows 32-bit systems Stabilizing the node --run command Enhancements to the test runner, including glob pattern support for coverage files Node.js 23 will replace Node.js 22 as the ‘Current’ re

                                                                      Node.js — Node.js v23.0.0 (Current)
                                                                    • Julia 1.6: what has changed since Julia 1.0?

                                                                      Julia 1.0 came out well over 2 years ago. Since then a lot has changed and a lot hasn’t. Julia 1.0 was a commitment to no breaking changes, but that is not to say no new features have been added to the language. Julia 1.6 is a huge release and it is coming out relatively soon. RC-1 was released recently. I suspect we have at least a few more weeks before the final release. The Julia Core team take

                                                                      • From Python to Elixir Machine Learning

                                                                        As Elixir's Machine Learning (ML) ecosystem grows, many Elixir enthusiasts who wish to adopt the new machine learning libraries in their projects are stuck at a crossroads of wanting to move away from their existing ML stack (typically Python) while not having a clear path of how to do so. I would like to take some time to talk to WHY I believe now is a good time to start porting over Machine Lear

                                                                          From Python to Elixir Machine Learning
                                                                        • Scientific Computing in Rust - aftix's dominion

                                                                          While getting my degree in Physics, I had to take classes in both MatLab and Python for scientific computing. I preferred python, where we used the SciPy and NumPy packages. In fact, I used those packages again (along with matplotlib) in an undergraduate research project simulating bacteria films. There's a catch: I was also pursuing a degree in Computer Science, and Python just wasn't fast enough

                                                                          • cuneicode, and the Future of Text in C

                                                                            Following up from the last post, there is a lot more we need to cover. This was intended to be the post where we talk exclusively about benchmarks and numbers. But, I have unfortunately been perfectly taunted and status-locked, like a monster whose “aggro” was pulled by a tank. The reason, of course, is due to a few folks taking issue with my outright dismissal of the C and C++ APIs (and not showi

                                                                              cuneicode, and the Future of Text in C
                                                                            • はじめての自然言語処理 ELECTRA(BERT の事前学習手法の改良)による固有表現抽出の検証 | オブジェクトの広場

                                                                              今回は BERT における事前学習の改良手法である ELECTRA の検証です。ELECTRA はモデルサイズ、データ、計算量が同一条件であればオリジナルの BERT を凌ぐ性能とのことなので結果が楽しみなところです。事前学習をした後のファインチューニングは、いつも livedoor News Corpus の文書分類ばかりだったので、今回は固有表現抽出を試すことにしました。 1. はじめに 今回は BERT における事前学習の改良手法である ELECTRA 1 の検証です。 BERT に関しては 第3回 で取り上げていますが、トークン化が Sentencepiece である為、トークン単位での処理に難がありました2。今回は ELECTRA を試すにあたり、そのあたりの対応も入れ、 Megagon Labs さんから公開されている UD_Japanese-GSD v2.6-NE 3 を使っ

                                                                                はじめての自然言語処理 ELECTRA(BERT の事前学習手法の改良)による固有表現抽出の検証 | オブジェクトの広場
                                                                              • コスパ良いGPU Cloudを使いたい:Lambda Labs

                                                                                初めての投稿ですがよろしくお願いします、ハンです。 私は福岡の株式会社Fusicの機械学習チームで勤めている者です。機械学習やAWS運用など、困っていることがありましたら気軽にお声かけてください。 この記事では、Lambda LabsのGPU Cloud Serviceを使ってみたレビュー・感想などを書いてみたいと思います。 要約 Lambda Labs、お値段だけを考えると良い! モニタリングなど、提供するサービスが少ないので、自分なりの工夫が必要 使用可能なインスタンス・ストレージの制約があり、Persistanceストレージ連動ができなかったのはすごく残念 なぜLambda Labs?:お値段! 皆さんはクラウドサービスを利用する際、何を一番の選択基準にするのでしょうか? 使用したいGPUの種類や数・求められるセキュリティ・サポート機能など、さまざまな判断基準があると思いますが、以下

                                                                                  コスパ良いGPU Cloudを使いたい:Lambda Labs
                                                                                • AHC001で奇想の浮世絵師「歌川国芳」の絵を再現する - Qiita

                                                                                  Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? はじめに 突然ですが、皆さんは歌川国芳という浮世絵師をご存じでしょうか? 「国芳? 広重ではなくて?」と思われる方もいらっしゃるかも知れません。 歌川広重は「東海道五十三次」などの作品で名が知られた、歌川派を代表する江戸時代の浮世絵師です。 『東海道五十三次』より「日本橋」(本画像を含め、浮世絵は全てwikiより拝借しました。) 一方の歌川国芳は、あまり世間に知られた名前ではないかも知れません。 国芳は、寛政9年(1797)に江戸日本橋で生まれ、文久元年(1861)に没した浮世絵師で、広重とはほぼ同時代に活躍しました。歌川派の初代、歌川

                                                                                    AHC001で奇想の浮世絵師「歌川国芳」の絵を再現する - Qiita