Seriesの作り方
import pandas as pd
new_series = pd.Series(['aa','bb','cc'])
DataFrameの作り方
import pandas as pd
df = pd.DataFrame([['A','53','ga'],['1','tr','21']], columns=['Col1', 'Col2', 'Col3'])
要素をリストで渡せば自動で作ってくれる関数
import pandas as pd
def create_dataframe(elements, rows, columns):
data = {}
for i in range(columns):
column_name = f"列{i + 1}"
data[column_name] = elements[i * rows: (i + 1) * rows]
df = pd.DataFrame(data)
return df