User Tools

Site Tools


python:pandas

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
python:pandas [2021/08/05 18:29] – [DataFrame] utedasspython:pandas [2022/09/12 00:30] (current) – external edit 127.0.0.1
Line 11: Line 11:
 A DataFrame is like a table, where each row is a Series. A DataFrame identify each row with an index, which defaults to 0..n. Same with the columns. A DataFrame is like a table, where each row is a Series. A DataFrame identify each row with an index, which defaults to 0..n. Same with the columns.
  
 +===== Indexing =====
  
 +<code python>
 +import pandas as pd
 +
 +tabledata = {'name'    :['George', 'Frank', 'John'],\
 +             'surname' :['Jungle', 'Sinatra', 'Wick',\
 +             'mail'    :['jg@jg.com', 'fs@gmail.com', 'wick@burnt.co.uk']}
 +
 +df = pd.DataFrame(tabledata)
 +</code>
 +
 +===== inplace=True =====
 +Most operations (?) creates a new dataset unless the property ''inplace=true'' in function calls.
 +
 +<code python>
 +df.set_index('mail', inplace=True)
 +</code>
python/pandas.1628188143.txt.gz · Last modified: 2022/09/12 00:30 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki