Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

dataframe from two series

In [1]: s1 = pd.Series([1, 2], index=['A', 'B'], name='s1')

In [2]: s2 = pd.Series([3, 4], index=['A', 'B'], name='s2')

In [3]: pd.concat([s1, s2], axis=1)
Out[3]:
   s1  s2
A   1   3
B   2   4

In [4]: pd.concat([s1, s2], axis=1).reset_index()
Out[4]:
  index  s1  s2
0     A   1   3
1     B   2   4
Comment

PREVIOUS NEXT
Code Example
Python :: wait until clickable selenium python 
Python :: python multiply list by scalar 
Python :: python code region 
Python :: show rows with a null value pandas 
Python :: python half of string 
Python :: python check if is pandas dataframe 
Python :: tkinter change label text color 
Python :: remove punctuation from string python 
Python :: python app to deb 
Python :: python convert number to base 
Python :: stripping /n in a readlines for a pytgon file 
Python :: seaborn rotate xlabels 
Python :: how to get specific row in pandas 
Python :: python add 1 to count 
Python :: python iterate dictionary in reverse order 
Python :: complex phase python 
Python :: python loop through directory 
Python :: torch summary 
Python :: sort two lists by one python 
Python :: negative cv2 
Python :: seaborn pairplot label rotation 
Python :: python iterate dictionary key value 
Python :: install python3 centos 7.8 
Python :: how to add list item to text file python 
Python :: python get arguments 
Python :: name unnamed column pandas 
Python :: python sys is not defined 
Python :: save pandas dataframe to parquet 
Python :: python system arguments 
Python :: Connecting Kaggle to Google Colab 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =