How does pandas convert the df of figure 1 to the df of figure 2


I wrote a part here, that is to say, first convert the original df into a dictionary, and then create a new dictionary
and then operate on these two dictionaries, but there seems to be a problem with the result of a large amount of data

.
Nov.16,2021

PivotTable


df.columns = ['d', 't', 'n']
res = df.merge(pd.DataFrame(list(range(24)),columns=['t']),on='t',how='right').pivot(index='d', columns='t', values='n').dropna(how='all').fillna(0)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8e23f-11b7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8e23f-11b7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?