[Updated from time to time] Python memos often used for data analysis [N division, etc.]

Divide the list data into N

from matplotlib import pyplot as plt
import numpy as np
import random

#Divide any number(Division number,Data list)
def division_datas(division_length, datas):
    sort_data = sorted(datas)
    datas = [sort_data[i:i+division_length] for i in range(0, len(datas), division_length)]
    return datas

#0~Generate 100 random numbers of 100
my_data = [random.randint(0, 100) for i in range(100)]

#Try to divide the data into 15
division_data_ls = division_datas(15, my_data)
print(division_data_ls)

Recommended Posts

[Updated from time to time] Python memos often used for data analysis [N division, etc.]
Private Python handbook (updated from time to time)
[Python] Flow from web scraping to data analysis
progate Python learning memo (updated from time to time)
Useful help sites, etc. (updated from time to time)
Astro: Python modules / functions often used for analysis
(Preserved version: Updated from time to time) A collection of useful tutorials for data analysis hackathons by Team AI
[For beginners] How to study Python3 data analysis exam
Machine learning python code summary (updated from time to time)
Apache settings, log confirmation, etc. (* Updated from time to time)
A memorandum of commands, packages, terms, etc. used in linux (updated from time to time)
Anaconda updated from 4.2.0 to 4.3.0 (python3.5 updated to python3.6)
Python for Data Analysis Chapter 2
Python for Data Analysis Chapter 3
[Understand in the shortest time] Python basics for data analysis
Meteorology x Python ~ From weather data acquisition to spectrum analysis ~
Summary of folders where Ruby, Python, PostgreSQL, etc. are installed on macOS (updated from time to time)
Ported from R language of "Sazae-san's rock-paper-scissors data analysis" to Python
vtkXMLUnstructuredGridReader Summary (updated from time to time)
vtkOpenFOAMReader Summary (Updated from time to time)
Python: Time Series Analysis: Preprocessing Time Series Data
Engineer vocabulary (updated from time to time)
Introduction to Data Analysis with Python P17-P26 [ch02 1.usa.gov data from bit.ly]
Tensorflow memo [updated from time to time]
Python (from first time to execution)
Preprocessing template for data analysis (Python)
git / python> git log analysis (v0.1, v0.2)> Implementation to estimate work time from git log
[Note] AI / machine learning / python related websites [updated from time to time]
Python visualization tool for data analysis work
vtkClipPolyData / DataSet Summary (Updated from time to time)
Python> Output numbers from 1 to 100, 501 to 600> For csv
How to use "deque" for Python data
[Updated from time to time] PostmarketOS related notes
Summary of vtkThreshold (updated from time to time)
[Python] From morphological analysis of CSV data to CSV output and graph display [GiNZA]
Data analysis in Python Summary of sources to look at first for beginners
Get time series data from k-db.com in Python
Summary of gcc options (updated from time to time)
[Updated from time to time] LetCode algorithm and library
[CovsirPhy] COVID-19 Python Package for Data Analysis: Data loading
[Python] How to read data from CIFAR-10 and CIFAR-100
Notes on machine learning (updated from time to time)
An introduction to statistical modeling for data analysis
OpenFOAM post-processing cheat sheet (updated from time to time)
How to use data analysis tools for beginners
[Impression] [Data analysis starting from zero] Introduction to Python data science learned in business cases
[Python] Save PDF from Google Colaboratory to Google Drive! -Let's collect data for machine learning-
Data analysis python
Tool to make mask image for ETC in Python
Data analysis for improving POG 1 ~ Web scraping with Python ~
How to scrape image data from flickr with python
Python 3.4 Create Windows7-64bit environment (for financial time series analysis)
[Updated from time to time] Review of Let Code NumPy
Reading Note: An Introduction to Data Analysis with Python
Send data from Python to Processing via socket communication
List of Python code used in big data analysis
[CovsirPhy] COVID-19 Python package for data analysis: SIR-F model
[CovsirPhy] COVID-19 Python package for data analysis: S-R trend analysis
[CovsirPhy] COVID-19 Python Package for Data Analysis: SIR model
[CovsirPhy] COVID-19 Python Package for Data Analysis: Parameter estimation
I read the Chainer reference (updated from time to time)