i am trying to transpose a HTML retrieved code by beautiful soup. The website was having 2 HTML tables in it . i have taken the tables into a variable.
table = pd.read_html(page)
table1 = table[0]
table2 = table[1]
The output of table1 and table2 combined gives :
0 1
0 a A
1 b B
2 c C
3 d D
4 e E
5 f F
6 g G
The 0 and 1 in starting row and column are auto generated by pandas while i have used
table = pd.read_html(url)
I want to reshape the table 1 and table 2 in a such way that
table = ['a','A','b','B','c','C','d','D','e','E','f','F','g','G']
I have other list
Second_list = ['AA','BB','CC','DD','EE']
table dataframe should be matching with second_list so that both can be combined
table = table + Second_list
so that output of table would be
['a','A','b','B','c','C','d','D','e','E','f','F','g','G','AA','BB','CC','DD','EE']
any solution other than above approach is much appreciated, the goal was to remove the auto generated columns and rows by pandas and make the multicolumn data into single row
Thanks a lot in advance, have a great day
df.values.flatten()??