Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas.core.series.series to dataframe

>>> s = pd.Series(["a", "b", "c"],
...               name="vals")
>>> s.to_frame()
  vals
0    a
1    b
2    c
Comment

pandas.core.frame.DataFrame to pandas.core.series.Series

>>> df = pd.DataFrame([list(range(5))], columns=["a{}".format(i) for i in range(5)])
>>> df
   a0  a1  a2  a3  a4
0   0   1   2   3   4
>>> df.iloc[0]
a0    0
a1    1
a2    2
a3    3
a4    4
Name: 0, dtype: int64
>>> type(_)
<class 'pandas.core.series.Series'>
Comment

PREVIOUS NEXT
Code Example
Python :: exclude serializer 
Python :: pd.datafram 
Python :: pandas dataframe sort by column 
Python :: encrypt password with sha512 + python 
Python :: scroll to element selenium python 
Python :: python repet x time 
Python :: make int into string python 
Python :: install python 3.8 on wsl 
Python :: plot cumulative distribution function (cdf) in seaborn 
Python :: python cv2 canny overlay on image 
Python :: how to print all items in a list python 
Python :: break in python 
Python :: dict to attr python 
Python :: append to pythonpath 
Python :: os.getcwd() python 3 
Python :: res.send is not a function 
Python :: while loop odd numbers python 
Python :: find commonalities in dictionary python 
Python :: add values of two columns pandas 
Python :: dataframe fill nan with mode 
Python :: python print emoji 
Python :: hugingface ner 
Python :: python create dataframe by row 
Python :: make virtual environment wrapper python 3 
Python :: torch.load 
Python :: celery timezone setting django 
Python :: python turn off garbage collection 
Python :: radians in python turtle 
Python :: python for loop with index 
Python :: how to return number in binary python 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =